Skip to content

Commit 0ff088c

Browse files
committed
Auto merge of #61283 - pietroalbini:beta-rollup, r=pietroalbini
[beta] Rollup backports Rolled up: * [beta] adjust deprecation date of mem::uninitialized #61160 Cherry-picked: * Fix ICE with inconsistent macro matchers #61046 * Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators." #61057 * debuginfo: Revert to old/more verbose behavior for -Cdebuginfo=1 #61007 r? @ghost
2 parents 3a5d62b + 4f22a66 commit 0ff088c

File tree

21 files changed

+79
-170
lines changed

21 files changed

+79
-170
lines changed

src/liballoc/collections/binary_heap.rs

-15
Original file line numberDiff line numberDiff line change
@@ -1035,11 +1035,6 @@ impl<'a, T> Iterator for Iter<'a, T> {
10351035
fn size_hint(&self) -> (usize, Option<usize>) {
10361036
self.iter.size_hint()
10371037
}
1038-
1039-
#[inline]
1040-
fn last(mut self) -> Option<&'a T> {
1041-
self.next_back()
1042-
}
10431038
}
10441039

10451040
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1095,11 +1090,6 @@ impl<T> Iterator for IntoIter<T> {
10951090
fn size_hint(&self) -> (usize, Option<usize>) {
10961091
self.iter.size_hint()
10971092
}
1098-
1099-
#[inline]
1100-
fn last(mut self) -> Option<T> {
1101-
self.next_back()
1102-
}
11031093
}
11041094

11051095
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1146,11 +1136,6 @@ impl<T> Iterator for Drain<'_, T> {
11461136
fn size_hint(&self) -> (usize, Option<usize>) {
11471137
self.iter.size_hint()
11481138
}
1149-
1150-
#[inline]
1151-
fn last(mut self) -> Option<T> {
1152-
self.next_back()
1153-
}
11541139
}
11551140

11561141
#[stable(feature = "drain", since = "1.6.0")]

src/liballoc/collections/btree/map.rs

-40
Original file line numberDiff line numberDiff line change
@@ -1193,11 +1193,6 @@ impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {
11931193
fn size_hint(&self) -> (usize, Option<usize>) {
11941194
(self.length, Some(self.length))
11951195
}
1196-
1197-
#[inline]
1198-
fn last(mut self) -> Option<(&'a K, &'a V)> {
1199-
self.next_back()
1200-
}
12011196
}
12021197

12031198
#[stable(feature = "fused", since = "1.26.0")]
@@ -1258,11 +1253,6 @@ impl<'a, K: 'a, V: 'a> Iterator for IterMut<'a, K, V> {
12581253
fn size_hint(&self) -> (usize, Option<usize>) {
12591254
(self.length, Some(self.length))
12601255
}
1261-
1262-
#[inline]
1263-
fn last(mut self) -> Option<(&'a K, &'a mut V)> {
1264-
self.next_back()
1265-
}
12661256
}
12671257

12681258
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1369,11 +1359,6 @@ impl<K, V> Iterator for IntoIter<K, V> {
13691359
fn size_hint(&self) -> (usize, Option<usize>) {
13701360
(self.length, Some(self.length))
13711361
}
1372-
1373-
#[inline]
1374-
fn last(mut self) -> Option<(K, V)> {
1375-
self.next_back()
1376-
}
13771362
}
13781363

13791364
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1436,11 +1421,6 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
14361421
fn size_hint(&self) -> (usize, Option<usize>) {
14371422
self.inner.size_hint()
14381423
}
1439-
1440-
#[inline]
1441-
fn last(mut self) -> Option<&'a K> {
1442-
self.next_back()
1443-
}
14441424
}
14451425

14461426
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1478,11 +1458,6 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
14781458
fn size_hint(&self) -> (usize, Option<usize>) {
14791459
self.inner.size_hint()
14801460
}
1481-
1482-
#[inline]
1483-
fn last(mut self) -> Option<&'a V> {
1484-
self.next_back()
1485-
}
14861461
}
14871462

14881463
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1520,11 +1495,6 @@ impl<'a, K, V> Iterator for Range<'a, K, V> {
15201495
unsafe { Some(self.next_unchecked()) }
15211496
}
15221497
}
1523-
1524-
#[inline]
1525-
fn last(mut self) -> Option<(&'a K, &'a V)> {
1526-
self.next_back()
1527-
}
15281498
}
15291499

15301500
#[stable(feature = "map_values_mut", since = "1.10.0")]
@@ -1538,11 +1508,6 @@ impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
15381508
fn size_hint(&self) -> (usize, Option<usize>) {
15391509
self.inner.size_hint()
15401510
}
1541-
1542-
#[inline]
1543-
fn last(mut self) -> Option<&'a mut V> {
1544-
self.next_back()
1545-
}
15461511
}
15471512

15481513
#[stable(feature = "map_values_mut", since = "1.10.0")]
@@ -1661,11 +1626,6 @@ impl<'a, K, V> Iterator for RangeMut<'a, K, V> {
16611626
unsafe { Some(self.next_unchecked()) }
16621627
}
16631628
}
1664-
1665-
#[inline]
1666-
fn last(mut self) -> Option<(&'a K, &'a mut V)> {
1667-
self.next_back()
1668-
}
16691629
}
16701630

16711631
impl<'a, K, V> RangeMut<'a, K, V> {

src/liballoc/collections/btree/set.rs

-15
Original file line numberDiff line numberDiff line change
@@ -1019,11 +1019,6 @@ impl<'a, T> Iterator for Iter<'a, T> {
10191019
fn size_hint(&self) -> (usize, Option<usize>) {
10201020
self.iter.size_hint()
10211021
}
1022-
1023-
#[inline]
1024-
fn last(mut self) -> Option<&'a T> {
1025-
self.next_back()
1026-
}
10271022
}
10281023
#[stable(feature = "rust1", since = "1.0.0")]
10291024
impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
@@ -1049,11 +1044,6 @@ impl<T> Iterator for IntoIter<T> {
10491044
fn size_hint(&self) -> (usize, Option<usize>) {
10501045
self.iter.size_hint()
10511046
}
1052-
1053-
#[inline]
1054-
fn last(mut self) -> Option<T> {
1055-
self.next_back()
1056-
}
10571047
}
10581048
#[stable(feature = "rust1", since = "1.0.0")]
10591049
impl<T> DoubleEndedIterator for IntoIter<T> {
@@ -1083,11 +1073,6 @@ impl<'a, T> Iterator for Range<'a, T> {
10831073
fn next(&mut self) -> Option<&'a T> {
10841074
self.iter.next().map(|(k, _)| k)
10851075
}
1086-
1087-
#[inline]
1088-
fn last(mut self) -> Option<&'a T> {
1089-
self.next_back()
1090-
}
10911076
}
10921077

10931078
#[stable(feature = "btree_range", since = "1.17.0")]

src/liballoc/string.rs

-4
Original file line numberDiff line numberDiff line change
@@ -2385,10 +2385,6 @@ impl Iterator for Drain<'_> {
23852385
fn size_hint(&self) -> (usize, Option<usize>) {
23862386
self.iter.size_hint()
23872387
}
2388-
#[inline]
2389-
fn last(mut self) -> Option<char> {
2390-
self.next_back()
2391-
}
23922388
}
23932389

23942390
#[stable(feature = "drain", since = "1.6.0")]

src/liballoc/vec.rs

-14
Original file line numberDiff line numberDiff line change
@@ -2395,11 +2395,6 @@ impl<T> Iterator for IntoIter<T> {
23952395
fn count(self) -> usize {
23962396
self.len()
23972397
}
2398-
2399-
#[inline]
2400-
fn last(mut self) -> Option<T> {
2401-
self.next_back()
2402-
}
24032398
}
24042399

24052400
#[stable(feature = "rust1", since = "1.0.0")]
@@ -2519,11 +2514,6 @@ impl<T> Iterator for Drain<'_, T> {
25192514
fn size_hint(&self) -> (usize, Option<usize>) {
25202515
self.iter.size_hint()
25212516
}
2522-
2523-
#[inline]
2524-
fn last(mut self) -> Option<T> {
2525-
self.next_back()
2526-
}
25272517
}
25282518

25292519
#[stable(feature = "drain", since = "1.6.0")]
@@ -2593,10 +2583,6 @@ impl<I: Iterator> Iterator for Splice<'_, I> {
25932583
fn size_hint(&self) -> (usize, Option<usize>) {
25942584
self.drain.size_hint()
25952585
}
2596-
2597-
fn last(mut self) -> Option<Self::Item> {
2598-
self.next_back()
2599-
}
26002586
}
26012587

26022588
#[stable(feature = "vec_splice", since = "1.21.0")]

src/libcore/ascii.rs

-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ impl Iterator for EscapeDefault {
117117
type Item = u8;
118118
fn next(&mut self) -> Option<u8> { self.range.next().map(|i| self.data[i]) }
119119
fn size_hint(&self) -> (usize, Option<usize>) { self.range.size_hint() }
120-
#[inline]
121-
fn last(mut self) -> Option<u8> { self.next_back() }
122120
}
123121
#[stable(feature = "rust1", since = "1.0.0")]
124122
impl DoubleEndedIterator for EscapeDefault {

src/libcore/iter/adapters/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ impl<I> Iterator for Rev<I> where I: DoubleEndedIterator {
7373
{
7474
self.iter.position(predicate)
7575
}
76-
77-
#[inline]
78-
fn last(mut self) -> Option<Self::Item> {
79-
self.next_back()
80-
}
8176
}
8277

8378
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/mem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ pub unsafe fn zeroed<T>() -> T {
466466
/// [`MaybeUninit<T>`]: union.MaybeUninit.html
467467
/// [inv]: union.MaybeUninit.html#initialization-invariant
468468
#[inline]
469-
#[rustc_deprecated(since = "1.40.0", reason = "use `mem::MaybeUninit` instead")]
469+
#[rustc_deprecated(since = "1.38.0", reason = "use `mem::MaybeUninit` instead")]
470470
#[stable(feature = "rust1", since = "1.0.0")]
471471
pub unsafe fn uninitialized<T>() -> T {
472472
intrinsics::panic_if_uninhabited::<T>();

src/libcore/slice/mod.rs

-20
Original file line numberDiff line numberDiff line change
@@ -3547,11 +3547,6 @@ impl<'a, T, P> Iterator for Split<'a, T, P> where P: FnMut(&T) -> bool {
35473547
(1, Some(self.v.len() + 1))
35483548
}
35493549
}
3550-
3551-
#[inline]
3552-
fn last(mut self) -> Option<Self::Item> {
3553-
self.next_back()
3554-
}
35553550
}
35563551

35573552
#[stable(feature = "rust1", since = "1.0.0")]
@@ -3650,11 +3645,6 @@ impl<'a, T, P> Iterator for SplitMut<'a, T, P> where P: FnMut(&T) -> bool {
36503645
(1, Some(self.v.len() + 1))
36513646
}
36523647
}
3653-
3654-
#[inline]
3655-
fn last(mut self) -> Option<Self::Item> {
3656-
self.next_back()
3657-
}
36583648
}
36593649

36603650
#[stable(feature = "rust1", since = "1.0.0")]
@@ -3720,11 +3710,6 @@ impl<'a, T, P> Iterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
37203710
fn size_hint(&self) -> (usize, Option<usize>) {
37213711
self.inner.size_hint()
37223712
}
3723-
3724-
#[inline]
3725-
fn last(mut self) -> Option<Self::Item> {
3726-
self.next_back()
3727-
}
37283713
}
37293714

37303715
#[stable(feature = "slice_rsplit", since = "1.27.0")]
@@ -3789,11 +3774,6 @@ impl<'a, T, P> Iterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
37893774
fn size_hint(&self) -> (usize, Option<usize>) {
37903775
self.inner.size_hint()
37913776
}
3792-
3793-
#[inline]
3794-
fn last(mut self) -> Option<Self::Item> {
3795-
self.next_back()
3796-
}
37973777
}
37983778

37993779
#[stable(feature = "slice_rsplit", since = "1.27.0")]

src/libcore/str/mod.rs

-20
Original file line numberDiff line numberDiff line change
@@ -1333,11 +1333,6 @@ impl<'a> Iterator for Lines<'a> {
13331333
fn size_hint(&self) -> (usize, Option<usize>) {
13341334
self.0.size_hint()
13351335
}
1336-
1337-
#[inline]
1338-
fn last(mut self) -> Option<Self::Item> {
1339-
self.next_back()
1340-
}
13411336
}
13421337

13431338
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1384,11 +1379,6 @@ impl<'a> Iterator for LinesAny<'a> {
13841379
fn size_hint(&self) -> (usize, Option<usize>) {
13851380
self.0.size_hint()
13861381
}
1387-
1388-
#[inline]
1389-
fn last(mut self) -> Option<Self::Item> {
1390-
self.next_back()
1391-
}
13921382
}
13931383

13941384
#[stable(feature = "rust1", since = "1.0.0")]
@@ -4231,11 +4221,6 @@ impl<'a> Iterator for SplitWhitespace<'a> {
42314221
fn size_hint(&self) -> (usize, Option<usize>) {
42324222
self.inner.size_hint()
42334223
}
4234-
4235-
#[inline]
4236-
fn last(mut self) -> Option<Self::Item> {
4237-
self.next_back()
4238-
}
42394224
}
42404225

42414226
#[stable(feature = "split_whitespace", since = "1.1.0")]
@@ -4262,11 +4247,6 @@ impl<'a> Iterator for SplitAsciiWhitespace<'a> {
42624247
fn size_hint(&self) -> (usize, Option<usize>) {
42634248
self.inner.size_hint()
42644249
}
4265-
4266-
#[inline]
4267-
fn last(mut self) -> Option<Self::Item> {
4268-
self.next_back()
4269-
}
42704250
}
42714251

42724252
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]

src/librustc_codegen_llvm/debuginfo/metadata.rs

+21-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
3131
use rustc::ty::layout::{self, Align, Integer, IntegerExt, LayoutOf,
3232
PrimitiveExt, Size, TyLayout, VariantIdx};
3333
use rustc::ty::subst::UnpackedKind;
34-
use rustc::session::config;
34+
use rustc::session::config::{self, DebugInfo};
3535
use rustc::util::nodemap::FxHashMap;
3636
use rustc_fs_util::path_to_c_string;
3737
use rustc_data_structures::small_c_str::SmallCStr;
@@ -925,7 +925,26 @@ pub fn compile_unit_metadata(tcx: TyCtxt<'_, '_, '_>,
925925
let producer = CString::new(producer).unwrap();
926926
let flags = "\0";
927927
let split_name = "\0";
928-
let kind = DebugEmissionKind::from_generic(tcx.sess.opts.debuginfo);
928+
929+
// FIXME(#60020):
930+
//
931+
// This should actually be
932+
//
933+
// ```
934+
// let kind = DebugEmissionKind::from_generic(tcx.sess.opts.debuginfo);
935+
// ```
936+
//
937+
// that is, we should set LLVM's emission kind to `LineTablesOnly` if
938+
// we are compiling with "limited" debuginfo. However, some of the
939+
// existing tools relied on slightly more debuginfo being generated than
940+
// would be the case with `LineTablesOnly`, and we did not want to break
941+
// these tools in a "drive-by fix", without a good idea or plan about
942+
// what limited debuginfo should exactly look like. So for now we keep
943+
// the emission kind as `FullDebug`.
944+
//
945+
// See https://github.com/rust-lang/rust/issues/60020 for details.
946+
let kind = DebugEmissionKind::FullDebug;
947+
assert!(tcx.sess.opts.debuginfo != DebugInfo::None);
929948

930949
unsafe {
931950
let file_metadata = llvm::LLVMRustDIBuilderCreateFile(

src/libstd/env.rs

-6
Original file line numberDiff line numberDiff line change
@@ -746,10 +746,6 @@ impl Iterator for Args {
746746
self.inner.next().map(|s| s.into_string().unwrap())
747747
}
748748
fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() }
749-
#[inline]
750-
fn last(mut self) -> Option<String> {
751-
self.next_back()
752-
}
753749
}
754750

755751
#[stable(feature = "env", since = "1.0.0")]
@@ -785,8 +781,6 @@ impl Iterator for ArgsOs {
785781
type Item = OsString;
786782
fn next(&mut self) -> Option<OsString> { self.inner.next() }
787783
fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() }
788-
#[inline]
789-
fn last(mut self) -> Option<OsString> { self.next_back() }
790784
}
791785

792786
#[stable(feature = "env", since = "1.0.0")]

0 commit comments

Comments
 (0)