Skip to content

Commit

Permalink
Auto merge of #61283 - pietroalbini:beta-rollup, r=pietroalbini
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
bors committed May 29, 2019
2 parents 3a5d62b + 4f22a66 commit 0ff088c
Show file tree
Hide file tree
Showing 21 changed files with 79 additions and 170 deletions.
15 changes: 0 additions & 15 deletions src/liballoc/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,11 +1035,6 @@ impl<'a, T> Iterator for Iter<'a, T> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}

#[inline]
fn last(mut self) -> Option<&'a T> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1095,11 +1090,6 @@ impl<T> Iterator for IntoIter<T> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}

#[inline]
fn last(mut self) -> Option<T> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1146,11 +1136,6 @@ impl<T> Iterator for Drain<'_, T> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}

#[inline]
fn last(mut self) -> Option<T> {
self.next_back()
}
}

#[stable(feature = "drain", since = "1.6.0")]
Expand Down
40 changes: 0 additions & 40 deletions src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,11 +1193,6 @@ impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> {
fn size_hint(&self) -> (usize, Option<usize>) {
(self.length, Some(self.length))
}

#[inline]
fn last(mut self) -> Option<(&'a K, &'a V)> {
self.next_back()
}
}

#[stable(feature = "fused", since = "1.26.0")]
Expand Down Expand Up @@ -1258,11 +1253,6 @@ impl<'a, K: 'a, V: 'a> Iterator for IterMut<'a, K, V> {
fn size_hint(&self) -> (usize, Option<usize>) {
(self.length, Some(self.length))
}

#[inline]
fn last(mut self) -> Option<(&'a K, &'a mut V)> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1369,11 +1359,6 @@ impl<K, V> Iterator for IntoIter<K, V> {
fn size_hint(&self) -> (usize, Option<usize>) {
(self.length, Some(self.length))
}

#[inline]
fn last(mut self) -> Option<(K, V)> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1436,11 +1421,6 @@ impl<'a, K, V> Iterator for Keys<'a, K, V> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}

#[inline]
fn last(mut self) -> Option<&'a K> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1478,11 +1458,6 @@ impl<'a, K, V> Iterator for Values<'a, K, V> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}

#[inline]
fn last(mut self) -> Option<&'a V> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1520,11 +1495,6 @@ impl<'a, K, V> Iterator for Range<'a, K, V> {
unsafe { Some(self.next_unchecked()) }
}
}

#[inline]
fn last(mut self) -> Option<(&'a K, &'a V)> {
self.next_back()
}
}

#[stable(feature = "map_values_mut", since = "1.10.0")]
Expand All @@ -1538,11 +1508,6 @@ impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}

#[inline]
fn last(mut self) -> Option<&'a mut V> {
self.next_back()
}
}

#[stable(feature = "map_values_mut", since = "1.10.0")]
Expand Down Expand Up @@ -1661,11 +1626,6 @@ impl<'a, K, V> Iterator for RangeMut<'a, K, V> {
unsafe { Some(self.next_unchecked()) }
}
}

#[inline]
fn last(mut self) -> Option<(&'a K, &'a mut V)> {
self.next_back()
}
}

impl<'a, K, V> RangeMut<'a, K, V> {
Expand Down
15 changes: 0 additions & 15 deletions src/liballoc/collections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1019,11 +1019,6 @@ impl<'a, T> Iterator for Iter<'a, T> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}

#[inline]
fn last(mut self) -> Option<&'a T> {
self.next_back()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
Expand All @@ -1049,11 +1044,6 @@ impl<T> Iterator for IntoIter<T> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}

#[inline]
fn last(mut self) -> Option<T> {
self.next_back()
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> DoubleEndedIterator for IntoIter<T> {
Expand Down Expand Up @@ -1083,11 +1073,6 @@ impl<'a, T> Iterator for Range<'a, T> {
fn next(&mut self) -> Option<&'a T> {
self.iter.next().map(|(k, _)| k)
}

#[inline]
fn last(mut self) -> Option<&'a T> {
self.next_back()
}
}

#[stable(feature = "btree_range", since = "1.17.0")]
Expand Down
4 changes: 0 additions & 4 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2385,10 +2385,6 @@ impl Iterator for Drain<'_> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}
#[inline]
fn last(mut self) -> Option<char> {
self.next_back()
}
}

#[stable(feature = "drain", since = "1.6.0")]
Expand Down
14 changes: 0 additions & 14 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2395,11 +2395,6 @@ impl<T> Iterator for IntoIter<T> {
fn count(self) -> usize {
self.len()
}

#[inline]
fn last(mut self) -> Option<T> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -2519,11 +2514,6 @@ impl<T> Iterator for Drain<'_, T> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint()
}

#[inline]
fn last(mut self) -> Option<T> {
self.next_back()
}
}

#[stable(feature = "drain", since = "1.6.0")]
Expand Down Expand Up @@ -2593,10 +2583,6 @@ impl<I: Iterator> Iterator for Splice<'_, I> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.drain.size_hint()
}

fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "vec_splice", since = "1.21.0")]
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ impl Iterator for EscapeDefault {
type Item = u8;
fn next(&mut self) -> Option<u8> { self.range.next().map(|i| self.data[i]) }
fn size_hint(&self) -> (usize, Option<usize>) { self.range.size_hint() }
#[inline]
fn last(mut self) -> Option<u8> { self.next_back() }
}
#[stable(feature = "rust1", since = "1.0.0")]
impl DoubleEndedIterator for EscapeDefault {
Expand Down
5 changes: 0 additions & 5 deletions src/libcore/iter/adapters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ impl<I> Iterator for Rev<I> where I: DoubleEndedIterator {
{
self.iter.position(predicate)
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ pub unsafe fn zeroed<T>() -> T {
/// [`MaybeUninit<T>`]: union.MaybeUninit.html
/// [inv]: union.MaybeUninit.html#initialization-invariant
#[inline]
#[rustc_deprecated(since = "1.40.0", reason = "use `mem::MaybeUninit` instead")]
#[rustc_deprecated(since = "1.38.0", reason = "use `mem::MaybeUninit` instead")]
#[stable(feature = "rust1", since = "1.0.0")]
pub unsafe fn uninitialized<T>() -> T {
intrinsics::panic_if_uninhabited::<T>();
Expand Down
20 changes: 0 additions & 20 deletions src/libcore/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3547,11 +3547,6 @@ impl<'a, T, P> Iterator for Split<'a, T, P> where P: FnMut(&T) -> bool {
(1, Some(self.v.len() + 1))
}
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -3650,11 +3645,6 @@ impl<'a, T, P> Iterator for SplitMut<'a, T, P> where P: FnMut(&T) -> bool {
(1, Some(self.v.len() + 1))
}
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -3720,11 +3710,6 @@ impl<'a, T, P> Iterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "slice_rsplit", since = "1.27.0")]
Expand Down Expand Up @@ -3789,11 +3774,6 @@ impl<'a, T, P> Iterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "slice_rsplit", since = "1.27.0")]
Expand Down
20 changes: 0 additions & 20 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1333,11 +1333,6 @@ impl<'a> Iterator for Lines<'a> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.0.size_hint()
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -1384,11 +1379,6 @@ impl<'a> Iterator for LinesAny<'a> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.0.size_hint()
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -4231,11 +4221,6 @@ impl<'a> Iterator for SplitWhitespace<'a> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "split_whitespace", since = "1.1.0")]
Expand All @@ -4262,11 +4247,6 @@ impl<'a> Iterator for SplitAsciiWhitespace<'a> {
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}

#[inline]
fn last(mut self) -> Option<Self::Item> {
self.next_back()
}
}

#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
Expand Down
23 changes: 21 additions & 2 deletions src/librustc_codegen_llvm/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use rustc::ty::{self, AdtKind, ParamEnv, Ty, TyCtxt};
use rustc::ty::layout::{self, Align, Integer, IntegerExt, LayoutOf,
PrimitiveExt, Size, TyLayout, VariantIdx};
use rustc::ty::subst::UnpackedKind;
use rustc::session::config;
use rustc::session::config::{self, DebugInfo};
use rustc::util::nodemap::FxHashMap;
use rustc_fs_util::path_to_c_string;
use rustc_data_structures::small_c_str::SmallCStr;
Expand Down Expand Up @@ -925,7 +925,26 @@ pub fn compile_unit_metadata(tcx: TyCtxt<'_, '_, '_>,
let producer = CString::new(producer).unwrap();
let flags = "\0";
let split_name = "\0";
let kind = DebugEmissionKind::from_generic(tcx.sess.opts.debuginfo);

// FIXME(#60020):
//
// This should actually be
//
// ```
// let kind = DebugEmissionKind::from_generic(tcx.sess.opts.debuginfo);
// ```
//
// that is, we should set LLVM's emission kind to `LineTablesOnly` if
// we are compiling with "limited" debuginfo. However, some of the
// existing tools relied on slightly more debuginfo being generated than
// would be the case with `LineTablesOnly`, and we did not want to break
// these tools in a "drive-by fix", without a good idea or plan about
// what limited debuginfo should exactly look like. So for now we keep
// the emission kind as `FullDebug`.
//
// See https://github.com/rust-lang/rust/issues/60020 for details.
let kind = DebugEmissionKind::FullDebug;
assert!(tcx.sess.opts.debuginfo != DebugInfo::None);

unsafe {
let file_metadata = llvm::LLVMRustDIBuilderCreateFile(
Expand Down
6 changes: 0 additions & 6 deletions src/libstd/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,6 @@ impl Iterator for Args {
self.inner.next().map(|s| s.into_string().unwrap())
}
fn size_hint(&self) -> (usize, Option<usize>) { self.inner.size_hint() }
#[inline]
fn last(mut self) -> Option<String> {
self.next_back()
}
}

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

#[stable(feature = "env", since = "1.0.0")]
Expand Down
Loading

0 comments on commit 0ff088c

Please sign in to comment.