]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #54596 - mjbshaw:drop, r=RalfJung
authorbors <bors@rust-lang.org>
Sun, 30 Sep 2018 12:00:45 +0000 (12:00 +0000)
committerbors <bors@rust-lang.org>
Sun, 30 Sep 2018 12:00:45 +0000 (12:00 +0000)
Make core::mem::needs_drop a const fn

This fixes #51929.

169 files changed:
src/bootstrap/channel.rs
src/liballoc/lib.rs
src/liballoc/tests/lib.rs
src/liballoc_jemalloc/lib.rs
src/liballoc_system/lib.rs
src/libarena/lib.rs
src/libcore/lib.rs
src/libcore/mem.rs
src/libcore/nonzero.rs
src/libcore/num/mod.rs
src/libcore/tests/nonzero.rs
src/libfmt_macros/lib.rs
src/libgraphviz/lib.rs
src/libpanic_abort/lib.rs
src/libpanic_unwind/lib.rs
src/libproc_macro/lib.rs
src/libprofiler_builtins/lib.rs
src/librustc/dep_graph/dep_node.rs
src/librustc/hir/def_id.rs
src/librustc/hir/lowering.rs
src/librustc/hir/map/blocks.rs
src/librustc/hir/map/mod.rs
src/librustc/hir/mod.rs
src/librustc/hir/print.rs
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/nice_region_error/util.rs
src/librustc/infer/error_reporting/note.rs
src/librustc/infer/higher_ranked/mod.rs
src/librustc/infer/lexical_region_resolve/graphviz.rs
src/librustc/infer/lexical_region_resolve/mod.rs
src/librustc/infer/mod.rs
src/librustc/infer/opaque_types/mod.rs
src/librustc/infer/outlives/free_region_map.rs
src/librustc/infer/region_constraints/mod.rs
src/librustc/lib.rs
src/librustc/lint/builtin.rs
src/librustc/lint/context.rs
src/librustc/lint/levels.rs
src/librustc/lint/mod.rs
src/librustc/middle/cstore.rs
src/librustc/middle/dead.rs
src/librustc/middle/dependency_format.rs
src/librustc/middle/entry.rs
src/librustc/middle/exported_symbols.rs
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/privacy.rs
src/librustc/middle/reachable.rs
src/librustc/middle/region.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/weak_lang_items.rs
src/librustc/mir/cache.rs
src/librustc/mir/interpret/error.rs
src/librustc/mir/interpret/mod.rs
src/librustc/mir/mod.rs
src/librustc/session/config.rs
src/librustc/session/mod.rs
src/librustc/session/search_paths.rs
src/librustc/traits/auto_trait.rs
src/librustc/traits/coherence.rs
src/librustc/traits/error_reporting.rs
src/librustc/traits/mod.rs
src/librustc/traits/on_unimplemented.rs
src/librustc/traits/query/type_op/custom.rs
src/librustc/traits/select.rs
src/librustc/traits/specialize/mod.rs
src/librustc/traits/specialize/specialization_graph.rs
src/librustc/traits/structural_impls.rs
src/librustc/ty/codec.rs
src/librustc/ty/context.rs
src/librustc/ty/erase_regions.rs
src/librustc/ty/error.rs
src/librustc/ty/fast_reject.rs
src/librustc/ty/flags.rs
src/librustc/ty/fold.rs
src/librustc/ty/instance.rs
src/librustc/ty/item_path.rs
src/librustc/ty/layout.rs
src/librustc/ty/mod.rs
src/librustc/ty/query/README.md
src/librustc/ty/query/config.rs
src/librustc/ty/query/keys.rs
src/librustc/ty/query/mod.rs
src/librustc/ty/query/on_disk_cache.rs
src/librustc/ty/query/plumbing.rs
src/librustc/ty/steal.rs
src/librustc/ty/sty.rs
src/librustc/ty/subst.rs
src/librustc/ty/util.rs
src/librustc/util/bug.rs
src/librustc/util/common.rs
src/librustc/util/ppaux.rs
src/librustc/util/profiling.rs
src/librustc_allocator/lib.rs
src/librustc_apfloat/lib.rs
src/librustc_asan/lib.rs
src/librustc_borrowck/lib.rs
src/librustc_codegen_llvm/lib.rs
src/librustc_codegen_llvm/type_of.rs
src/librustc_codegen_utils/lib.rs
src/librustc_cratesio_shim/src/lib.rs
src/librustc_data_structures/lib.rs
src/librustc_driver/lib.rs
src/librustc_errors/lib.rs
src/librustc_incremental/lib.rs
src/librustc_lint/lib.rs
src/librustc_llvm/lib.rs
src/librustc_lsan/lib.rs
src/librustc_metadata/lib.rs
src/librustc_mir/borrow_check/nll/type_check/input_output.rs
src/librustc_mir/borrow_check/nll/type_check/mod.rs
src/librustc_mir/lib.rs
src/librustc_msan/lib.rs
src/librustc_passes/lib.rs
src/librustc_platform_intrinsics/lib.rs
src/librustc_plugin/lib.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/lib.rs
src/librustc_save_analysis/lib.rs
src/librustc_target/lib.rs
src/librustc_traits/lib.rs
src/librustc_tsan/lib.rs
src/librustc_typeck/astconv.rs
src/librustc_typeck/check_unused.rs
src/librustc_typeck/coherence/builtin.rs
src/librustc_typeck/coherence/inherent_impls.rs
src/librustc_typeck/coherence/mod.rs
src/librustc_typeck/coherence/orphan.rs
src/librustc_typeck/coherence/unsafety.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/constrained_type_params.rs
src/librustc_typeck/impl_wf_check.rs
src/librustc_typeck/lib.rs
src/librustc_typeck/outlives/mod.rs
src/librustc_typeck/outlives/test.rs
src/librustc_typeck/outlives/utils.rs
src/librustc_typeck/variance/mod.rs
src/librustdoc/lib.rs
src/libserialize/lib.rs
src/libstd/alloc.rs
src/libstd/lib.rs
src/libstd/panicking.rs
src/libsyntax/lib.rs
src/libsyntax_ext/lib.rs
src/libsyntax_pos/lib.rs
src/libterm/lib.rs
src/libtest/lib.rs
src/libunwind/lib.rs
src/stage0.txt
src/test/codegen/function-arguments.rs
src/test/compile-fail-fulldeps/auxiliary/lint_for_crate.rs
src/test/compile-fail-fulldeps/auxiliary/lint_group_plugin_test.rs
src/test/compile-fail-fulldeps/auxiliary/lint_plugin_test.rs
src/test/run-pass-fulldeps/auxiliary/lint_for_crate.rs
src/test/run-pass-fulldeps/proc-macro/auxiliary/issue-40001-plugin.rs
src/test/run-pass/issue-54462-mutable-noalias-correctness.rs [new file with mode: 0644]
src/test/run-pass/macros/macro-first-set.rs
src/test/run-pass/macros/macro-pub-matcher.rs
src/test/ui-fulldeps/auxiliary/lint_group_plugin_test.rs
src/test/ui-fulldeps/auxiliary/lint_plugin_test.rs
src/test/ui-fulldeps/auxiliary/lint_tool_test.rs
src/test/ui/impl-trait/closure-calling-parent-fn.rs [new file with mode: 0644]
src/test/ui/issues/issue-42755.rs
src/test/ui/issues/issue-42755.stderr
src/test/ui/lint/unreachable_pub-pub_crate.rs
src/test/ui/lint/unreachable_pub-pub_crate.stderr
src/test/ui/lint/unreachable_pub.rs
src/test/ui/lint/unreachable_pub.stderr

index fa2b58fb2daa711714407124900514f49798d31b..91bec69cfa401913105aa44418b6b86a88e28fbd 100644 (file)
@@ -24,7 +24,7 @@
 use config::Config;
 
 // The version number
-pub const CFG_RELEASE_NUM: &str = "1.30.0";
+pub const CFG_RELEASE_NUM: &str = "1.31.0";
 
 pub struct GitInfo {
     inner: Option<Info>,
index f92075cc84e509a739ad3ef8984c77d2f1f27437..5f9ceb8599cf51321e4c15542d6708004d2fc7ef 100644 (file)
@@ -76,7 +76,6 @@
 
 #![cfg_attr(not(test), feature(fn_traits))]
 #![cfg_attr(not(test), feature(generator_trait))]
-#![cfg_attr(not(stage0), feature(nll))]
 #![cfg_attr(test, feature(test))]
 
 #![feature(allocator_api)]
@@ -87,8 +86,7 @@
 #![feature(box_syntax)]
 #![feature(cfg_target_has_atomic)]
 #![feature(coerce_unsized)]
-#![cfg_attr(stage0, feature(const_fn))]
-#![cfg_attr(not(stage0), feature(min_const_fn))]
+#![feature(min_const_fn)]
 #![feature(core_intrinsics)]
 #![feature(custom_attribute)]
 #![feature(dropck_eyepatch)]
@@ -99,6 +97,7 @@
 #![feature(lang_items)]
 #![feature(libc)]
 #![feature(needs_allocator)]
+#![feature(nll)]
 #![feature(optin_builtin_traits)]
 #![feature(pattern)]
 #![feature(pin)]
index 6ff39227555fe179872fd8597071228679b73885..b9ba319a943caa9d76644d8f12f3538444884d67 100644 (file)
@@ -11,8 +11,7 @@
 #![feature(allocator_api)]
 #![feature(alloc_system)]
 #![feature(box_syntax)]
-#![cfg_attr(stage0, feature(const_fn))]
-#![cfg_attr(not(stage0), feature(min_const_fn))]
+#![feature(min_const_fn)]
 #![feature(drain_filter)]
 #![feature(exact_size_is_empty)]
 #![feature(pattern)]
index bdf0e37a2e672d8de3ae3d274b31a294c12918e8..0065e84a7ad1a88a14199ff8035483c8b3dcf73e 100644 (file)
@@ -16,7 +16,7 @@
 #![feature(core_intrinsics)]
 #![feature(libc)]
 #![feature(linkage)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(staged_api)]
 #![feature(rustc_attrs)]
 #![cfg_attr(dummy_jemalloc, allow(dead_code, unused_extern_crates))]
@@ -90,7 +90,6 @@ fn align_to_flags(align: usize, size: usize) -> c_int {
     // ABI
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rde_alloc(size: usize, align: usize) -> *mut u8 {
         let flags = align_to_flags(align, size);
         let ptr = mallocx(size as size_t, flags) as *mut u8;
@@ -98,7 +97,6 @@ fn align_to_flags(align: usize, size: usize) -> c_int {
     }
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rde_dealloc(ptr: *mut u8,
                                        size: usize,
                                        align: usize) {
@@ -107,7 +105,6 @@ fn align_to_flags(align: usize, size: usize) -> c_int {
     }
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rde_realloc(ptr: *mut u8,
                                        _old_size: usize,
                                        align: usize,
@@ -118,7 +115,6 @@ fn align_to_flags(align: usize, size: usize) -> c_int {
     }
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rde_alloc_zeroed(size: usize, align: usize) -> *mut u8 {
         let ptr = if align <= MIN_ALIGN && align <= size {
             calloc(size as size_t, 1) as *mut u8
index 65204ebf71413027a9bf79f0c0ff048907d03f74..3ef03ec6d585aa268ff3e519e34aaf4a0605dc06 100644 (file)
@@ -17,7 +17,7 @@
 
 #![feature(allocator_api)]
 #![feature(core_intrinsics)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(staged_api)]
 #![feature(rustc_attrs)]
 #![cfg_attr(any(unix, target_os = "cloudabi", target_os = "redox"), feature(libc))]
index 6ad703180c224eecd7e6777c5beb18c17ea8fe5f..b02ae75eff86b99b11f49c2b4debb7215eef19d0 100644 (file)
@@ -26,7 +26,7 @@
 #![feature(alloc)]
 #![feature(core_intrinsics)]
 #![feature(dropck_eyepatch)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(raw_vec_internals)]
 #![cfg_attr(test, feature(test))]
 
index 675e73e952cc2ca011c055a949d38c75e99b18e2..94e84106328e2fea26e43e8c21300c8a817a355f 100644 (file)
@@ -91,7 +91,7 @@
 #![feature(lang_items)]
 #![feature(link_llvm_intrinsics)]
 #![feature(never_type)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(exhaustive_patterns)]
 #![feature(macro_at_most_once_rep)]
 #![feature(no_core)]
index dd3775bff5edd643c9953c39d6fbc9c14bd72f5f..f537add999a0397e30b8ad33c0cb04bfd1eb9a95 100644 (file)
@@ -285,19 +285,10 @@ pub fn forget<T>(t: T) {
 /// [alignment]: ./fn.align_of.html
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
-#[cfg(not(stage0))]
 pub const fn size_of<T>() -> usize {
     intrinsics::size_of::<T>()
 }
 
-#[inline]
-#[stable(feature = "rust1", since = "1.0.0")]
-#[cfg(stage0)]
-/// Ceci n'est pas la documentation
-pub const fn size_of<T>() -> usize {
-    unsafe { intrinsics::size_of::<T>() }
-}
-
 /// Returns the size of the pointed-to value in bytes.
 ///
 /// This is usually the same as `size_of::<T>()`. However, when `T` *has* no
@@ -343,20 +334,10 @@ pub fn size_of_val<T: ?Sized>(val: &T) -> usize {
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_deprecated(reason = "use `align_of` instead", since = "1.2.0")]
-#[cfg(not(stage0))]
 pub fn min_align_of<T>() -> usize {
     intrinsics::min_align_of::<T>()
 }
 
-#[inline]
-#[stable(feature = "rust1", since = "1.0.0")]
-#[rustc_deprecated(reason = "use `align_of` instead", since = "1.2.0")]
-#[cfg(stage0)]
-/// Ceci n'est pas la documentation
-pub fn min_align_of<T>() -> usize {
-    unsafe { intrinsics::min_align_of::<T>() }
-}
-
 /// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to.
 ///
 /// Every reference to a value of the type `T` must be a multiple of this number.
@@ -395,19 +376,10 @@ pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
 /// ```
 #[inline]
 #[stable(feature = "rust1", since = "1.0.0")]
-#[cfg(not(stage0))]
 pub const fn align_of<T>() -> usize {
     intrinsics::min_align_of::<T>()
 }
 
-#[inline]
-#[stable(feature = "rust1", since = "1.0.0")]
-#[cfg(stage0)]
-/// Ceci n'est pas la documentation
-pub const fn align_of<T>() -> usize {
-    unsafe { intrinsics::min_align_of::<T>() }
-}
-
 /// Returns the [ABI]-required minimum alignment of the type of the value that `val` points to.
 ///
 /// Every reference to a value of the type `T` must be a multiple of this number.
index 30067d7e163d21bf43e1f9ab466109c48a553efb..118e75e1ee70469bb275185650ab904a0effc251 100644 (file)
@@ -14,8 +14,7 @@
 
 /// A wrapper type for raw pointers and integers that will never be
 /// NULL or 0 that might allow certain optimizations.
-#[cfg_attr(stage0, lang = "non_zero")]
-#[cfg_attr(not(stage0), rustc_layout_scalar_valid_range_start(1))]
+#[rustc_layout_scalar_valid_range_start(1)]
 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
 #[repr(transparent)]
 pub(crate) struct NonZero<T>(pub(crate) T);
index 12da0455cc56be021cf2bf90db516db6f44e5b61..f054580cba7bc02cd6a1a35d35f24c13df637397 100644 (file)
@@ -93,6 +93,13 @@ pub fn get(self) -> $Int {
 
             }
 
+            #[stable(feature = "from_nonzero", since = "1.31.0")]
+            impl From<$Ty> for $Int {
+                fn from(nonzero: $Ty) -> Self {
+                    nonzero.0 .0
+                }
+            }
+
             impl_nonzero_fmt! {
                 (Debug, Display, Binary, Octal, LowerHex, UpperHex) for $Ty
             }
@@ -341,14 +348,6 @@ pub const fn trailing_zeros(self) -> u32 {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn rotate_left(self, n: u32) -> Self {
-            (self as $UnsignedT).rotate_left(n) as Self
-        }
-
         doc_comment! {
             concat!("Shifts the bits to the left by a specified amount, `n`,
 wrapping the truncated bits to the end of the resulting integer.
@@ -368,20 +367,11 @@ pub fn rotate_left(self, n: u32) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_rotate")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn rotate_left(self, n: u32) -> Self {
                 (self as $UnsignedT).rotate_left(n) as Self
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn rotate_right(self, n: u32) -> Self {
-            (self as $UnsignedT).rotate_right(n) as Self
-        }
-
         doc_comment! {
             concat!("Shifts the bits to the right by a specified amount, `n`,
 wrapping the truncated bits to the beginning of the resulting
@@ -402,7 +392,6 @@ pub fn rotate_right(self, n: u32) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_rotate")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn rotate_right(self, n: u32) -> Self {
                 (self as $UnsignedT).rotate_right(n) as Self
             }
@@ -430,14 +419,6 @@ pub const fn swap_bytes(self) -> Self {
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "reverse_bits", issue = "48763")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn reverse_bits(self) -> Self {
-            (self as $UnsignedT).reverse_bits() as Self
-        }
-
         doc_comment! {
             concat!("Reverses the bit pattern of the integer.
 
@@ -456,7 +437,6 @@ pub fn reverse_bits(self) -> Self {
             #[unstable(feature = "reverse_bits", issue = "48763")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn reverse_bits(self) -> Self {
                 (self as $UnsignedT).reverse_bits() as Self
             }
@@ -1007,16 +987,6 @@ pub fn saturating_pow(self, exp: u32) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_add(self, rhs: Self) -> Self {
-            unsafe {
-                intrinsics::overflowing_add(self, rhs)
-            }
-        }
-
         doc_comment! {
             concat!("Wrapping (modular) addition. Computes `self + rhs`, wrapping around at the
 boundary of the type.
@@ -1034,7 +1004,6 @@ pub fn wrapping_add(self, rhs: Self) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_add(self, rhs: Self) -> Self {
                 unsafe {
                     intrinsics::overflowing_add(self, rhs)
@@ -1042,16 +1011,6 @@ pub const fn wrapping_add(self, rhs: Self) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_sub(self, rhs: Self) -> Self {
-            unsafe {
-                intrinsics::overflowing_sub(self, rhs)
-            }
-        }
-
         doc_comment! {
             concat!("Wrapping (modular) subtraction. Computes `self - rhs`, wrapping around at the
 boundary of the type.
@@ -1069,7 +1028,6 @@ pub fn wrapping_sub(self, rhs: Self) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_sub(self, rhs: Self) -> Self {
                 unsafe {
                     intrinsics::overflowing_sub(self, rhs)
@@ -1077,16 +1035,6 @@ pub const fn wrapping_sub(self, rhs: Self) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_mul(self, rhs: Self) -> Self {
-            unsafe {
-                intrinsics::overflowing_mul(self, rhs)
-            }
-        }
-
         doc_comment! {
             concat!("Wrapping (modular) multiplication. Computes `self * rhs`, wrapping around at
 the boundary of the type.
@@ -1103,7 +1051,6 @@ pub fn wrapping_mul(self, rhs: Self) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_mul(self, rhs: Self) -> Self {
                 unsafe {
                     intrinsics::overflowing_mul(self, rhs)
@@ -1247,16 +1194,6 @@ pub fn wrapping_neg(self) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "num_wrapping", since = "1.2.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_shl(self, rhs: u32) -> Self {
-            unsafe {
-                intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT)
-            }
-        }
-
         doc_comment! {
             concat!("Panic-free bitwise shift-left; yields `self << mask(rhs)`, where `mask` removes
 any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
@@ -1278,7 +1215,6 @@ pub fn wrapping_shl(self, rhs: u32) -> Self {
             #[stable(feature = "num_wrapping", since = "1.2.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_shl(self, rhs: u32) -> Self {
                 unsafe {
                     intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT)
@@ -1286,16 +1222,6 @@ pub const fn wrapping_shl(self, rhs: u32) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "num_wrapping", since = "1.2.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_shr(self, rhs: u32) -> Self {
-            unsafe {
-                intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT)
-            }
-        }
-
         doc_comment! {
             concat!("Panic-free bitwise shift-right; yields `self >> mask(rhs)`, where `mask`
 removes any high-order bits of `rhs` that would cause the shift to exceed the bitwidth of the type.
@@ -1317,7 +1243,6 @@ pub fn wrapping_shr(self, rhs: u32) -> Self {
             #[stable(feature = "num_wrapping", since = "1.2.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_shr(self, rhs: u32) -> Self {
                 unsafe {
                     intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT)
@@ -1396,18 +1321,6 @@ pub fn wrapping_pow(self, mut exp: u32) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_add(self, rhs: Self) -> (Self, bool) {
-            let (a, b) = unsafe {
-                intrinsics::add_with_overflow(self as $ActualT,
-                                                rhs as $ActualT)
-            };
-            (a as Self, b)
-        }
-
         doc_comment! {
             concat!("Calculates `self` + `rhs`
 
@@ -1428,7 +1341,6 @@ pub fn overflowing_add(self, rhs: Self) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
                 let (a, b) = unsafe {
                     intrinsics::add_with_overflow(self as $ActualT,
@@ -1438,18 +1350,6 @@ pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
-            let (a, b) = unsafe {
-                intrinsics::sub_with_overflow(self as $ActualT,
-                                                rhs as $ActualT)
-            };
-            (a as Self, b)
-        }
-
         doc_comment! {
             concat!("Calculates `self` - `rhs`
 
@@ -1470,7 +1370,6 @@ pub fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
                 let (a, b) = unsafe {
                     intrinsics::sub_with_overflow(self as $ActualT,
@@ -1480,18 +1379,6 @@ pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
-            let (a, b) = unsafe {
-                intrinsics::mul_with_overflow(self as $ActualT,
-                                                rhs as $ActualT)
-            };
-            (a as Self, b)
-        }
-
         doc_comment! {
             concat!("Calculates the multiplication of `self` and `rhs`.
 
@@ -1510,7 +1397,6 @@ pub fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
                 let (a, b) = unsafe {
                     intrinsics::mul_with_overflow(self as $ActualT,
@@ -1681,14 +1567,6 @@ pub fn overflowing_neg(self) -> (Self, bool) {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
-            (self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
-        }
-
         doc_comment! {
             concat!("Shifts self left by `rhs` bits.
 
@@ -1708,20 +1586,11 @@ pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
                 (self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
-            (self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
-        }
-
         doc_comment! {
             concat!("Shifts self right by `rhs` bits.
 
@@ -1741,7 +1610,6 @@ pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
                 (self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
             }
@@ -2006,12 +1874,6 @@ pub fn signum(self) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn is_positive(self) -> bool { self > 0 }
-
         doc_comment! {
             concat!("Returns `true` if `self` is positive and `false` if the number is zero or
 negative.
@@ -2028,16 +1890,9 @@ pub fn is_positive(self) -> bool { self > 0 }
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_sign")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn is_positive(self) -> bool { self > 0 }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn is_negative(self) -> bool { self < 0 }
-
         doc_comment! {
             concat!("Returns `true` if `self` is negative and `false` if the number is zero or
 positive.
@@ -2054,18 +1909,9 @@ pub fn is_negative(self) -> bool { self < 0 }
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_sign")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn is_negative(self) -> bool { self < 0 }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn to_be_bytes(self) -> [u8; mem::size_of::<Self>()] {
-            self.to_be().to_ne_bytes()
-        }
-
         doc_comment! {
             concat!("Return the memory representation of this integer as a byte array in
 big-endian (network) byte order.
@@ -2081,20 +1927,11 @@ pub const fn is_negative(self) -> bool { self < 0 }
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn to_be_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 self.to_be().to_ne_bytes()
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn to_le_bytes(self) -> [u8; mem::size_of::<Self>()] {
-            self.to_le().to_ne_bytes()
-        }
-
 doc_comment! {
             concat!("Return the memory representation of this integer as a byte array in
 little-endian byte order.
@@ -2110,20 +1947,11 @@ pub const fn is_negative(self) -> bool { self < 0 }
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn to_le_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 self.to_le().to_ne_bytes()
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
-            unsafe { mem::transmute(self) }
-        }
-
         doc_comment! {
             concat!("
 Return the memory representation of this integer as a byte array in
@@ -2151,20 +1979,11 @@ pub const fn is_negative(self) -> bool { self < 0 }
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 unsafe { mem::transmute(self) }
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn from_be_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
-            Self::from_be(Self::from_ne_bytes(bytes))
-        }
-
 doc_comment! {
             concat!("Create an integer value from its representation as a byte array in
 big endian.
@@ -2180,20 +1999,11 @@ pub const fn is_negative(self) -> bool { self < 0 }
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn from_be_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 Self::from_be(Self::from_ne_bytes(bytes))
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn from_le_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
-            Self::from_le(Self::from_ne_bytes(bytes))
-        }
-
 doc_comment! {
             concat!("
 Create an integer value from its representation as a byte array in
@@ -2210,20 +2020,11 @@ pub const fn is_negative(self) -> bool { self < 0 }
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn from_le_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 Self::from_le(Self::from_ne_bytes(bytes))
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
-            unsafe { mem::transmute(bytes) }
-        }
-
         doc_comment! {
             concat!("Create an integer value from its memory representation as a byte
 array in native endianness.
@@ -2250,7 +2051,6 @@ pub const fn is_negative(self) -> bool { self < 0 }
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 unsafe { mem::transmute(bytes) }
             }
@@ -2479,16 +2279,6 @@ pub const fn trailing_zeros(self) -> u32 {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn rotate_left(self, n: u32) -> Self {
-            // Protect against undefined behaviour for over-long bit shifts
-            let n = n % $BITS;
-            (self << n) | (self >> (($BITS - n) % $BITS))
-        }
-
         doc_comment! {
             concat!("Shifts the bits to the left by a specified amount, `n`,
 wrapping the truncated bits to the end of the resulting integer.
@@ -2508,22 +2298,11 @@ pub fn rotate_left(self, n: u32) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_rotate")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn rotate_left(self, n: u32) -> Self {
                 (self << (n % $BITS)) | (self >> (($BITS - (n % $BITS)) % $BITS))
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn rotate_right(self, n: u32) -> Self {
-            // Protect against undefined behaviour for over-long bit shifts
-            let n = n % $BITS;
-            (self >> n) | (self << (($BITS - n) % $BITS))
-        }
-
         doc_comment! {
             concat!("Shifts the bits to the right by a specified amount, `n`,
 wrapping the truncated bits to the beginning of the resulting
@@ -2544,7 +2323,6 @@ pub fn rotate_right(self, n: u32) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_rotate")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn rotate_right(self, n: u32) -> Self {
                 (self >> (n % $BITS)) | (self << (($BITS - (n % $BITS)) % $BITS))
             }
@@ -2572,14 +2350,6 @@ pub const fn swap_bytes(self) -> Self {
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "reverse_bits", issue = "48763")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn reverse_bits(self) -> Self {
-            unsafe { intrinsics::bitreverse(self as $ActualT) as Self }
-        }
-
         doc_comment! {
             concat!("Reverses the bit pattern of the integer.
 
@@ -2598,7 +2368,6 @@ pub fn reverse_bits(self) -> Self {
             #[unstable(feature = "reverse_bits", issue = "48763")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn reverse_bits(self) -> Self {
                 unsafe { intrinsics::bitreverse(self as $ActualT) as Self }
             }
@@ -3087,16 +2856,6 @@ pub fn saturating_pow(self, exp: u32) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_add(self, rhs: Self) -> Self {
-            unsafe {
-                intrinsics::overflowing_add(self, rhs)
-            }
-        }
-
         doc_comment! {
             concat!("Wrapping (modular) addition. Computes `self + rhs`,
 wrapping around at the boundary of the type.
@@ -3113,7 +2872,6 @@ pub fn wrapping_add(self, rhs: Self) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_add(self, rhs: Self) -> Self {
                 unsafe {
                     intrinsics::overflowing_add(self, rhs)
@@ -3121,16 +2879,6 @@ pub const fn wrapping_add(self, rhs: Self) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_sub(self, rhs: Self) -> Self {
-            unsafe {
-                intrinsics::overflowing_sub(self, rhs)
-            }
-        }
-
         doc_comment! {
             concat!("Wrapping (modular) subtraction. Computes `self - rhs`,
 wrapping around at the boundary of the type.
@@ -3147,7 +2895,6 @@ pub fn wrapping_sub(self, rhs: Self) -> Self {
             #[stable(feature = "rust1", since = "1.0.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_sub(self, rhs: Self) -> Self {
                 unsafe {
                     intrinsics::overflowing_sub(self, rhs)
@@ -3155,16 +2902,6 @@ pub const fn wrapping_sub(self, rhs: Self) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "rust1", since = "1.0.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_mul(self, rhs: Self) -> Self {
-            unsafe {
-                intrinsics::overflowing_mul(self, rhs)
-            }
-        }
-
         /// Wrapping (modular) multiplication. Computes `self *
         /// rhs`, wrapping around at the boundary of the type.
         ///
@@ -3182,7 +2919,6 @@ pub fn wrapping_mul(self, rhs: Self) -> Self {
         #[stable(feature = "rust1", since = "1.0.0")]
         #[rustc_const_unstable(feature = "const_int_wrapping")]
         #[inline]
-        #[cfg(not(stage0))]
         pub const fn wrapping_mul(self, rhs: Self) -> Self {
             unsafe {
                 intrinsics::overflowing_mul(self, rhs)
@@ -3304,16 +3040,6 @@ pub fn wrapping_neg(self) -> Self {
             self.overflowing_neg().0
         }
 
-        /// no docs here
-        #[stable(feature = "num_wrapping", since = "1.2.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_shl(self, rhs: u32) -> Self {
-            unsafe {
-                intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT)
-            }
-        }
-
         doc_comment! {
             concat!("Panic-free bitwise shift-left; yields `self << mask(rhs)`,
 where `mask` removes any high-order bits of `rhs` that
@@ -3337,7 +3063,6 @@ pub fn wrapping_shl(self, rhs: u32) -> Self {
             #[stable(feature = "num_wrapping", since = "1.2.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_shl(self, rhs: u32) -> Self {
                 unsafe {
                     intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT)
@@ -3345,16 +3070,6 @@ pub const fn wrapping_shl(self, rhs: u32) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "num_wrapping", since = "1.2.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn wrapping_shr(self, rhs: u32) -> Self {
-            unsafe {
-                intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT)
-            }
-        }
-
         doc_comment! {
             concat!("Panic-free bitwise shift-right; yields `self >> mask(rhs)`,
 where `mask` removes any high-order bits of `rhs` that
@@ -3378,7 +3093,6 @@ pub fn wrapping_shr(self, rhs: u32) -> Self {
             #[stable(feature = "num_wrapping", since = "1.2.0")]
             #[rustc_const_unstable(feature = "const_int_wrapping")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn wrapping_shr(self, rhs: u32) -> Self {
                 unsafe {
                     intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT)
@@ -3424,18 +3138,6 @@ pub fn wrapping_pow(self, mut exp: u32) -> Self {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_add(self, rhs: Self) -> (Self, bool) {
-            let (a, b) = unsafe {
-                intrinsics::add_with_overflow(self as $ActualT,
-                                                rhs as $ActualT)
-            };
-            (a as Self, b)
-        }
-
         doc_comment! {
             concat!("Calculates `self` + `rhs`
 
@@ -3456,7 +3158,6 @@ pub fn overflowing_add(self, rhs: Self) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
                 let (a, b) = unsafe {
                     intrinsics::add_with_overflow(self as $ActualT,
@@ -3466,18 +3167,6 @@ pub const fn overflowing_add(self, rhs: Self) -> (Self, bool) {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
-            let (a, b) = unsafe {
-                intrinsics::sub_with_overflow(self as $ActualT,
-                                                rhs as $ActualT)
-            };
-            (a as Self, b)
-        }
-
         doc_comment! {
             concat!("Calculates `self` - `rhs`
 
@@ -3499,7 +3188,6 @@ pub fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
                 let (a, b) = unsafe {
                     intrinsics::sub_with_overflow(self as $ActualT,
@@ -3509,18 +3197,6 @@ pub const fn overflowing_sub(self, rhs: Self) -> (Self, bool) {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
-            let (a, b) = unsafe {
-                intrinsics::mul_with_overflow(self as $ActualT,
-                                              rhs as $ActualT)
-            };
-            (a as Self, b)
-        }
-
         /// Calculates the multiplication of `self` and `rhs`.
         ///
         /// Returns a tuple of the multiplication along with a boolean
@@ -3541,7 +3217,6 @@ pub fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
         #[stable(feature = "wrapping", since = "1.7.0")]
         #[rustc_const_unstable(feature = "const_int_overflowing")]
         #[inline]
-        #[cfg(not(stage0))]
         pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) {
             let (a, b) = unsafe {
                 intrinsics::mul_with_overflow(self as $ActualT,
@@ -3680,14 +3355,6 @@ pub fn overflowing_neg(self) -> (Self, bool) {
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
-            (self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
-        }
-
         doc_comment! {
             concat!("Shifts self left by `rhs` bits.
 
@@ -3708,20 +3375,11 @@ pub fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
                 (self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
             }
         }
 
-        /// no docs here
-        #[stable(feature = "wrapping", since = "1.7.0")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
-            (self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
-        }
-
         doc_comment! {
             concat!("Shifts self right by `rhs` bits.
 
@@ -3742,7 +3400,6 @@ pub fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
             #[stable(feature = "wrapping", since = "1.7.0")]
             #[rustc_const_unstable(feature = "const_int_overflowing")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
                 (self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
             }
@@ -3985,15 +3642,7 @@ pub fn wrapping_next_power_of_two(self) -> Self {
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn to_be_bytes(self) -> [u8; mem::size_of::<Self>()] {
-            self.to_be().to_ne_bytes()
-        }
-
-                doc_comment! {
+        doc_comment! {
             concat!("Return the memory representation of this integer as a byte array in
 big-endian (network) byte order.
 
@@ -4008,20 +3657,11 @@ pub fn wrapping_next_power_of_two(self) -> Self {
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn to_be_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 self.to_be().to_ne_bytes()
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn to_le_bytes(self) -> [u8; mem::size_of::<Self>()] {
-            self.to_le().to_ne_bytes()
-        }
-
         doc_comment! {
             concat!("Return the memory representation of this integer as a byte array in
 little-endian byte order.
@@ -4037,20 +3677,11 @@ pub fn wrapping_next_power_of_two(self) -> Self {
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn to_le_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 self.to_le().to_ne_bytes()
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
-            unsafe { mem::transmute(self) }
-        }
-
         doc_comment! {
             concat!("
 Return the memory representation of this integer as a byte array in
@@ -4078,20 +3709,11 @@ pub fn wrapping_next_power_of_two(self) -> Self {
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn to_ne_bytes(self) -> [u8; mem::size_of::<Self>()] {
                 unsafe { mem::transmute(self) }
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn from_be_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
-            Self::from_be(Self::from_ne_bytes(bytes))
-        }
-
         doc_comment! {
             concat!("Create an integer value from its representation as a byte array in
 big endian.
@@ -4107,20 +3729,11 @@ pub fn wrapping_next_power_of_two(self) -> Self {
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn from_be_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 Self::from_be(Self::from_ne_bytes(bytes))
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn from_le_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
-            Self::from_le(Self::from_ne_bytes(bytes))
-        }
-
         doc_comment! {
             concat!("
 Create an integer value from its representation as a byte array in
@@ -4137,20 +3750,11 @@ pub fn wrapping_next_power_of_two(self) -> Self {
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn from_le_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 Self::from_le(Self::from_ne_bytes(bytes))
             }
         }
 
-        /// no docs here
-        #[unstable(feature = "int_to_from_bytes", issue = "52963")]
-        #[inline]
-        #[cfg(stage0)]
-        pub fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
-            unsafe { mem::transmute(bytes) }
-        }
-
         doc_comment! {
             concat!("Create an integer value from its memory representation as a byte
 array in native endianness.
@@ -4177,7 +3781,6 @@ pub fn wrapping_next_power_of_two(self) -> Self {
             #[unstable(feature = "int_to_from_bytes", issue = "52963")]
             #[rustc_const_unstable(feature = "const_int_conversion")]
             #[inline]
-            #[cfg(not(stage0))]
             pub const fn from_ne_bytes(bytes: [u8; mem::size_of::<Self>()]) -> Self {
                 unsafe { mem::transmute(bytes) }
             }
index 8d39298bac3d1b1b3cd13210987fac5e94a1bf71..bbb1ef76bccec027a3b018c55c82bae2db826273 100644 (file)
@@ -121,3 +121,10 @@ fn test_match_nonzero_const_pattern() {
         _ => panic!("Expected the const item as a pattern to match.")
     }
 }
+
+#[test]
+fn test_from_nonzero() {
+    let nz = NonZeroU32::new(1).unwrap();
+    let num: u32 = nz.into();
+    assert_eq!(num, 1u32);
+}
index 1bac6d22d37441effd48a7ef1e4b0755c8c67979..2a38464d7c1ee3ca742888d52669641cd5b567b3 100644 (file)
@@ -20,7 +20,7 @@
        html_playground_url = "https://play.rust-lang.org/",
        test(attr(deny(warnings))))]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 
 pub use self::Piece::*;
 pub use self::Position::*;
index 9fa48adebdf07a523411152409a2e1465c07fc37..7acadc32048bd8a49627ae0d0a107a42bc9eaa36 100644 (file)
        html_root_url = "https://doc.rust-lang.org/nightly/",
        test(attr(allow(unused_variables), deny(warnings))))]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(str_escape)]
 
 use self::LabelText::*;
index 14221f3d79e84050f91f50b58736b1281b022c8f..cf05e56e53c8464e4e9a1c5dc11b824d7e234d06 100644 (file)
 
 #![feature(core_intrinsics)]
 #![feature(libc)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(panic_runtime)]
 #![feature(staged_api)]
 #![feature(rustc_attrs)]
 
 // Rust's "try" function, but if we're aborting on panics we just call the
 // function as there's nothing else we need to do here.
-#[cfg_attr(stage0, no_mangle)]
 #[rustc_std_internal_symbol]
 pub unsafe extern fn __rust_maybe_catch_panic(f: fn(*mut u8),
                                               data: *mut u8,
@@ -51,7 +50,6 @@
 // which would break compat with XP. For now just use `intrinsics::abort` which
 // will kill us with an illegal instruction, which will do a good enough job for
 // now hopefully.
-#[cfg_attr(stage0, no_mangle)]
 #[rustc_std_internal_symbol]
 pub unsafe extern fn __rust_start_panic(_payload: usize) -> u32 {
     abort();
index 9c3fc76c307a6f7696ba4ce2f163c1dea7812602..cfe671c626bcf040b14c4b5dd328ddd535783232 100644 (file)
@@ -34,7 +34,7 @@
 #![feature(core_intrinsics)]
 #![feature(lang_items)]
 #![feature(libc)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(panic_unwind)]
 #![feature(raw)]
 #![feature(staged_api)]
index d885f9b406f59117642ac3915b2f969a420766a0..34a44bd14214865e6017da816916028310da55b3 100644 (file)
@@ -27,7 +27,7 @@
        test(no_crate_inject, attr(deny(warnings))),
        test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(rustc_private)]
 #![feature(staged_api)]
 #![feature(lang_items)]
index a85593253b100f8f184ab7a336335ef7961ea5e8..8678330a5a09e2b4537d2493c904fe34fdc2480f 100644 (file)
@@ -15,5 +15,5 @@
             reason = "internal implementation detail of rustc right now",
             issue = "0")]
 #![allow(unused_features)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(staged_api)]
index d15568af6aebec8f6ea641da55543a2d38a7904e..0d0dc0832a459b78aab728ea30bbb11cca5bd6fc 100644 (file)
@@ -331,7 +331,7 @@ pub fn new_no_params(kind: DepKind) -> DepNode {
             /// refers to something from the previous compilation session that
             /// has been removed.
             #[inline]
-            pub fn extract_def_id(&self, tcx: TyCtxt) -> Option<DefId> {
+            pub fn extract_def_id(&self, tcx: TyCtxt<'_, '_, '_>) -> Option<DefId> {
                 if self.kind.can_reconstruct_query_key() {
                     let def_path_hash = DefPathHash(self.hash);
                     tcx.def_path_hash_to_def_id.as_ref()?
@@ -386,7 +386,7 @@ pub mod label_strs {
 }
 
 impl fmt::Debug for DepNode {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{:?}", self.kind)?;
 
         if !self.kind.has_params() && !self.kind.is_anon() {
@@ -424,7 +424,7 @@ pub fn to_dep_node(self, kind: DepKind) -> DepNode {
 
 impl DefId {
     #[inline]
-    pub fn to_dep_node(self, tcx: TyCtxt, kind: DepKind) -> DepNode {
+    pub fn to_dep_node(self, tcx: TyCtxt<'_, '_, '_>, kind: DepKind) -> DepNode {
         DepNode::from_def_path_hash(kind, tcx.def_path_hash(self))
     }
 }
@@ -714,7 +714,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a, T> DepNodeParams<'a, 'gcx, 'tcx> for T
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefId {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
 
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         tcx.def_path_hash(*self).0
     }
 
@@ -726,7 +726,7 @@ fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefIndex {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
 
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         tcx.hir.definitions().def_path_hash(*self).0
     }
 
@@ -738,7 +738,7 @@ fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for CrateNum {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
 
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         let def_id = DefId {
             krate: *self,
             index: CRATE_DEF_INDEX,
@@ -757,7 +757,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
     // We actually would not need to specialize the implementation of this
     // method but it's faster to combine the hashes than to instantiate a full
     // hashing context and stable-hashing state.
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         let (def_id_0, def_id_1) = *self;
 
         let def_path_hash_0 = tcx.def_path_hash(def_id_0);
@@ -781,7 +781,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for HirId {
     // We actually would not need to specialize the implementation of this
     // method but it's faster to combine the hashes than to instantiate a full
     // hashing context and stable-hashing state.
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         let HirId {
             owner,
             local_id: ItemLocalId(local_id),
index 638591eb1fb6977bd506fd46babad9642a687994..a09fd5df557f5df7ef941aaa86c0ec80a823be9a 100644 (file)
@@ -36,7 +36,7 @@ pub enum CrateNum {
 }
 
 impl ::std::fmt::Debug for CrateNum {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         match self {
             CrateNum::Index(id) => write!(fmt, "crate{}", id.private),
             CrateNum::Invalid => write!(fmt, "invalid crate"),
@@ -97,7 +97,7 @@ pub fn as_def_id(&self) -> DefId { DefId { krate: *self, index: CRATE_DEF_INDEX
 }
 
 impl fmt::Display for CrateNum {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
             CrateNum::Index(id) => fmt::Display::fmt(&id.private, f),
             CrateNum::Invalid => write!(f, "invalid crate"),
@@ -132,7 +132,7 @@ impl serialize::UseSpecializedDecodable for CrateNum {}
 pub const CRATE_DEF_INDEX: DefIndex = DefIndex(0);
 
 impl fmt::Debug for DefIndex {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f,
                "DefIndex({}:{})",
                self.address_space().index(),
@@ -224,7 +224,7 @@ pub struct DefId {
 }
 
 impl fmt::Debug for DefId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "DefId({:?}/{}:{}",
                self.krate.index(),
                self.index.address_space().index(),
@@ -288,7 +288,7 @@ pub fn to_def_id(self) -> DefId {
 }
 
 impl fmt::Debug for LocalDefId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         self.to_def_id().fmt(f)
     }
 }
index aa1bd6dd59ccf0e28d1ec9d7755b5ed576cb9195..62b06f54301f384acd344bf8bd836e8e9d173c58 100644 (file)
@@ -686,7 +686,7 @@ fn collect_in_band_defs<T, F>(
         f: F,
     ) -> (Vec<hir::GenericParam>, T)
     where
-        F: FnOnce(&mut LoweringContext) -> (Vec<hir::GenericParam>, T),
+        F: FnOnce(&mut LoweringContext<'_>) -> (Vec<hir::GenericParam>, T),
     {
         assert!(!self.is_collecting_in_band_lifetimes);
         assert!(self.lifetimes_to_define.is_empty());
@@ -788,7 +788,7 @@ fn collect_fresh_in_band_lifetime(&mut self, span: Span) -> ParamName {
     // for them.
     fn with_in_scope_lifetime_defs<T, F>(&mut self, params: &[GenericParam], f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let old_len = self.in_scope_lifetimes.len();
         let lt_def_names = params.iter().filter_map(|param| match param.kind {
@@ -812,7 +812,7 @@ fn with_parent_impl_lifetime_defs<T, F>(&mut self,
         params: &HirVec<hir::GenericParam>,
         f: F
     ) -> T where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let old_len = self.in_scope_lifetimes.len();
         let lt_def_names = params.iter().filter_map(|param| match param.kind {
@@ -841,7 +841,7 @@ fn add_in_band_defs<F, T>(
         f: F,
     ) -> (hir::Generics, T)
     where
-        F: FnOnce(&mut LoweringContext, &mut Vec<hir::GenericParam>) -> T,
+        F: FnOnce(&mut LoweringContext<'_>, &mut Vec<hir::GenericParam>) -> T,
     {
         let (in_band_defs, (mut lowered_generics, res)) = self.with_in_scope_lifetime_defs(
             &generics.params,
@@ -870,7 +870,7 @@ fn add_in_band_defs<F, T>(
 
     fn with_catch_scope<T, F>(&mut self, catch_id: NodeId, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let len = self.catch_scopes.len();
         self.catch_scopes.push(catch_id);
@@ -892,7 +892,7 @@ fn make_async_expr(
         capture_clause: CaptureBy,
         closure_node_id: NodeId,
         ret_ty: Option<&Ty>,
-        body: impl FnOnce(&mut LoweringContext) -> hir::Expr,
+        body: impl FnOnce(&mut LoweringContext<'_>) -> hir::Expr,
     ) -> hir::ExprKind {
         let prev_is_generator = mem::replace(&mut self.is_generator, true);
         let body_expr = body(self);
@@ -929,7 +929,7 @@ fn make_async_expr(
 
     fn lower_body<F>(&mut self, decl: Option<&FnDecl>, f: F) -> hir::BodyId
     where
-        F: FnOnce(&mut LoweringContext) -> hir::Expr,
+        F: FnOnce(&mut LoweringContext<'_>) -> hir::Expr,
     {
         let prev = mem::replace(&mut self.is_generator, false);
         let result = f(self);
@@ -940,7 +940,7 @@ fn lower_body<F>(&mut self, decl: Option<&FnDecl>, f: F) -> hir::BodyId
 
     fn with_loop_scope<T, F>(&mut self, loop_id: NodeId, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         // We're no longer in the base loop's condition; we're in another loop.
         let was_in_loop_condition = self.is_in_loop_condition;
@@ -965,7 +965,7 @@ fn with_loop_scope<T, F>(&mut self, loop_id: NodeId, f: F) -> T
 
     fn with_loop_condition_scope<T, F>(&mut self, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let was_in_loop_condition = self.is_in_loop_condition;
         self.is_in_loop_condition = true;
@@ -979,7 +979,7 @@ fn with_loop_condition_scope<T, F>(&mut self, f: F) -> T
 
     fn with_new_scopes<T, F>(&mut self, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let was_in_loop_condition = self.is_in_loop_condition;
         self.is_in_loop_condition = false;
@@ -1094,7 +1094,8 @@ fn lower_arm(&mut self, arm: &Arm) -> hir::Arm {
         }
     }
 
-    fn lower_ty_binding(&mut self, b: &TypeBinding, itctx: ImplTraitContext) -> hir::TypeBinding {
+    fn lower_ty_binding(&mut self, b: &TypeBinding,
+                        itctx: ImplTraitContext<'_>) -> hir::TypeBinding {
         hir::TypeBinding {
             id: self.lower_node_id(b.id).node_id,
             ident: b.ident,
@@ -1105,7 +1106,7 @@ fn lower_ty_binding(&mut self, b: &TypeBinding, itctx: ImplTraitContext) -> hir:
 
     fn lower_generic_arg(&mut self,
                         arg: &ast::GenericArg,
-                        itctx: ImplTraitContext)
+                        itctx: ImplTraitContext<'_>)
                         -> hir::GenericArg {
         match arg {
             ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(&lt)),
@@ -1113,11 +1114,11 @@ fn lower_generic_arg(&mut self,
         }
     }
 
-    fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext) -> P<hir::Ty> {
+    fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext<'_>) -> P<hir::Ty> {
         P(self.lower_ty_direct(t, itctx))
     }
 
-    fn lower_ty_direct(&mut self, t: &Ty, mut itctx: ImplTraitContext) -> hir::Ty {
+    fn lower_ty_direct(&mut self, t: &Ty, mut itctx: ImplTraitContext<'_>) -> hir::Ty {
         let kind = match t.node {
             TyKind::Infer => hir::TyKind::Infer,
             TyKind::Err => hir::TyKind::Err,
@@ -1289,7 +1290,7 @@ fn lower_existential_impl_trait(
         span: Span,
         fn_def_id: Option<DefId>,
         exist_ty_node_id: NodeId,
-        lower_bounds: impl FnOnce(&mut LoweringContext) -> hir::GenericBounds,
+        lower_bounds: impl FnOnce(&mut LoweringContext<'_>) -> hir::GenericBounds,
     ) -> hir::TyKind {
         // Make sure we know that some funky desugaring has been going on here.
         // This is a first: there is code in other places like for loop
@@ -1567,7 +1568,7 @@ fn lower_qpath(
         qself: &Option<QSelf>,
         p: &Path,
         param_mode: ParamMode,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> hir::QPath {
         let qself_position = qself.as_ref().map(|q| q.position);
         let qself = qself.as_ref().map(|q| self.lower_ty(&q.ty, itctx.reborrow()));
@@ -1762,7 +1763,7 @@ fn lower_path_segment(
         param_mode: ParamMode,
         expected_lifetimes: usize,
         parenthesized_generic_args: ParenthesizedGenericArgs,
-        itctx: ImplTraitContext,
+        itctx: ImplTraitContext<'_>,
     ) -> hir::PathSegment {
         let (mut generic_args, infer_types) = if let Some(ref generic_args) = segment.args {
             let msg = "parenthesized parameters may only be used with a trait";
@@ -1844,7 +1845,7 @@ fn lower_angle_bracketed_parameter_data(
         &mut self,
         data: &AngleBracketedArgs,
         param_mode: ParamMode,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> (hir::GenericArgs, bool) {
         let &AngleBracketedArgs { ref args, ref bindings, .. } = data;
         let has_types = args.iter().any(|arg| match arg {
@@ -1871,7 +1872,7 @@ fn lower_parenthesized_parameter_data(
         self.with_anonymous_lifetime_mode(
             AnonymousLifetimeMode::PassThrough,
             |this| {
-                const DISALLOWED: ImplTraitContext = ImplTraitContext::Disallowed;
+                const DISALLOWED: ImplTraitContext<'_> = ImplTraitContext::Disallowed;
                 let &ParenthesisedArgs { ref inputs, ref output, span } = data;
                 let inputs = inputs.iter().map(|ty| this.lower_ty_direct(ty, DISALLOWED)).collect();
                 let mk_tup = |this: &mut Self, tys, span| {
@@ -2250,7 +2251,7 @@ fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
     fn lower_param_bound(
         &mut self,
         tpb: &GenericBound,
-        itctx: ImplTraitContext,
+        itctx: ImplTraitContext<'_>,
     ) -> hir::GenericBound {
         match *tpb {
             GenericBound::Trait(ref ty, modifier) => hir::GenericBound::Trait(
@@ -2304,7 +2305,7 @@ fn lower_generic_params(
         &mut self,
         params: &[GenericParam],
         add_bounds: &NodeMap<Vec<GenericBound>>,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> hir::HirVec<hir::GenericParam> {
         params.iter().map(|param| {
             self.lower_generic_param(param, add_bounds, itctx.reborrow())
@@ -2314,7 +2315,7 @@ fn lower_generic_params(
     fn lower_generic_param(&mut self,
                            param: &GenericParam,
                            add_bounds: &NodeMap<Vec<GenericBound>>,
-                           mut itctx: ImplTraitContext)
+                           mut itctx: ImplTraitContext<'_>)
                            -> hir::GenericParam {
         let mut bounds = self.lower_param_bounds(&param.bounds, itctx.reborrow());
         match param.kind {
@@ -2383,7 +2384,7 @@ fn lower_generic_param(&mut self,
     fn lower_generics(
         &mut self,
         generics: &Generics,
-        itctx: ImplTraitContext)
+        itctx: ImplTraitContext<'_>)
         -> hir::Generics
     {
         // Collect `?Trait` bounds in where clause and move them to parameter definitions.
@@ -2536,7 +2537,7 @@ fn lower_variant_data(&mut self, vdata: &VariantData) -> hir::VariantData {
         }
     }
 
-    fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext) -> hir::TraitRef {
+    fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext<'_>) -> hir::TraitRef {
         let path = match self.lower_qpath(p.ref_id, &None, &p.path, ParamMode::Explicit, itctx) {
             hir::QPath::Resolved(None, path) => path.and_then(|path| path),
             qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
@@ -2552,7 +2553,7 @@ fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext) -> hir::Tra
     fn lower_poly_trait_ref(
         &mut self,
         p: &PolyTraitRef,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> hir::PolyTraitRef {
         let bound_generic_params =
             self.lower_generic_params(&p.bound_generic_params, &NodeMap(), itctx.reborrow());
@@ -2593,14 +2594,14 @@ fn lower_field(&mut self, f: &Field) -> hir::Field {
         }
     }
 
-    fn lower_mt(&mut self, mt: &MutTy, itctx: ImplTraitContext) -> hir::MutTy {
+    fn lower_mt(&mut self, mt: &MutTy, itctx: ImplTraitContext<'_>) -> hir::MutTy {
         hir::MutTy {
             ty: self.lower_ty(&mt.ty, itctx),
             mutbl: self.lower_mutability(mt.mutbl),
         }
     }
 
-    fn lower_param_bounds(&mut self, bounds: &[GenericBound], mut itctx: ImplTraitContext)
+    fn lower_param_bounds(&mut self, bounds: &[GenericBound], mut itctx: ImplTraitContext<'_>)
         -> hir::GenericBounds {
         bounds.iter().map(|bound| self.lower_param_bound(bound, itctx.reborrow())).collect()
     }
index c7824d411aac6366bf745568a31d88ec5832866f..69706aabcb0505b26ac9260652ed3e5006dee4dd 100644 (file)
@@ -143,7 +143,7 @@ fn new(d: &'a FnDecl, b: ast::BodyId, id: NodeId, s: Span, attrs: &'a [Attribute
 
 impl<'a> FnLikeNode<'a> {
     /// Attempts to construct a FnLikeNode from presumed FnLike node input.
-    pub fn from_node(node: Node) -> Option<FnLikeNode> {
+    pub fn from_node(node: Node<'_>) -> Option<FnLikeNode<'_>> {
         let fn_like = match node {
             map::Node::Item(item) => item.is_fn_like(),
             map::Node::TraitItem(tm) => tm.is_fn_like(),
@@ -173,15 +173,15 @@ pub fn decl(self) -> &'a FnDecl {
     }
 
     pub fn span(self) -> Span {
-        self.handle(|i: ItemFnParts| i.span,
+        self.handle(|i: ItemFnParts<'_>| i.span,
                     |_, _, _: &'a ast::MethodSig, _, _, span, _| span,
-                    |c: ClosureParts| c.span)
+                    |c: ClosureParts<'_>| c.span)
     }
 
     pub fn id(self) -> NodeId {
-        self.handle(|i: ItemFnParts| i.id,
+        self.handle(|i: ItemFnParts<'_>| i.id,
                     |id, _, _: &'a ast::MethodSig, _, _, _, _| id,
-                    |c: ClosureParts| c.id)
+                    |c: ClosureParts<'_>| c.id)
     }
 
     pub fn constness(self) -> ast::Constness {
index 6e35755d9a4ec228d93024ef5f4c56fe123309d5..f5f9bcd3b5ea5125d32e70cd09a2028e57dd2266 100644 (file)
@@ -668,7 +668,7 @@ fn walk_parent_nodes<F, F2>(&self,
     /// }
     /// ```
     pub fn get_return_block(&self, id: NodeId) -> Option<NodeId> {
-        let match_fn = |node: &Node| {
+        let match_fn = |node: &Node<'_>| {
             match *node {
                 Node::Item(_) |
                 Node::ForeignItem(_) |
@@ -677,7 +677,7 @@ pub fn get_return_block(&self, id: NodeId) -> Option<NodeId> {
                 _ => false,
             }
         };
-        let match_non_returning_block = |node: &Node| {
+        let match_non_returning_block = |node: &Node<'_>| {
             match *node {
                 Node::Expr(ref expr) => {
                     match expr.node {
@@ -954,7 +954,7 @@ fn suffix_matches(&self, parent: NodeId) -> bool {
         // If `id` itself is a mod named `m` with parent `p`, then
         // returns `Some(id, m, p)`.  If `id` has no mod in its parent
         // chain, then returns `None`.
-        fn find_first_mod_parent<'a>(map: &'a Map, mut id: NodeId) -> Option<(NodeId, Name)> {
+        fn find_first_mod_parent<'a>(map: &'a Map<'_>, mut id: NodeId) -> Option<(NodeId, Name)> {
             loop {
                 if let Node::Item(item) = map.find(id)? {
                     if item_is_mod(&item) {
@@ -1076,7 +1076,7 @@ pub fn map_crate<'hir>(sess: &::session::Session,
 /// Identical to the `PpAnn` implementation for `hir::Crate`,
 /// except it avoids creating a dependency on the whole crate.
 impl<'hir> print::PpAnn for Map<'hir> {
-    fn nested(&self, state: &mut print::State, nested: print::Nested) -> io::Result<()> {
+    fn nested(&self, state: &mut print::State<'_>, nested: print::Nested) -> io::Result<()> {
         match nested {
             Nested::Item(id) => state.print_item(self.expect_item(id.id)),
             Nested::TraitItem(id) => state.print_trait_item(self.trait_item(id)),
@@ -1088,7 +1088,7 @@ fn nested(&self, state: &mut print::State, nested: print::Nested) -> io::Result<
 }
 
 impl<'a> print::State<'a> {
-    pub fn print_node(&mut self, node: Node) -> io::Result<()> {
+    pub fn print_node(&mut self, node: Node<'_>) -> io::Result<()> {
         match node {
             Node::Item(a)         => self.print_item(&a),
             Node::ForeignItem(a)  => self.print_foreign_item(&a),
@@ -1126,7 +1126,7 @@ pub fn print_node(&mut self, node: Node) -> io::Result<()> {
     }
 }
 
-fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
+fn node_id_to_string(map: &Map<'_>, id: NodeId, include_id: bool) -> String {
     let id_str = format!(" (id={})", id);
     let id_str = if include_id { &id_str[..] } else { "" };
 
@@ -1253,7 +1253,7 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
     }
 }
 
-pub fn describe_def(tcx: TyCtxt, def_id: DefId) -> Option<Def> {
+pub fn describe_def(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Option<Def> {
     if let Some(node_id) = tcx.hir.as_local_node_id(def_id) {
         tcx.hir.describe_def(node_id)
     } else {
index de9808ffe7001b66abfb0faaa23886d8a6a76902..088bee38116809228d1ec2edd2fdc9fbf97020fe 100644 (file)
@@ -170,7 +170,7 @@ pub struct Label {
 }
 
 impl fmt::Debug for Label {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "label({:?})", self.ident)
     }
 }
@@ -277,13 +277,13 @@ pub fn modern(&self) -> LifetimeName {
 }
 
 impl fmt::Display for Lifetime {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         self.name.ident().fmt(f)
     }
 }
 
 impl fmt::Debug for Lifetime {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f,
                "lifetime({}: {})",
                self.id,
@@ -320,13 +320,13 @@ pub fn is_global(&self) -> bool {
 }
 
 impl fmt::Debug for Path {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "path({})", print::to_string(print::NO_ANN, |s| s.print_path(self, false)))
     }
 }
 
 impl fmt::Display for Path {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{}", print::to_string(print::NO_ANN, |s| s.print_path(self, false)))
     }
 }
@@ -804,7 +804,7 @@ pub struct Pat {
 }
 
 impl fmt::Debug for Pat {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "pat({}: {})", self.id,
                print::to_string(print::NO_ANN, |s| s.print_pat(self)))
     }
@@ -1120,7 +1120,7 @@ pub fn is_by_value(self) -> bool {
 pub type Stmt = Spanned<StmtKind>;
 
 impl fmt::Debug for StmtKind {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         // Sadness.
         let spanned = source_map::dummy_spanned(self.clone());
         write!(f,
@@ -1348,7 +1348,7 @@ pub fn precedence(&self) -> ExprPrecedence {
 }
 
 impl fmt::Debug for Expr {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "expr({}: {})", self.id,
                print::to_string(print::NO_ANN, |s| s.print_expr(self)))
     }
@@ -1521,7 +1521,7 @@ pub enum LoopIdError {
 }
 
 impl fmt::Display for LoopIdError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(match *self {
             LoopIdError::OutsideLoopScope => "not inside loop scope",
             LoopIdError::UnlabeledCfInWhileCondition =>
@@ -1668,7 +1668,7 @@ pub struct Ty {
 }
 
 impl fmt::Debug for Ty {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "type({})",
                print::to_string(print::NO_ANN, |s| s.print_type(self)))
     }
@@ -1826,7 +1826,7 @@ pub fn is_default(&self) -> bool {
 }
 
 impl fmt::Display for Unsafety {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(match *self {
                               Unsafety::Normal => "normal",
                               Unsafety::Unsafe => "unsafe",
@@ -1844,7 +1844,7 @@ pub enum ImplPolarity {
 }
 
 impl fmt::Debug for ImplPolarity {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             ImplPolarity::Positive => "positive".fmt(f),
             ImplPolarity::Negative => "negative".fmt(f),
@@ -2284,7 +2284,8 @@ pub struct TraitCandidate {
 // imported.
 pub type GlobMap = NodeMap<FxHashSet<Name>>;
 
-pub fn provide(providers: &mut Providers) {
+
+pub fn provide(providers: &mut Providers<'_>) {
     providers.describe_def = map::describe_def;
 }
 
index 7638a2cc140c732f6e05ef7794ce075abc684f84..69699d2e4acd35f9f5dd3e8fb2678f096730902d 100644 (file)
@@ -48,13 +48,13 @@ pub enum Nested {
 }
 
 pub trait PpAnn {
-    fn nested(&self, _state: &mut State, _nested: Nested) -> io::Result<()> {
+    fn nested(&self, _state: &mut State<'_>, _nested: Nested) -> io::Result<()> {
         Ok(())
     }
-    fn pre(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> {
+    fn pre(&self, _state: &mut State<'_>, _node: AnnNode<'_>) -> io::Result<()> {
         Ok(())
     }
-    fn post(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> {
+    fn post(&self, _state: &mut State<'_>, _node: AnnNode<'_>) -> io::Result<()> {
         Ok(())
     }
     fn try_fetch_item(&self, _: ast::NodeId) -> Option<&hir::Item> {
@@ -70,7 +70,7 @@ impl PpAnn for hir::Crate {
     fn try_fetch_item(&self, item: ast::NodeId) -> Option<&hir::Item> {
         Some(self.item(item))
     }
-    fn nested(&self, state: &mut State, nested: Nested) -> io::Result<()> {
+    fn nested(&self, state: &mut State<'_>, nested: Nested) -> io::Result<()> {
         match nested {
             Nested::Item(id) => state.print_item(self.item(id.id)),
             Nested::TraitItem(id) => state.print_trait_item(self.trait_item(id)),
@@ -190,7 +190,7 @@ pub fn new(cm: &'a SourceMap,
 }
 
 pub fn to_string<F>(ann: &dyn PpAnn, f: F) -> String
-    where F: FnOnce(&mut State) -> io::Result<()>
+    where F: FnOnce(&mut State<'_>) -> io::Result<()>
 {
     let mut wr = Vec::new();
     {
@@ -314,7 +314,7 @@ pub fn commasep_cmnt<T, F, G>(&mut self,
                                   mut op: F,
                                   mut get_span: G)
                                   -> io::Result<()>
-        where F: FnMut(&mut State, &T) -> io::Result<()>,
+        where F: FnMut(&mut State<'_>, &T) -> io::Result<()>,
               G: FnMut(&T) -> syntax_pos::Span
     {
         self.rbox(0, b)?;
index e3bbdab4fd9659db1a3b0f64fc82f2e397045684..09059090e2e35421c5dd9f3104dd89388b3b57a9 100644 (file)
@@ -82,7 +82,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
     pub fn note_and_explain_region(
         self,
         region_scope_tree: &region::ScopeTree,
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         prefix: &str,
         region: ty::Region<'tcx>,
         suffix: &str,
@@ -162,7 +162,7 @@ pub fn note_and_explain_region(
 
     pub fn note_and_explain_free_region(
         self,
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         prefix: &str,
         region: ty::Region<'tcx>,
         suffix: &str,
@@ -242,7 +242,7 @@ fn msg_span_from_early_bound_and_free_regions(
     }
 
     fn emit_msg_span(
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         prefix: &str,
         description: String,
         span: Option<Span>,
@@ -424,11 +424,11 @@ fn process_errors(
     /// Adds a note if the types come from similarly named crates
     fn check_and_note_conflicting_crates(
         &self,
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         terr: &TypeError<'tcx>,
         sp: Span,
     ) {
-        let report_path_match = |err: &mut DiagnosticBuilder, did1: DefId, did2: DefId| {
+        let report_path_match = |err: &mut DiagnosticBuilder<'_>, did1: DefId, did2: DefId| {
             // Only external crates, if either is from a local
             // module we could have false positives
             if !(did1.is_local() || did2.is_local()) && did1.krate != did2.krate {
@@ -750,7 +750,7 @@ fn push_ty_ref<'tcx>(
                         values.1.push_normal("<");
                     }
 
-                    fn lifetime_display(lifetime: Region) -> String {
+                    fn lifetime_display(lifetime: Region<'_>) -> String {
                         let s = lifetime.to_string();
                         if s.is_empty() {
                             "'_".to_string()
index afc50fe1151665e3a37fb37549644f74013d5344..a6efb5e678332fc24d11e9115f850944ee70ca6a 100644 (file)
@@ -50,7 +50,7 @@ pub(super) fn find_arg_with_region(
         &self,
         anon_region: Region<'tcx>,
         replace_region: Region<'tcx>,
-    ) -> Option<AnonymousArgInfo> {
+    ) -> Option<AnonymousArgInfo<'_>> {
         let (id, bound_region) = match *anon_region {
             ty::ReFree(ref free_region) => (free_region.scope, free_region.bound_region),
             ty::ReEarlyBound(ref ebr) => (
index 02ec9fe74c1fe693bf5c24e60da393c93c170266..54d01a035a8bee3a4750edef2435dae97b412f6f 100644 (file)
@@ -16,7 +16,7 @@
 
 impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
     pub(super) fn note_region_origin(&self,
-                                     err: &mut DiagnosticBuilder,
+                                     err: &mut DiagnosticBuilder<'_>,
                                      origin: &SubregionOrigin<'tcx>) {
         match *origin {
             infer::Subtype(ref trace) => {
index bb1c9448132c117b72656f91fe0e871c36d1e555..fae48325371562fabd0adf7eb6b6e9c59445ccbd 100644 (file)
@@ -450,7 +450,7 @@ fn var_ids<'a, 'gcx, 'tcx>(fields: &CombineFields<'a, 'gcx, 'tcx>,
        .collect()
 }
 
-fn is_var_in_set(new_vars: &[ty::RegionVid], r: ty::Region) -> bool {
+fn is_var_in_set(new_vars: &[ty::RegionVid], r: ty::Region<'_>) -> bool {
     match *r {
         ty::ReVar(ref v) => new_vars.iter().any(|x| x == v),
         _ => false
index bdd3f78aff3ebf37698c4ad6df90324a410d8d65..3f17c9bb020ef11c8e288acd1a724452ddace469 100644 (file)
@@ -178,10 +178,10 @@ fn new(name: String,
 impl<'a, 'gcx, 'tcx> dot::Labeller<'a> for ConstraintGraph<'a, 'gcx, 'tcx> {
     type Node = Node;
     type Edge = Edge<'tcx>;
-    fn graph_id(&self) -> dot::Id {
+    fn graph_id(&self) -> dot::Id<'_> {
         dot::Id::new(&*self.graph_name).unwrap()
     }
-    fn node_id(&self, n: &Node) -> dot::Id {
+    fn node_id(&self, n: &Node) -> dot::Id<'_> {
         let node_id = match self.node_ids.get(n) {
             Some(node_id) => node_id,
             None => bug!("no node_id found for node: {:?}", n),
@@ -194,13 +194,13 @@ fn node_id(&self, n: &Node) -> dot::Id {
             }
         }
     }
-    fn node_label(&self, n: &Node) -> dot::LabelText {
+    fn node_label(&self, n: &Node) -> dot::LabelText<'_> {
         match *n {
             Node::RegionVid(n_vid) => dot::LabelText::label(format!("{:?}", n_vid)),
             Node::Region(n_rgn) => dot::LabelText::label(format!("{:?}", n_rgn)),
         }
     }
-    fn edge_label(&self, e: &Edge) -> dot::LabelText {
+    fn edge_label(&self, e: &Edge<'_>) -> dot::LabelText<'_> {
         match *e {
             Edge::Constraint(ref c) =>
                 dot::LabelText::label(format!("{:?}", self.map.get(c).unwrap())),
@@ -209,7 +209,7 @@ fn edge_label(&self, e: &Edge) -> dot::LabelText {
     }
 }
 
-fn constraint_to_nodes(c: &Constraint) -> (Node, Node) {
+fn constraint_to_nodes(c: &Constraint<'_>) -> (Node, Node) {
     match *c {
         Constraint::VarSubVar(rv_1, rv_2) =>
             (Node::RegionVid(rv_1), Node::RegionVid(rv_2)),
@@ -222,7 +222,7 @@ fn constraint_to_nodes(c: &Constraint) -> (Node, Node) {
     }
 }
 
-fn edge_to_nodes(e: &Edge) -> (Node, Node) {
+fn edge_to_nodes(e: &Edge<'_>) -> (Node, Node) {
     match *e {
         Edge::Constraint(ref c) => constraint_to_nodes(c),
         Edge::EnclScope(sub, sup) => {
@@ -235,7 +235,7 @@ fn edge_to_nodes(e: &Edge) -> (Node, Node) {
 impl<'a, 'gcx, 'tcx> dot::GraphWalk<'a> for ConstraintGraph<'a, 'gcx, 'tcx> {
     type Node = Node;
     type Edge = Edge<'tcx>;
-    fn nodes(&self) -> dot::Nodes<Node> {
+    fn nodes(&self) -> dot::Nodes<'_, Node> {
         let mut set = FxHashSet();
         for node in self.node_ids.keys() {
             set.insert(*node);
@@ -243,7 +243,7 @@ fn nodes(&self) -> dot::Nodes<Node> {
         debug!("constraint graph has {} nodes", set.len());
         set.into_iter().collect()
     }
-    fn edges(&self) -> dot::Edges<Edge<'tcx>> {
+    fn edges(&self) -> dot::Edges<'_, Edge<'tcx>> {
         debug!("constraint graph has {} edges", self.map.len());
         let mut v: Vec<_> = self.map.keys().map(|e| Edge::Constraint(*e)).collect();
         self.region_rels.region_scope_tree.each_encl_scope(|sub, sup| {
index a8fbfc3b64dfd1e1d63ec40bc02b415bc3bdf882..2046f66f99f66c91ed4086adb5445e15ff4a2b35 100644 (file)
@@ -163,7 +163,7 @@ fn dump_constraints(&self, free_regions: &RegionRelations<'_, '_, 'tcx>) {
         }
     }
 
-    fn expand_givens(&mut self, graph: &RegionGraph) {
+    fn expand_givens(&mut self, graph: &RegionGraph<'_>) {
         // Givens are a kind of horrible hack to account for
         // constraints like 'c <= '0 that are known to hold due to
         // closure signatures (see the comment above on the `givens`
@@ -558,7 +558,7 @@ fn collect_error_for_expanding_node(
         // We place free regions first because we are special casing
         // SubSupConflict(ReFree, ReFree) when reporting error, and so
         // the user will more likely get a specific suggestion.
-        fn region_order_key(x: &RegionAndOrigin) -> u8 {
+        fn region_order_key(x: &RegionAndOrigin<'_>) -> u8 {
             match *x.region {
                 ReEarlyBound(_) => 0,
                 ReFree(_) => 1,
@@ -739,7 +739,7 @@ fn bound_is_met(
 }
 
 impl<'tcx> fmt::Debug for RegionAndOrigin<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "RegionAndOrigin({:?},{:?})", self.region, self.origin)
     }
 }
index dc10ec03feef04c1ae2056b3ad28dc2fe637487e..0407e8ace5acccb72a037908d900337ba44ac56b 100644 (file)
@@ -445,7 +445,7 @@ pub struct RegionObligation<'tcx> {
 }
 
 impl fmt::Display for FixupError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use self::FixupError::*;
 
         match *self {
@@ -590,7 +590,7 @@ pub fn freshen<T: TypeFoldable<'tcx>>(&self, t: T) -> T {
         t.fold_with(&mut self.freshener())
     }
 
-    pub fn type_var_diverges(&'a self, ty: Ty) -> bool {
+    pub fn type_var_diverges(&'a self, ty: Ty<'_>) -> bool {
         match ty.sty {
             ty::Infer(ty::TyVar(vid)) => self.type_variables.borrow().var_diverges(vid),
             _ => false,
@@ -601,7 +601,7 @@ pub fn freshener<'b>(&'b self) -> TypeFreshener<'b, 'gcx, 'tcx> {
         freshen::TypeFreshener::new(self)
     }
 
-    pub fn type_is_unconstrained_numeric(&'a self, ty: Ty) -> UnconstrainedNumeric {
+    pub fn type_is_unconstrained_numeric(&'a self, ty: Ty<'_>) -> UnconstrainedNumeric {
         use ty::error::UnconstrainedNumeric::Neither;
         use ty::error::UnconstrainedNumeric::{UnconstrainedFloat, UnconstrainedInt};
         match ty.sty {
@@ -1510,7 +1510,7 @@ pub fn dummy(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> TypeTrace<'tcx> {
 }
 
 impl<'tcx> fmt::Debug for TypeTrace<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "TypeTrace({:?})", self.cause)
     }
 }
@@ -1598,7 +1598,7 @@ impl<'tcx> TypeFoldable<'tcx> for ValuePairs<'tcx> {
 }
 
 impl<'tcx> fmt::Debug for RegionObligation<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "RegionObligation(sub_region={:?}, sup_type={:?})",
index 88d375742670d2e68dbfe0b2f4d44842328b18b6..e5220aad0562e0273da036e10916a0d49262ba76 100644 (file)
@@ -841,7 +841,7 @@ fn fold_opaque_ty(
 /// We will return true if the reference is within the same module as the existential type
 /// So true for f1, false for f2.
 pub fn may_define_existential_type(
-    tcx: TyCtxt,
+    tcx: TyCtxt<'_, '_, '_>,
     def_id: DefId,
     opaque_node_id: ast::NodeId,
 ) -> bool {
index 6163ec1642001f603e4a7e53690596652a53a77f..e19ecfd427beccbb22c61ffb85cbd00365be3349 100644 (file)
@@ -84,14 +84,14 @@ fn sub_free_regions(&self,
     }
 }
 
-fn is_free(r: Region) -> bool {
+fn is_free(r: Region<'_>) -> bool {
     match *r {
         ty::ReEarlyBound(_) | ty::ReFree(_) => true,
         _ => false
     }
 }
 
-fn is_free_or_static(r: Region) -> bool {
+fn is_free_or_static(r: Region<'_>) -> bool {
     match *r {
         ty::ReStatic => true,
         _ => is_free(r),
index bc9027a08258c944d91223de0111f96238ae8a66..95893a7117892c4a7d45dfacd57b66fe5063ec6b 100644 (file)
@@ -914,13 +914,13 @@ pub fn tainted(
 }
 
 impl fmt::Debug for RegionSnapshot {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "RegionSnapshot(length={})", self.length)
     }
 }
 
 impl<'tcx> fmt::Debug for GenericKind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             GenericKind::Param(ref p) => write!(f, "{:?}", p),
             GenericKind::Projection(ref p) => write!(f, "{:?}", p),
@@ -929,7 +929,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for GenericKind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             GenericKind::Param(ref p) => write!(f, "{}", p),
             GenericKind::Projection(ref p) => write!(f, "{}", p),
index 2eaf1eebb394ca5bc09ec9e754825e258de3b29d..0ac9d415756308030a7f2d457c8b37caf3acf642 100644 (file)
 
 #![feature(box_patterns)]
 #![feature(box_syntax)]
-#![cfg_attr(stage0, feature(const_fn))]
-#![cfg_attr(not(stage0), feature(min_const_fn))]
+#![feature(min_const_fn)]
 #![feature(core_intrinsics)]
 #![feature(drain_filter)]
 #![cfg_attr(windows, feature(libc))]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(never_type)]
 #![feature(exhaustive_patterns)]
 #![feature(extern_types)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(non_exhaustive)]
 #![feature(proc_macro_internals)]
 #![feature(quote)]
@@ -59,7 +57,6 @@
 #![feature(refcell_replace_swap)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(rustc_attrs)]
-#![cfg_attr(stage0, feature(attr_literals))]
 #![feature(slice_patterns)]
 #![feature(slice_sort_by_cached_key)]
 #![feature(specialization)]
 #![feature(step_trait)]
 #![feature(integer_atomics)]
 #![feature(test)]
-#![cfg_attr(not(stage0), feature(impl_header_lifetime_elision))]
+#![feature(impl_header_lifetime_elision)]
 #![feature(in_band_lifetimes)]
 #![feature(macro_at_most_once_rep)]
-#![cfg_attr(stage0, feature(crate_in_paths))]
 #![feature(crate_visibility_modifier)]
 
 #![recursion_limit="512"]
 
+#![warn(elided_lifetimes_in_paths)]
+
 extern crate arena;
 #[macro_use] extern crate bitflags;
 extern crate core;
index 38ec414fda9e383c9c91ee9a719d036fba52ba24..64056ece987706e566e5f539b2adc98a93f73571 100644 (file)
@@ -432,7 +432,7 @@ pub enum BuiltinLintDiagnostics {
 }
 
 impl BuiltinLintDiagnostics {
-    pub fn run(self, sess: &Session, db: &mut DiagnosticBuilder) {
+    pub fn run(self, sess: &Session, db: &mut DiagnosticBuilder<'_>) {
         match self {
             BuiltinLintDiagnostics::Normal => (),
             BuiltinLintDiagnostics::BareTraitObject(span, is_global) => {
index e22792305a0532c4991c03e67b69a621dfdf7550..0633286e39838f3a85ee41442f17dae37a4a8fa0 100644 (file)
@@ -355,7 +355,7 @@ pub fn check_lint_name(
         &self,
         lint_name: &str,
         tool_name: Option<LocalInternedString>,
-    ) -> CheckLintNameResult {
+    ) -> CheckLintNameResult<'_> {
         let complete_name = if let Some(tool_name) = tool_name {
             format!("{}::{}", tool_name, lint_name)
         } else {
@@ -410,7 +410,7 @@ fn check_tool_name_for_backwards_compat(
         &self,
         lint_name: &str,
         tool_name: &str,
-    ) -> CheckLintNameResult {
+    ) -> CheckLintNameResult<'_> {
         let complete_name = format!("{}::{}", tool_name, lint_name);
         match self.by_name.get(&complete_name) {
             None => match self.lint_groups.get(&*complete_name) {
@@ -525,7 +525,7 @@ fn lookup<S: Into<MultiSpan>>(&self,
                                   lint: &'static Lint,
                                   span: Option<S>,
                                   msg: &str)
-                                  -> DiagnosticBuilder;
+                                  -> DiagnosticBuilder<'_>;
 
     /// Emit a lint at the appropriate level, for a particular span.
     fn span_lint<S: Into<MultiSpan>>(&self, lint: &'static Lint, span: S, msg: &str) {
@@ -536,7 +536,7 @@ fn struct_span_lint<S: Into<MultiSpan>>(&self,
                                             lint: &'static Lint,
                                             span: S,
                                             msg: &str)
-                                            -> DiagnosticBuilder {
+                                            -> DiagnosticBuilder<'_> {
         self.lookup(lint, Some(span), msg)
     }
 
@@ -640,7 +640,7 @@ fn lookup<S: Into<MultiSpan>>(&self,
                                   lint: &'static Lint,
                                   span: Option<S>,
                                   msg: &str)
-                                  -> DiagnosticBuilder {
+                                  -> DiagnosticBuilder<'_> {
         let id = self.last_ast_node_with_lint_attrs;
         match span {
             Some(s) => self.tcx.struct_span_lint_node(lint, id, s, msg),
@@ -697,7 +697,7 @@ fn lookup<S: Into<MultiSpan>>(&self,
                                   lint: &'static Lint,
                                   span: Option<S>,
                                   msg: &str)
-                                  -> DiagnosticBuilder {
+                                  -> DiagnosticBuilder<'_> {
         self.builder.struct_lint(lint, span.map(|s| s.into()), msg)
     }
 
index 336ebe79d33abd7276eb6d20f6f427be9f82b04b..80365a56102126ad892e6acc4d1011333239e826 100644 (file)
@@ -54,7 +54,7 @@ pub fn new(sess: &Session) -> LintLevelSets {
         return me
     }
 
-    pub fn builder(sess: &Session) -> LintLevelsBuilder {
+    pub fn builder(sess: &Session) -> LintLevelsBuilder<'_> {
         LintLevelsBuilder::new(sess, LintLevelSets::new(sess))
     }
 
index 8d2851d1b77442403e9604969d22e8c8dcc6cf4d..3327b117d60560822d849bb3f313c03af0a89440 100644 (file)
@@ -327,56 +327,56 @@ fn get_lints(&self) -> LintArray {
 }
 
 pub trait EarlyLintPass: LintPass {
-    fn check_ident(&mut self, _: &EarlyContext, _: ast::Ident) { }
-    fn check_crate(&mut self, _: &EarlyContext, _: &ast::Crate) { }
-    fn check_crate_post(&mut self, _: &EarlyContext, _: &ast::Crate) { }
-    fn check_mod(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
-    fn check_mod_post(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
-    fn check_foreign_item(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
-    fn check_foreign_item_post(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
-    fn check_item(&mut self, _: &EarlyContext, _: &ast::Item) { }
-    fn check_item_post(&mut self, _: &EarlyContext, _: &ast::Item) { }
-    fn check_local(&mut self, _: &EarlyContext, _: &ast::Local) { }
-    fn check_block(&mut self, _: &EarlyContext, _: &ast::Block) { }
-    fn check_block_post(&mut self, _: &EarlyContext, _: &ast::Block) { }
-    fn check_stmt(&mut self, _: &EarlyContext, _: &ast::Stmt) { }
-    fn check_arm(&mut self, _: &EarlyContext, _: &ast::Arm) { }
-    fn check_pat(&mut self, _: &EarlyContext, _: &ast::Pat) { }
-    fn check_expr(&mut self, _: &EarlyContext, _: &ast::Expr) { }
-    fn check_expr_post(&mut self, _: &EarlyContext, _: &ast::Expr) { }
-    fn check_ty(&mut self, _: &EarlyContext, _: &ast::Ty) { }
-    fn check_generic_param(&mut self, _: &EarlyContext, _: &ast::GenericParam) { }
-    fn check_generics(&mut self, _: &EarlyContext, _: &ast::Generics) { }
-    fn check_where_predicate(&mut self, _: &EarlyContext, _: &ast::WherePredicate) { }
-    fn check_poly_trait_ref(&mut self, _: &EarlyContext, _: &ast::PolyTraitRef,
+    fn check_ident(&mut self, _: &EarlyContext<'_>, _: ast::Ident) { }
+    fn check_crate(&mut self, _: &EarlyContext<'_>, _: &ast::Crate) { }
+    fn check_crate_post(&mut self, _: &EarlyContext<'_>, _: &ast::Crate) { }
+    fn check_mod(&mut self, _: &EarlyContext<'_>, _: &ast::Mod, _: Span, _: ast::NodeId) { }
+    fn check_mod_post(&mut self, _: &EarlyContext<'_>, _: &ast::Mod, _: Span, _: ast::NodeId) { }
+    fn check_foreign_item(&mut self, _: &EarlyContext<'_>, _: &ast::ForeignItem) { }
+    fn check_foreign_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::ForeignItem) { }
+    fn check_item(&mut self, _: &EarlyContext<'_>, _: &ast::Item) { }
+    fn check_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::Item) { }
+    fn check_local(&mut self, _: &EarlyContext<'_>, _: &ast::Local) { }
+    fn check_block(&mut self, _: &EarlyContext<'_>, _: &ast::Block) { }
+    fn check_block_post(&mut self, _: &EarlyContext<'_>, _: &ast::Block) { }
+    fn check_stmt(&mut self, _: &EarlyContext<'_>, _: &ast::Stmt) { }
+    fn check_arm(&mut self, _: &EarlyContext<'_>, _: &ast::Arm) { }
+    fn check_pat(&mut self, _: &EarlyContext<'_>, _: &ast::Pat) { }
+    fn check_expr(&mut self, _: &EarlyContext<'_>, _: &ast::Expr) { }
+    fn check_expr_post(&mut self, _: &EarlyContext<'_>, _: &ast::Expr) { }
+    fn check_ty(&mut self, _: &EarlyContext<'_>, _: &ast::Ty) { }
+    fn check_generic_param(&mut self, _: &EarlyContext<'_>, _: &ast::GenericParam) { }
+    fn check_generics(&mut self, _: &EarlyContext<'_>, _: &ast::Generics) { }
+    fn check_where_predicate(&mut self, _: &EarlyContext<'_>, _: &ast::WherePredicate) { }
+    fn check_poly_trait_ref(&mut self, _: &EarlyContext<'_>, _: &ast::PolyTraitRef,
                             _: &ast::TraitBoundModifier) { }
-    fn check_fn(&mut self, _: &EarlyContext,
-        _: ast_visit::FnKind, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
-    fn check_fn_post(&mut self, _: &EarlyContext,
-        _: ast_visit::FnKind, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
-    fn check_trait_item(&mut self, _: &EarlyContext, _: &ast::TraitItem) { }
-    fn check_trait_item_post(&mut self, _: &EarlyContext, _: &ast::TraitItem) { }
-    fn check_impl_item(&mut self, _: &EarlyContext, _: &ast::ImplItem) { }
-    fn check_impl_item_post(&mut self, _: &EarlyContext, _: &ast::ImplItem) { }
-    fn check_struct_def(&mut self, _: &EarlyContext,
+    fn check_fn(&mut self, _: &EarlyContext<'_>,
+        _: ast_visit::FnKind<'_>, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
+    fn check_fn_post(&mut self, _: &EarlyContext<'_>,
+        _: ast_visit::FnKind<'_>, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
+    fn check_trait_item(&mut self, _: &EarlyContext<'_>, _: &ast::TraitItem) { }
+    fn check_trait_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::TraitItem) { }
+    fn check_impl_item(&mut self, _: &EarlyContext<'_>, _: &ast::ImplItem) { }
+    fn check_impl_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::ImplItem) { }
+    fn check_struct_def(&mut self, _: &EarlyContext<'_>,
         _: &ast::VariantData, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
-    fn check_struct_def_post(&mut self, _: &EarlyContext,
+    fn check_struct_def_post(&mut self, _: &EarlyContext<'_>,
         _: &ast::VariantData, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
-    fn check_struct_field(&mut self, _: &EarlyContext, _: &ast::StructField) { }
-    fn check_variant(&mut self, _: &EarlyContext, _: &ast::Variant, _: &ast::Generics) { }
-    fn check_variant_post(&mut self, _: &EarlyContext, _: &ast::Variant, _: &ast::Generics) { }
-    fn check_lifetime(&mut self, _: &EarlyContext, _: &ast::Lifetime) { }
-    fn check_path(&mut self, _: &EarlyContext, _: &ast::Path, _: ast::NodeId) { }
-    fn check_attribute(&mut self, _: &EarlyContext, _: &ast::Attribute) { }
-    fn check_mac_def(&mut self, _: &EarlyContext, _: &ast::MacroDef, _id: ast::NodeId) { }
-    fn check_mac(&mut self, _: &EarlyContext, _: &ast::Mac) { }
+    fn check_struct_field(&mut self, _: &EarlyContext<'_>, _: &ast::StructField) { }
+    fn check_variant(&mut self, _: &EarlyContext<'_>, _: &ast::Variant, _: &ast::Generics) { }
+    fn check_variant_post(&mut self, _: &EarlyContext<'_>, _: &ast::Variant, _: &ast::Generics) { }
+    fn check_lifetime(&mut self, _: &EarlyContext<'_>, _: &ast::Lifetime) { }
+    fn check_path(&mut self, _: &EarlyContext<'_>, _: &ast::Path, _: ast::NodeId) { }
+    fn check_attribute(&mut self, _: &EarlyContext<'_>, _: &ast::Attribute) { }
+    fn check_mac_def(&mut self, _: &EarlyContext<'_>, _: &ast::MacroDef, _id: ast::NodeId) { }
+    fn check_mac(&mut self, _: &EarlyContext<'_>, _: &ast::Mac) { }
 
     /// Called when entering a syntax node that can have lint attributes such
     /// as `#[allow(...)]`. Called with *all* the attributes of that node.
-    fn enter_lint_attrs(&mut self, _: &EarlyContext, _: &[ast::Attribute]) { }
+    fn enter_lint_attrs(&mut self, _: &EarlyContext<'_>, _: &[ast::Attribute]) { }
 
     /// Counterpart to `enter_lint_attrs`.
-    fn exit_lint_attrs(&mut self, _: &EarlyContext, _: &[ast::Attribute]) { }
+    fn exit_lint_attrs(&mut self, _: &EarlyContext<'_>, _: &[ast::Attribute]) { }
 }
 
 /// A lint pass boxed up as a trait object.
@@ -728,7 +728,7 @@ fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) {
     }
 }
 
-pub fn provide(providers: &mut Providers) {
+pub fn provide(providers: &mut Providers<'_>) {
     providers.lint_levels = lint_levels;
 }
 
index f4b44043389615d2c2540f4b692bf198ae3bd2c3..4720bb2954963a1169ad66f9606b93e03e57d379 100644 (file)
@@ -244,7 +244,7 @@ fn encode_metadata<'a, 'tcx>(&self,
 // In order to get this left-to-right dependency ordering, we perform a
 // topological sort of all crates putting the leaves at the right-most
 // positions.
-pub fn used_crates(tcx: TyCtxt, prefer: LinkagePreference)
+pub fn used_crates(tcx: TyCtxt<'_, '_, '_>, prefer: LinkagePreference)
     -> Vec<(CrateNum, LibSource)>
 {
     let mut libs = tcx.crates()
index d320173f9f47d01d95361323f5e58db16819f902..66305ae8836ee90c1f63b23601179ac6def17a85 100644 (file)
@@ -285,7 +285,7 @@ fn visit_path(&mut self, path: &'tcx hir::Path, _: hir::HirId) {
     }
 }
 
-fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt,
+fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt<'_, '_, '_>,
                                     id: ast::NodeId,
                                     attrs: &[ast::Attribute]) -> bool {
     if attr::contains_name(attrs, "lang") {
index a9c118d606b2eb1584a7d8dd9a546cb74e16c935..14551261819a6cd4309a87df5db14e3ed6d8cad9 100644 (file)
@@ -256,7 +256,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     return ret;
 }
 
-fn add_library(tcx: TyCtxt,
+fn add_library(tcx: TyCtxt<'_, '_, '_>,
                cnum: CrateNum,
                link: LinkagePreference,
                m: &mut FxHashMap<CrateNum, LinkagePreference>) {
index b0acc6f20e691f56a0c13070ef9203d9fa87776a..b06d881bcaea41a54de2d5cdb04cb79918afe2c4 100644 (file)
@@ -57,7 +57,7 @@ fn visit_impl_item(&mut self, _impl_item: &'tcx ImplItem) {
 }
 
 pub fn find_entry_point(session: &Session,
-                        hir_map: &hir_map::Map,
+                        hir_map: &hir_map::Map<'_>,
                         crate_name: &str) {
     let any_exe = session.crate_types.borrow().iter().any(|ty| {
         *ty == config::CrateType::Executable
@@ -113,7 +113,7 @@ fn entry_point_type(item: &Item, at_root: bool) -> EntryPointType {
 }
 
 
-fn find_item(item: &Item, ctxt: &mut EntryContext, at_root: bool) {
+fn find_item(item: &Item, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
     match entry_point_type(item, at_root) {
         EntryPointType::MainNamed => {
             if ctxt.main_fn.is_none() {
@@ -154,7 +154,7 @@ fn find_item(item: &Item, ctxt: &mut EntryContext, at_root: bool) {
     }
 }
 
-fn configure_main(this: &mut EntryContext, crate_name: &str) {
+fn configure_main(this: &mut EntryContext<'_, '_>, crate_name: &str) {
     if let Some((node_id, span)) = this.start_fn {
         this.session.entry_fn.set(Some((node_id, span, EntryFnType::Start)));
     } else if let Some((node_id, span)) = this.attr_main_fn {
index 01783eb0ff65f8b90cf561c59d790c5994822d64..6a254f1a189b54c812618b939bbbf952468e068e 100644 (file)
@@ -106,7 +106,7 @@ pub fn compare_stable(&self,
     }
 }
 
-pub fn metadata_symbol_name(tcx: ty::TyCtxt) -> String {
+pub fn metadata_symbol_name(tcx: ty::TyCtxt<'_, '_, '_>) -> String {
     format!("rust_metadata_{}_{}",
             tcx.original_crate_name(LOCAL_CRATE),
             tcx.crate_disambiguator(LOCAL_CRATE).to_fingerprint().to_hex())
index 469ae04c0fdc10bb70dc74c349f461d33ffb37f7..1a86dc4027e877d63038e0b0794156335439145c 100644 (file)
@@ -211,7 +211,7 @@ enum OverloadedCallType {
 }
 
 impl OverloadedCallType {
-    fn from_trait_id(tcx: TyCtxt, trait_id: DefId) -> OverloadedCallType {
+    fn from_trait_id(tcx: TyCtxt<'_, '_, '_>, trait_id: DefId) -> OverloadedCallType {
         for &(maybe_function_trait, overloaded_call_type) in &[
             (tcx.lang_items().fn_once_trait(), FnOnceOverloadedCall),
             (tcx.lang_items().fn_mut_trait(), FnMutOverloadedCall),
@@ -228,7 +228,7 @@ fn from_trait_id(tcx: TyCtxt, trait_id: DefId) -> OverloadedCallType {
         bug!("overloaded call didn't map to known function trait")
     }
 
-    fn from_method_id(tcx: TyCtxt, method_id: DefId) -> OverloadedCallType {
+    fn from_method_id(tcx: TyCtxt<'_, '_, '_>, method_id: DefId) -> OverloadedCallType {
         let method = tcx.associated_item(method_id);
         OverloadedCallType::from_trait_id(tcx, method.container.id())
     }
index 0d70a64123bf364903fa7e328d4133d3872881aa..ff4b1fc2921b25bb8ce377c36382756362bc4409 100644 (file)
@@ -158,7 +158,7 @@ enum LiveNodeKind {
     ExitNode
 }
 
-fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt) -> String {
+fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_, '_, '_>) -> String {
     let cm = tcx.sess.source_map();
     match lnk {
         FreeVarNode(s) => {
@@ -195,13 +195,13 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
 }
 
 impl fmt::Debug for LiveNode {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "ln({})", self.get())
     }
 }
 
 impl fmt::Debug for Variable {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "v({})", self.get())
     }
 }
@@ -371,7 +371,7 @@ fn visit_fn<'a, 'tcx: 'a>(ir: &mut IrMaps<'a, 'tcx>,
         }
     }
 
-    debug!("creating fn_maps: {:?}", &fn_maps as *const IrMaps);
+    debug!("creating fn_maps: {:?}", &fn_maps as *const IrMaps<'_, '_>);
 
     let body = ir.tcx.hir.body(body_id);
 
@@ -1388,7 +1388,7 @@ fn access_path(&mut self, hir_id: HirId, path: &hir::Path, succ: LiveNode, acc:
 
     fn propagate_through_loop(&mut self,
                               expr: &Expr,
-                              kind: LoopKind,
+                              kind: LoopKind<'_>,
                               body: &hir::Block,
                               succ: LiveNode)
                               -> LiveNode {
index 172511474710d6e47c6cf27b4eb6751c04fed669..13c969cec297e9e37d83cfe2b4486c22089026fc 100644 (file)
@@ -324,7 +324,7 @@ pub fn from_borrow_kind(borrow_kind: ty::BorrowKind) -> MutabilityCategory {
     }
 
     fn from_pointer_kind(base_mutbl: MutabilityCategory,
-                         ptr: PointerKind) -> MutabilityCategory {
+                         ptr: PointerKind<'_>) -> MutabilityCategory {
         let ret = match ptr {
             Unique => {
                 base_mutbl.inherit()
@@ -341,7 +341,8 @@ fn from_pointer_kind(base_mutbl: MutabilityCategory,
         ret
     }
 
-    fn from_local(tcx: TyCtxt, tables: &ty::TypeckTables, id: ast::NodeId) -> MutabilityCategory {
+    fn from_local(tcx: TyCtxt<'_, '_, '_>, tables: &ty::TypeckTables<'_>,
+                  id: ast::NodeId) -> MutabilityCategory {
         let ret = match tcx.hir.get(id) {
             Node::Binding(p) => match p.node {
                 PatKind::Binding(..) => {
@@ -1488,7 +1489,7 @@ pub fn upvar_cat(&self) -> Option<&Categorization<'tcx>> {
         }
     }
 
-    pub fn descriptive_string(&self, tcx: TyCtxt) -> String {
+    pub fn descriptive_string(&self, tcx: TyCtxt<'_, '_, '_>) -> String {
         match self.cat {
             Categorization::StaticItem => {
                 "static item".to_string()
@@ -1546,7 +1547,7 @@ pub fn descriptive_string(&self, tcx: TyCtxt) -> String {
     }
 }
 
-pub fn ptr_sigil(ptr: PointerKind) -> &'static str {
+pub fn ptr_sigil(ptr: PointerKind<'_>) -> &'static str {
     match ptr {
         Unique => "Box",
         BorrowedPtr(ty::ImmBorrow, _) => "&",
@@ -1557,7 +1558,7 @@ pub fn ptr_sigil(ptr: PointerKind) -> &'static str {
 }
 
 impl fmt::Debug for InteriorKind {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             InteriorField(FieldIndex(_, info)) => write!(f, "{}", info),
             InteriorElement(..) => write!(f, "[]"),
@@ -1566,13 +1567,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for Upvar {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{:?}/{:?}", self.id, self.kind)
     }
 }
 
 impl fmt::Display for Upvar {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let kind = match self.kind {
             ty::ClosureKind::Fn => "Fn",
             ty::ClosureKind::FnMut => "FnMut",
index 70fed9af92128367700c4fc9b8a8aebf84436cd7..880d428e7a580c7360fdbd8d1693393e3284b4a8 100644 (file)
@@ -59,7 +59,7 @@ fn default() -> Self {
 }
 
 impl<Id: Hash + Eq + fmt::Debug> fmt::Debug for AccessLevels<Id> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Debug::fmt(&self.map, f)
     }
 }
index 55ee8987e8ad54ccbe49313878ef403d7888e3b8..9416d60c9d1a3bfeb05a4c56737f5d3b5ed39e26 100644 (file)
@@ -443,7 +443,7 @@ fn reachable_set<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum) ->
     ReachableSet(Lrc::new(reachable_context.reachable_symbols))
 }
 
-pub fn provide(providers: &mut Providers) {
+pub fn provide(providers: &mut Providers<'_>) {
     *providers = Providers {
         reachable_set,
         ..*providers
index 788fbcef17163581c6e5709b10cdb90ed2da018b..01b0d2c27a1418b8b78988a670869341715633b2 100644 (file)
@@ -107,7 +107,7 @@ pub struct Scope {
 }
 
 impl fmt::Debug for Scope {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.data {
             ScopeData::Node => write!(fmt, "Node({:?})", self.id),
             ScopeData::CallSite => write!(fmt, "CallSite({:?})", self.id),
@@ -168,8 +168,6 @@ pub struct FirstStatementIndex { .. }
 
 // compilation error if size of `ScopeData` is not the same as a `u32`
 #[allow(dead_code)]
-// only works on stage 1 when the rustc_layout_scalar_valid_range attribute actually exists
-#[cfg(not(stage0))]
 static ASSERT: () = [()][!(mem::size_of::<ScopeData>() == 4) as usize];
 
 impl Scope {
@@ -181,7 +179,7 @@ pub fn item_local_id(&self) -> hir::ItemLocalId {
         self.id
     }
 
-    pub fn node_id(&self, tcx: TyCtxt, scope_tree: &ScopeTree) -> ast::NodeId {
+    pub fn node_id(&self, tcx: TyCtxt<'_, '_, '_>, scope_tree: &ScopeTree) -> ast::NodeId {
         match scope_tree.root_body {
             Some(hir_id) => {
                 tcx.hir.hir_to_node_id(hir::HirId {
@@ -196,7 +194,7 @@ pub fn node_id(&self, tcx: TyCtxt, scope_tree: &ScopeTree) -> ast::NodeId {
     /// Returns the span of this Scope.  Note that in general the
     /// returned span may not correspond to the span of any node id in
     /// the AST.
-    pub fn span(&self, tcx: TyCtxt, scope_tree: &ScopeTree) -> Span {
+    pub fn span(&self, tcx: TyCtxt<'_, '_, '_>, scope_tree: &ScopeTree) -> Span {
         let node_id = self.node_id(tcx, scope_tree);
         if node_id == ast::DUMMY_NODE_ID {
             return DUMMY_SP;
@@ -750,7 +748,7 @@ pub fn body_expr_count(&self, body_id: hir::BodyId) -> Option<usize> {
 }
 
 /// Records the lifetime of a local variable as `cx.var_parent`
-fn record_var_lifetime(visitor: &mut RegionResolutionVisitor,
+fn record_var_lifetime(visitor: &mut RegionResolutionVisitor<'_, '_>,
                        var_id: hir::ItemLocalId,
                        _sp: Span) {
     match visitor.cx.var_parent {
@@ -1385,7 +1383,7 @@ fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
     Lrc::new(scope_tree)
 }
 
-pub fn provide(providers: &mut Providers) {
+pub fn provide(providers: &mut Providers<'_>) {
     *providers = Providers {
         region_scope_tree,
         ..*providers
index db931d0a739ff8e7eedeb75d2b333899a913ca87..cda7d8d6b900330391256e1e1e7730bee6868ebb 100644 (file)
@@ -88,7 +88,7 @@ pub enum Region {
 }
 
 impl Region {
-    fn early(hir_map: &Map, index: &mut u32, param: &GenericParam) -> (ParamName, Region) {
+    fn early(hir_map: &Map<'_>, index: &mut u32, param: &GenericParam) -> (ParamName, Region) {
         let i = *index;
         *index += 1;
         let def_id = hir_map.local_def_id(param.id);
@@ -97,7 +97,7 @@ fn early(hir_map: &Map, index: &mut u32, param: &GenericParam) -> (ParamName, Re
         (param.name.modern(), Region::EarlyBound(i, def_id, origin))
     }
 
-    fn late(hir_map: &Map, param: &GenericParam) -> (ParamName, Region) {
+    fn late(hir_map: &Map<'_>, param: &GenericParam) -> (ParamName, Region) {
         let depth = ty::INNERMOST;
         let def_id = hir_map.local_def_id(param.id);
         let origin = LifetimeDefOrigin::from_param(param);
@@ -348,7 +348,7 @@ struct ElisionFailureInfo {
 
 const ROOT_SCOPE: ScopeRef<'static> = &Scope::Root;
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         resolve_lifetimes,
 
@@ -1371,9 +1371,9 @@ fn hack<F>(&mut self, f: F)
         f(self)
     }
 
-    fn with<F>(&mut self, wrap_scope: Scope, f: F)
+    fn with<F>(&mut self, wrap_scope: Scope<'_>, f: F)
     where
-        F: for<'b> FnOnce(ScopeRef, &mut LifetimeContext<'b, 'tcx>),
+        F: for<'b> FnOnce(ScopeRef<'_>, &mut LifetimeContext<'b, 'tcx>),
     {
         let LifetimeContext {
             tcx,
@@ -2159,7 +2159,7 @@ fn resolve_elided_lifetimes(&mut self,
 
     fn report_elision_failure(
         &mut self,
-        db: &mut DiagnosticBuilder,
+        db: &mut DiagnosticBuilder<'_>,
         params: &[ElisionFailureInfo],
     ) {
         let mut m = String::new();
@@ -2268,7 +2268,8 @@ fn resolve_object_lifetime_default(&mut self, lifetime_ref: &'tcx hir::Lifetime)
         self.insert_lifetime(lifetime_ref, lifetime.shifted(late_depth));
     }
 
-    fn check_lifetime_params(&mut self, old_scope: ScopeRef, params: &'tcx [hir::GenericParam]) {
+    fn check_lifetime_params(&mut self, old_scope: ScopeRef<'_>,
+                             params: &'tcx [hir::GenericParam]) {
         let lifetimes: Vec<_> = params.iter().filter_map(|param| match param.kind {
             GenericParamKind::Lifetime { .. } => Some((param, param.name)),
             _ => None,
@@ -2351,7 +2352,7 @@ fn check_lifetime_params(&mut self, old_scope: ScopeRef, params: &'tcx [hir::Gen
 
     fn check_lifetime_param_for_shadowing(
         &self,
-        mut old_scope: ScopeRef,
+        mut old_scope: ScopeRef<'_>,
         param: &'tcx hir::GenericParam,
     ) {
         for label in &self.labels_in_fn {
index cbf6722c0fd375dbcbfbac29a7dd1862098ef168..941bd4dda99d725d32b9ff2ceb1a57709ba11720 100644 (file)
@@ -70,7 +70,7 @@ pub fn link_name(attrs: &[ast::Attribute]) -> Option<Symbol> {
 /// Not all lang items are always required for each compilation, particularly in
 /// the case of panic=abort. In these situations some lang items are injected by
 /// crates and don't actually need to be defined in libstd.
-pub fn whitelisted(tcx: TyCtxt, lang_item: lang_items::LangItem) -> bool {
+pub fn whitelisted(tcx: TyCtxt<'_, '_, '_>, lang_item: lang_items::LangItem) -> bool {
     // If we're not compiling with unwinding, we won't actually need these
     // symbols. Other panic runtimes ensure that the relevant symbols are
     // available to link things together, but they're never exercised.
index d1f050fcd424d23201142bd3453440a245c4b931..32c60c143065d7f4c6b6419eb91b49188c180b07 100644 (file)
@@ -57,8 +57,8 @@ pub fn invalidate(&self) {
 
     pub fn predecessors(
         &self,
-        mir: &Mir
-    ) -> MappedReadGuard<IndexVec<BasicBlock, Vec<BasicBlock>>> {
+        mir: &Mir<'_>
+    ) -> MappedReadGuard<'_, IndexVec<BasicBlock, Vec<BasicBlock>>> {
         if self.predecessors.borrow().is_none() {
             *self.predecessors.borrow_mut() = Some(calculate_predecessors(mir));
         }
@@ -67,7 +67,7 @@ pub fn predecessors(
     }
 }
 
-fn calculate_predecessors(mir: &Mir) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
+fn calculate_predecessors(mir: &Mir<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
     let mut result = IndexVec::from_elem(vec![], mir.basic_blocks());
     for (bb, data) in mir.basic_blocks().iter_enumerated() {
         if let Some(ref term) = data.terminator {
index cccde692bf7895ad13173ef323fa851723176e3a..566673857b975b14df86284a76cf19ecd5e12f18 100644 (file)
@@ -429,13 +429,13 @@ pub fn description(&self) -> &str {
 }
 
 impl<'tcx> fmt::Display for EvalError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{:?}", self.kind)
     }
 }
 
 impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use self::EvalErrorKind::*;
         match *self {
             PointerOutOfBounds { ptr, access, allocation_size } => {
index 5fa47ef42ec3507287cfc4a3ff85ed593d2fac75..be0639f242094b0e296b4bb5e67b13028e58715c 100644 (file)
@@ -253,7 +253,7 @@ pub struct AllocDecodingState {
 
 impl AllocDecodingState {
 
-    pub fn new_decoding_session(&self) -> AllocDecodingSession {
+    pub fn new_decoding_session(&self) -> AllocDecodingSession<'_> {
         static DECODER_SESSION_ID: AtomicU32 = AtomicU32::new(0);
         let counter = DECODER_SESSION_ID.fetch_add(1, Ordering::SeqCst);
 
@@ -394,7 +394,7 @@ pub fn decode_alloc_id<'a, 'tcx, D>(&self,
 }
 
 impl fmt::Display for AllocId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{}", self.0)
     }
 }
index 8fea749e5ab4973dc6b044df2d9bbff35ac257a9..3e6246f2ea8d80e5f45defb710e5ff3c6459e286 100644 (file)
@@ -845,7 +845,7 @@ fn new_local(
     ///
     /// This must be inserted into the `local_decls` list as the first local.
     #[inline]
-    pub fn new_return_place(return_ty: Ty, span: Span) -> LocalDecl {
+    pub fn new_return_place(return_ty: Ty<'_>, span: Span) -> LocalDecl<'_> {
         LocalDecl {
             mutability: Mutability::Mut,
             ty: return_ty,
@@ -1082,11 +1082,11 @@ pub enum TerminatorKind<'tcx> {
     iter::Chain<option::IntoIter<&'a mut BasicBlock>, slice::IterMut<'a, BasicBlock>>;
 
 impl<'tcx> Terminator<'tcx> {
-    pub fn successors(&self) -> Successors {
+    pub fn successors(&self) -> Successors<'_> {
         self.kind.successors()
     }
 
-    pub fn successors_mut(&mut self) -> SuccessorsMut {
+    pub fn successors_mut(&mut self) -> SuccessorsMut<'_> {
         self.kind.successors_mut()
     }
 
@@ -1115,7 +1115,7 @@ pub fn if_<'a, 'gcx>(
         }
     }
 
-    pub fn successors(&self) -> Successors {
+    pub fn successors(&self) -> Successors<'_> {
         use self::TerminatorKind::*;
         match *self {
             Resume
@@ -1200,7 +1200,7 @@ pub fn successors(&self) -> Successors {
         }
     }
 
-    pub fn successors_mut(&mut self) -> SuccessorsMut {
+    pub fn successors_mut(&mut self) -> SuccessorsMut<'_> {
         use self::TerminatorKind::*;
         match *self {
             Resume
@@ -1363,7 +1363,7 @@ pub fn terminator_mut(&mut self) -> &mut Terminator<'tcx> {
 
     pub fn retain_statements<F>(&mut self, mut f: F)
     where
-        F: FnMut(&mut Statement) -> bool,
+        F: FnMut(&mut Statement<'_>) -> bool,
     {
         for s in &mut self.statements {
             if !f(s) {
@@ -1437,7 +1437,7 @@ pub fn visitable(&self, index: usize) -> &dyn MirVisitable<'tcx> {
 }
 
 impl<'tcx> Debug for TerminatorKind<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         self.fmt_head(fmt)?;
         let successor_count = self.successors().count();
         let labels = self.fmt_successor_labels();
@@ -1731,7 +1731,7 @@ pub enum ValidationOp {
 }
 
 impl Debug for ValidationOp {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::ValidationOp::*;
         match *self {
             Acquire => write!(fmt, "Acquire"),
@@ -1752,7 +1752,7 @@ pub struct ValidationOperand<'tcx, T> {
 }
 
 impl<'tcx, T: Debug> Debug for ValidationOperand<'tcx, T> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         write!(fmt, "{:?}: {:?}", self.place, self.ty)?;
         if let Some(ce) = self.re {
             // (reuse lifetime rendering policy from ppaux.)
@@ -1766,7 +1766,7 @@ fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
 }
 
 impl<'tcx> Debug for Statement<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::StatementKind::*;
         match self.kind {
             Assign(ref place, ref rv) => write!(fmt, "{:?} = {:?}", place, rv),
@@ -1923,7 +1923,7 @@ pub fn local(&self) -> Option<Local> {
 }
 
 impl<'tcx> Debug for Place<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::Place::*;
 
         match *self {
@@ -2018,7 +2018,7 @@ pub enum Operand<'tcx> {
 }
 
 impl<'tcx> Debug for Operand<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::Operand::*;
         match *self {
             Constant(ref a) => write!(fmt, "{:?}", a),
@@ -2203,7 +2203,7 @@ pub enum UnOp {
 }
 
 impl<'tcx> Debug for Rvalue<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::Rvalue::*;
 
         match *self {
@@ -2242,7 +2242,7 @@ fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
             }
 
             Aggregate(ref kind, ref places) => {
-                fn fmt_tuple(fmt: &mut Formatter, places: &[Operand]) -> fmt::Result {
+                fn fmt_tuple(fmt: &mut Formatter<'_>, places: &[Operand<'_>]) -> fmt::Result {
                     let mut tuple_fmt = fmt.debug_tuple("");
                     for place in places {
                         tuple_fmt.field(place);
@@ -2356,14 +2356,14 @@ pub struct Promoted {
 }
 
 impl<'tcx> Debug for Constant<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         write!(fmt, "const ")?;
         fmt_const_val(fmt, self.literal)
     }
 }
 
 /// Write a `ConstValue` in a way closer to the original source code than the `Debug` output.
-pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const) -> fmt::Result {
+pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const<'_>) -> fmt::Result {
     use ty::TyKind::*;
     let value = const_val.val;
     let ty = const_val.ty;
@@ -2478,7 +2478,7 @@ pub struct Location {
 }
 
 impl fmt::Debug for Location {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(fmt, "{:?}[{}]", self.block, self.statement_index)
     }
 }
index eb779e6382f4bebb5e7418f7645329cea222cc66..12bc9cf76b5a9a88e2ab7cce7edffeaa7b1d6466 100644 (file)
@@ -2379,7 +2379,7 @@ pub fn check_nightly_options(matches: &getopts::Matches, flags: &[RustcOptGroup]
 }
 
 impl fmt::Display for CrateType {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             CrateType::Executable => "bin".fmt(f),
             CrateType::Dylib => "dylib".fmt(f),
index be347253e7f06879517f18b3fa6c5ba90fa0684c..0bef898ecc7750fd2405a3e81f8b5c5a814f5999 100644 (file)
@@ -705,7 +705,7 @@ pub fn sysroot<'a>(&'a self) -> &'a Path {
                 .expect("missing sysroot and default_sysroot in Session"),
         }
     }
-    pub fn target_filesearch(&self, kind: PathKind) -> filesearch::FileSearch {
+    pub fn target_filesearch(&self, kind: PathKind) -> filesearch::FileSearch<'_> {
         filesearch::FileSearch::new(
             self.sysroot(),
             self.opts.target_triple.triple(),
@@ -713,7 +713,7 @@ pub fn target_filesearch(&self, kind: PathKind) -> filesearch::FileSearch {
             kind,
         )
     }
-    pub fn host_filesearch(&self, kind: PathKind) -> filesearch::FileSearch {
+    pub fn host_filesearch(&self, kind: PathKind) -> filesearch::FileSearch<'_> {
         filesearch::FileSearch::new(
             self.sysroot(),
             config::host_triple(),
@@ -803,7 +803,7 @@ pub fn mark_incr_comp_session_as_invalid(&self) {
         *incr_comp_session = IncrCompSession::InvalidBecauseOfErrors { session_directory };
     }
 
-    pub fn incr_comp_session_dir(&self) -> cell::Ref<PathBuf> {
+    pub fn incr_comp_session_dir(&self) -> cell::Ref<'_, PathBuf> {
         let incr_comp_session = self.incr_comp_session.borrow();
         cell::Ref::map(
             incr_comp_session,
@@ -826,7 +826,7 @@ pub fn incr_comp_session_dir(&self) -> cell::Ref<PathBuf> {
         )
     }
 
-    pub fn incr_comp_session_dir_opt(&self) -> Option<cell::Ref<PathBuf>> {
+    pub fn incr_comp_session_dir_opt(&self) -> Option<cell::Ref<'_, PathBuf>> {
         if self.opts.incremental.is_some() {
             Some(self.incr_comp_session_dir())
         } else {
@@ -1253,7 +1253,7 @@ pub fn to_fingerprint(self) -> Fingerprint {
 }
 
 impl fmt::Display for CrateDisambiguator {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
         let (a, b) = self.0.as_value();
         let as_u128 = a as u128 | ((b as u128) << 64);
         f.write_str(&base_n::encode(as_u128, base_n::CASE_INSENSITIVE))
index d2dca9f60845a42ee91d7c2d1e47b344633a786a..be1bfcc0894dd11c5899ec72c35172f65f4cecf8 100644 (file)
@@ -57,7 +57,7 @@ pub fn add_path(&mut self, path: &str, output: config::ErrorOutputType) {
         self.paths.push((kind, PathBuf::from(path)));
     }
 
-    pub fn iter(&self, kind: PathKind) -> Iter {
+    pub fn iter(&self, kind: PathKind) -> Iter<'_> {
         Iter { kind: kind, iter: self.paths.iter() }
     }
 }
index 8f106a08125386a56ee32998d2b3cbe0eeb554eb..ec1c5a40b4fa354015dc43ebd3fa15d475e4b3b1 100644 (file)
@@ -483,14 +483,15 @@ fn add_user_pred<'c>(
         }
     }
 
-    pub fn region_name(&self, region: Region) -> Option<String> {
+    pub fn region_name(&self, region: Region<'_>) -> Option<String> {
         match region {
             &ty::ReEarlyBound(r) => Some(r.name.to_string()),
             _ => None,
         }
     }
 
-    pub fn get_lifetime(&self, region: Region, names_map: &FxHashMap<String, String>) -> String {
+    pub fn get_lifetime(&self, region: Region<'_>,
+                        names_map: &FxHashMap<String, String>) -> String {
         self.region_name(region)
             .map(|name|
                 names_map.get(&name).unwrap_or_else(||
@@ -591,7 +592,7 @@ pub fn map_vid_to_region<'cx>(
         finished_map
     }
 
-    pub fn is_of_param(&self, substs: &Substs) -> bool {
+    pub fn is_of_param(&self, substs: &Substs<'_>) -> bool {
         if substs.is_noop() {
             return false;
         }
@@ -611,7 +612,7 @@ pub fn evaluate_nested_obligations<
         T: Iterator<Item = Obligation<'cx, ty::Predicate<'cx>>>,
     >(
         &self,
-        ty: ty::Ty,
+        ty: ty::Ty<'_>,
         nested: T,
         computed_preds: &'b mut FxHashSet<ty::Predicate<'cx>>,
         fresh_preds: &'b mut FxHashSet<ty::Predicate<'cx>>,
index 9e9cdc69441cd16d4617b6d9ab0bd0240860f0dc..7401d4099ff6dff05b6305276a9c6ce753ee5ed1 100644 (file)
@@ -337,7 +337,7 @@ pub fn orphan_check<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
 ///
 /// Note that this function is never called for types that have both type
 /// parameters and inference variables.
-fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt,
+fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt<'_, '_, '_>,
                                 trait_ref: ty::TraitRef<'tcx>,
                                 in_crate: InCrate)
                                 -> Result<(), OrphanCheckErr<'tcx>>
@@ -389,7 +389,7 @@ fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt,
     return Err(OrphanCheckErr::NoLocalInputType);
 }
 
-fn uncovered_tys<'tcx>(tcx: TyCtxt, ty: Ty<'tcx>, in_crate: InCrate)
+fn uncovered_tys<'tcx>(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'tcx>, in_crate: InCrate)
                        -> Vec<Ty<'tcx>> {
     if ty_is_local_constructor(ty, in_crate) {
         vec![]
@@ -402,19 +402,19 @@ fn uncovered_tys<'tcx>(tcx: TyCtxt, ty: Ty<'tcx>, in_crate: InCrate)
     }
 }
 
-fn is_possibly_remote_type(ty: Ty, _in_crate: InCrate) -> bool {
+fn is_possibly_remote_type(ty: Ty<'_>, _in_crate: InCrate) -> bool {
     match ty.sty {
         ty::Projection(..) | ty::Param(..) => true,
         _ => false,
     }
 }
 
-fn ty_is_local(tcx: TyCtxt, ty: Ty, in_crate: InCrate) -> bool {
+fn ty_is_local(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'_>, in_crate: InCrate) -> bool {
     ty_is_local_constructor(ty, in_crate) ||
         fundamental_ty(tcx, ty) && ty.walk_shallow().any(|t| ty_is_local(tcx, t, in_crate))
 }
 
-fn fundamental_ty(tcx: TyCtxt, ty: Ty) -> bool {
+fn fundamental_ty(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'_>) -> bool {
     match ty.sty {
         ty::Ref(..) => true,
         ty::Adt(def, _) => def.is_fundamental(),
@@ -434,7 +434,7 @@ fn def_id_is_local(def_id: DefId, in_crate: InCrate) -> bool {
     }
 }
 
-fn ty_is_local_constructor(ty: Ty, in_crate: InCrate) -> bool {
+fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
     debug!("ty_is_local_constructor({:?})", ty);
 
     match ty.sty {
index 6fb5acde72c49735d7280e8e9f39c8782c9a16f7..7695f26d701156272e31d9b59a710f6bab8124a4 100644 (file)
@@ -437,7 +437,7 @@ fn find_similar_impl_candidates(&self,
 
     fn report_similar_impl_candidates(&self,
                                       mut impl_candidates: Vec<ty::TraitRef<'tcx>>,
-                                      err: &mut DiagnosticBuilder)
+                                      err: &mut DiagnosticBuilder<'_>)
     {
         if impl_candidates.is_empty() {
             return;
@@ -930,7 +930,7 @@ fn suggest_remove_reference(&self,
     /// returns a span and `ArgKind` information that describes the
     /// arguments it expects. This can be supplied to
     /// `report_arg_count_mismatch`.
-    pub fn get_fn_like_arguments(&self, node: Node) -> (Span, Vec<ArgKind>) {
+    pub fn get_fn_like_arguments(&self, node: Node<'_>) -> (Span, Vec<ArgKind>) {
         match node {
             Node::Expr(&hir::Expr {
                 node: hir::ExprKind::Closure(_, ref _decl, id, span, _),
@@ -1378,7 +1378,7 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
     }
 
     fn note_obligation_cause<T>(&self,
-                                err: &mut DiagnosticBuilder,
+                                err: &mut DiagnosticBuilder<'_>,
                                 obligation: &Obligation<'tcx, T>)
         where T: fmt::Display
     {
@@ -1389,7 +1389,7 @@ fn note_obligation_cause<T>(&self,
     }
 
     fn note_obligation_cause_code<T>(&self,
-                                     err: &mut DiagnosticBuilder,
+                                     err: &mut DiagnosticBuilder<'_>,
                                      predicate: &T,
                                      cause_code: &ObligationCauseCode<'tcx>,
                                      obligated_types: &mut Vec<&ty::TyS<'tcx>>)
@@ -1545,7 +1545,7 @@ fn note_obligation_cause_code<T>(&self,
         }
     }
 
-    fn suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder) {
+    fn suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder<'_>) {
         let current_limit = self.tcx.sess.recursion_limit.get();
         let suggested_limit = current_limit * 2;
         err.help(&format!("consider adding a `#![recursion_limit=\"{}\"]` attribute to your crate",
index 6b1092814a4043616ab8d119d5078c6c7c70359b..bcbdb179464bece07c55cad98e998e5d676aa1bf 100644 (file)
@@ -1009,7 +1009,7 @@ fn self_ty(&self) -> ty::Binder<Ty<'tcx>> {
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         is_object_safe: object_safety::is_object_safe_provider,
         specialization_graph_of: specialize::specialization_graph_provider,
index f59812c0eea984f4212a3367aa585a35bf9df4c0..dcbddc03080916caf30a1e5d8f5cd2550b6997fd 100644 (file)
@@ -44,7 +44,7 @@ pub fn empty() -> Self {
     }
 }
 
-fn parse_error(tcx: TyCtxt, span: Span,
+fn parse_error(tcx: TyCtxt<'_, '_, '_>, span: Span,
                message: &str,
                label: &str,
                note: Option<&str>)
index 6a5ef75a660ba454027c9b9c8749039e6cd7d944..6708112697bb558d0963e3c3776f05eb8c6b6be6 100644 (file)
@@ -62,7 +62,7 @@ impl<F, G> fmt::Debug for CustomTypeOp<F, G>
 where
     G: Fn() -> String,
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{}", (self.description)())
     }
 }
index ab71d13ab0686d1818257c8170ed3c3d456eb439..7300588f6af39f3e7f192a096a8c75a884fb1a60 100644 (file)
@@ -110,7 +110,7 @@ impl IntercrateAmbiguityCause {
     /// Emits notes when the overlap is caused by complex intercrate ambiguities.
     /// See #23980 for details.
     pub fn add_intercrate_ambiguity_hint<'a, 'tcx>(&self,
-                                                   err: &mut ::errors::DiagnosticBuilder) {
+                                                   err: &mut ::errors::DiagnosticBuilder<'_>) {
         err.note(&self.intercrate_ambiguity_hint());
     }
 
@@ -537,7 +537,7 @@ fn probe<R, F>(&mut self, f: F) -> R
     /// Wraps a commit_if_ok s.t. obligations collected during it are not returned in selection if
     /// the transaction fails and s.t. old obligations are retained.
     fn commit_if_ok<T, E, F>(&mut self, f: F) -> Result<T, E> where
-        F: FnOnce(&mut Self, &infer::CombinedSnapshot) -> Result<T, E>
+        F: FnOnce(&mut Self, &infer::CombinedSnapshot<'cx, 'tcx>) -> Result<T, E>
     {
         self.infcx.commit_if_ok(|snapshot| f(self, snapshot))
     }
@@ -1221,7 +1221,7 @@ fn candidate_from_obligation_no_cache<'o>(&mut self,
 
         // Winnow, but record the exact outcome of evaluation, which
         // is needed for specialization. Propagate overflow if it occurs.
-        let candidates: Result<Vec<Option<EvaluatedCandidate>>, _> = candidates
+        let candidates: Result<Vec<Option<EvaluatedCandidate<'_>>>, _> = candidates
             .into_iter()
             .map(|c| match self.evaluate_candidate(stack, &c) {
                 Ok(eval) if eval.may_apply() => Ok(Some(EvaluatedCandidate {
@@ -1233,7 +1233,7 @@ fn candidate_from_obligation_no_cache<'o>(&mut self,
             })
             .collect();
 
-        let mut candidates: Vec<EvaluatedCandidate> =
+        let mut candidates: Vec<EvaluatedCandidate<'_>> =
             candidates?.into_iter().filter_map(|c| c).collect();
 
         debug!("winnowed to {} candidates for {:?}: {:?}",
@@ -3245,8 +3245,8 @@ fn match_impl(&mut self,
     }
 
     fn fast_reject_trait_refs(&mut self,
-                              obligation: &TraitObligation,
-                              impl_trait_ref: &ty::TraitRef)
+                              obligation: &TraitObligation<'_>,
+                              impl_trait_ref: &ty::TraitRef<'_>)
                               -> bool
     {
         // We can avoid creating type variables and doing the full
@@ -3536,7 +3536,7 @@ fn next(&mut self) -> Option<&'o TraitObligationStack<'o,'tcx>> {
 }
 
 impl<'o,'tcx> fmt::Debug for TraitObligationStack<'o,'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "TraitObligationStack({:?})", self.obligation)
     }
 }
@@ -3552,7 +3552,7 @@ pub fn new(dep_node: DepNodeIndex, cached_value: T) -> Self {
         WithDepNode { dep_node, cached_value }
     }
 
-    pub fn get(&self, tcx: TyCtxt) -> T {
+    pub fn get(&self, tcx: TyCtxt<'_, '_, '_>) -> T {
         tcx.dep_graph.read_index(self.dep_node);
         self.cached_value.clone()
     }
index bd6c2982065ef1acfc05be875a0291dc5f94d903..84ffa22e5dd2ec7a3dec5ebd69b30a2361fcaf3c 100644 (file)
@@ -395,7 +395,7 @@ pub(super) fn specialization_graph_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx
 
 /// Recovers the "impl X for Y" signature from `impl_def_id` and returns it as a
 /// string.
-fn to_pretty_impl_header(tcx: TyCtxt, impl_def_id: DefId) -> Option<String> {
+fn to_pretty_impl_header(tcx: TyCtxt<'_, '_, '_>, impl_def_id: DefId) -> Option<String> {
     use std::fmt::Write;
 
     let trait_ref = if let Some(tr) = tcx.impl_trait_ref(impl_def_id) {
index 756f55545bc45a87090a52085df7588197cbf1a8..e237cab5ea135abde38e63f0fb5d56c9a8e42c6d 100644 (file)
@@ -142,7 +142,7 @@ fn insert(&mut self,
                 possible_sibling,
             );
 
-            let overlap_error = |overlap: traits::coherence::OverlapResult| {
+            let overlap_error = |overlap: traits::coherence::OverlapResult<'_>| {
                 // overlap, but no specialization; error out
                 let trait_ref = overlap.impl_header.trait_ref.unwrap();
                 let self_ty = trait_ref.self_ty();
@@ -447,7 +447,7 @@ pub fn defs(
 
 /// Walk up the specialization ancestors of a given impl, starting with that
 /// impl itself.
-pub fn ancestors(tcx: TyCtxt,
+pub fn ancestors(tcx: TyCtxt<'_, '_, '_>,
                  trait_def_id: DefId,
                  start_from_impl: DefId)
                  -> Ancestors {
index 3244b1d7480ac95bac10e829c362ebcb798ae332..22e79fc2638abbf1a7f9e1a712c62060a91060ef 100644 (file)
 // structural impls for the structs in traits
 
 impl<'tcx, T: fmt::Debug> fmt::Debug for Normalized<'tcx, T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "Normalized({:?},{:?})", self.value, self.obligations)
     }
 }
 
 impl<'tcx, O: fmt::Debug> fmt::Debug for traits::Obligation<'tcx, O> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         if ty::tls::with(|tcx| tcx.sess.verbose()) {
             write!(
                 f,
@@ -45,7 +45,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::Vtable<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             super::VtableImpl(ref v) => write!(f, "{:?}", v),
 
@@ -67,7 +67,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableImplData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableImpl(impl_def_id={:?}, substs={:?}, nested={:?})",
@@ -77,7 +77,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableGeneratorData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableGenerator(generator_def_id={:?}, substs={:?}, nested={:?})",
@@ -87,7 +87,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableClosureData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableClosure(closure_def_id={:?}, substs={:?}, nested={:?})",
@@ -97,13 +97,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableBuiltinData<N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "VtableBuiltin(nested={:?})", self.nested)
     }
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableAutoImplData<N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableAutoImplData(trait_def_id={:?}, nested={:?})",
@@ -113,7 +113,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableObjectData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableObject(upcast={:?}, vtable_base={}, nested={:?})",
@@ -123,7 +123,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableFnPointerData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableFnPointer(fn_ty={:?}, nested={:?})",
@@ -133,13 +133,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for traits::FulfillmentError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "FulfillmentError({:?},{:?})", self.obligation, self.code)
     }
 }
 
 impl<'tcx> fmt::Debug for traits::FulfillmentErrorCode<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             super::CodeSelectionError(ref e) => write!(f, "{:?}", e),
             super::CodeProjectionError(ref e) => write!(f, "{:?}", e),
@@ -152,7 +152,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for traits::MismatchedProjectionTypes<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "MismatchedProjectionTypes({:?})", self.err)
     }
 }
@@ -409,7 +409,7 @@ impl<'tcx, T> TypeFoldable<'tcx> for Normalized<'tcx, T> {
 }
 
 impl<'tcx> fmt::Display for traits::WhereClause<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::WhereClause::*;
 
         match self {
@@ -422,7 +422,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::WellFormed<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::WellFormed::*;
 
         match self {
@@ -433,7 +433,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::FromEnv<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::FromEnv::*;
 
         match self {
@@ -444,7 +444,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::DomainGoal<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::DomainGoal::*;
 
         match self {
@@ -457,7 +457,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Display for traits::QuantifierKind {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::QuantifierKind::*;
 
         match self {
@@ -468,7 +468,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::Goal<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::Goal::*;
 
         match self {
@@ -495,7 +495,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::ProgramClause<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         let traits::ProgramClause { goal, hypotheses } = self;
         write!(fmt, "{}", goal)?;
         if !hypotheses.is_empty() {
@@ -512,7 +512,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::Clause<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::Clause::*;
 
         match self {
index 45280402e489be43d71963999e2ce06a4d8a480e..ae87d30ec942711254f433149c21612809efe235 100644 (file)
@@ -320,7 +320,7 @@ impl<$($typaram ),*> Decoder for $DecoderName<$($typaram),*> {
                     read_f64 -> f64;
                     read_f32 -> f32;
                     read_char -> char;
-                    read_str -> Cow<str>;
+                    read_str -> Cow<'_, str>;
                 }
 
                 fn error(&mut self, err: &str) -> Self::Error {
@@ -417,4 +417,3 @@ fn specialized_decode(
         }
     }
 }
-
index ccf78eb93c57e9401f12275f9dbb0cb85110f5d4..63408d809ec2989fb528b1be16a16ff83eb7cf05 100644 (file)
@@ -301,7 +301,7 @@ pub fn get(&self, id: hir::HirId) -> Option<&V> {
         self.data.get(&id.local_id)
     }
 
-    pub fn iter(&self) -> hash_map::Iter<hir::ItemLocalId, V> {
+    pub fn iter(&self) -> hash_map::Iter<'_, hir::ItemLocalId, V> {
         self.data.iter()
     }
 }
@@ -325,7 +325,7 @@ pub fn get_mut(&mut self, id: hir::HirId) -> Option<&mut V> {
         self.data.get_mut(&id.local_id)
     }
 
-    pub fn entry(&mut self, id: hir::HirId) -> Entry<hir::ItemLocalId, V> {
+    pub fn entry(&mut self, id: hir::HirId) -> Entry<'_, hir::ItemLocalId, V> {
         validate_hir_id_for_typeck_tables(self.local_id_root, id, true);
         self.data.entry(id.local_id)
     }
@@ -483,56 +483,56 @@ pub fn qpath_def(&self, qpath: &hir::QPath, id: hir::HirId) -> Def {
         }
     }
 
-    pub fn type_dependent_defs(&self) -> LocalTableInContext<Def> {
+    pub fn type_dependent_defs(&self) -> LocalTableInContext<'_, Def> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.type_dependent_defs
         }
     }
 
-    pub fn type_dependent_defs_mut(&mut self) -> LocalTableInContextMut<Def> {
+    pub fn type_dependent_defs_mut(&mut self) -> LocalTableInContextMut<'_, Def> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.type_dependent_defs
         }
     }
 
-    pub fn field_indices(&self) -> LocalTableInContext<usize> {
+    pub fn field_indices(&self) -> LocalTableInContext<'_, usize> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.field_indices
         }
     }
 
-    pub fn field_indices_mut(&mut self) -> LocalTableInContextMut<usize> {
+    pub fn field_indices_mut(&mut self) -> LocalTableInContextMut<'_, usize> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.field_indices
         }
     }
 
-    pub fn user_provided_tys(&self) -> LocalTableInContext<CanonicalTy<'tcx>> {
+    pub fn user_provided_tys(&self) -> LocalTableInContext<'_, CanonicalTy<'tcx>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.user_provided_tys
         }
     }
 
-    pub fn user_provided_tys_mut(&mut self) -> LocalTableInContextMut<CanonicalTy<'tcx>> {
+    pub fn user_provided_tys_mut(&mut self) -> LocalTableInContextMut<'_, CanonicalTy<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.user_provided_tys
         }
     }
 
-    pub fn node_types(&self) -> LocalTableInContext<Ty<'tcx>> {
+    pub fn node_types(&self) -> LocalTableInContext<'_, Ty<'tcx>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.node_types
         }
     }
 
-    pub fn node_types_mut(&mut self) -> LocalTableInContextMut<Ty<'tcx>> {
+    pub fn node_types_mut(&mut self) -> LocalTableInContextMut<'_, Ty<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.node_types
@@ -557,7 +557,7 @@ pub fn node_id_to_type_opt(&self, id: hir::HirId) -> Option<Ty<'tcx>> {
         self.node_types.get(&id.local_id).cloned()
     }
 
-    pub fn node_substs_mut(&mut self) -> LocalTableInContextMut<&'tcx Substs<'tcx>> {
+    pub fn node_substs_mut(&mut self) -> LocalTableInContextMut<'_, &'tcx Substs<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.node_substs
@@ -574,7 +574,7 @@ pub fn node_substs_opt(&self, id: hir::HirId) -> Option<&'tcx Substs<'tcx>> {
         self.node_substs.get(&id.local_id).cloned()
     }
 
-    pub fn user_substs_mut(&mut self) -> LocalTableInContextMut<CanonicalSubsts<'tcx>> {
+    pub fn user_substs_mut(&mut self) -> LocalTableInContextMut<'_, CanonicalSubsts<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.user_substs
@@ -614,7 +614,7 @@ pub fn expr_ty_opt(&self, expr: &hir::Expr) -> Option<Ty<'tcx>> {
         self.node_id_to_type_opt(expr.hir_id)
     }
 
-    pub fn adjustments(&self) -> LocalTableInContext<Vec<ty::adjustment::Adjustment<'tcx>>> {
+    pub fn adjustments(&self) -> LocalTableInContext<'_, Vec<ty::adjustment::Adjustment<'tcx>>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.adjustments
@@ -622,7 +622,7 @@ pub fn adjustments(&self) -> LocalTableInContext<Vec<ty::adjustment::Adjustment<
     }
 
     pub fn adjustments_mut(&mut self)
-                           -> LocalTableInContextMut<Vec<ty::adjustment::Adjustment<'tcx>>> {
+                           -> LocalTableInContextMut<'_, Vec<ty::adjustment::Adjustment<'tcx>>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.adjustments
@@ -663,7 +663,7 @@ pub fn is_method_call(&self, expr: &hir::Expr) -> bool {
         }
     }
 
-    pub fn pat_binding_modes(&self) -> LocalTableInContext<BindingMode> {
+    pub fn pat_binding_modes(&self) -> LocalTableInContext<'_, BindingMode> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.pat_binding_modes
@@ -671,14 +671,14 @@ pub fn pat_binding_modes(&self) -> LocalTableInContext<BindingMode> {
     }
 
     pub fn pat_binding_modes_mut(&mut self)
-                           -> LocalTableInContextMut<BindingMode> {
+                           -> LocalTableInContextMut<'_, BindingMode> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.pat_binding_modes
         }
     }
 
-    pub fn pat_adjustments(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
+    pub fn pat_adjustments(&self) -> LocalTableInContext<'_, Vec<Ty<'tcx>>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.pat_adjustments,
@@ -686,7 +686,7 @@ pub fn pat_adjustments(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
     }
 
     pub fn pat_adjustments_mut(&mut self)
-                           -> LocalTableInContextMut<Vec<Ty<'tcx>>> {
+                           -> LocalTableInContextMut<'_, Vec<Ty<'tcx>>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.pat_adjustments,
@@ -697,56 +697,56 @@ pub fn upvar_capture(&self, upvar_id: ty::UpvarId) -> ty::UpvarCapture<'tcx> {
         self.upvar_capture_map[&upvar_id]
     }
 
-    pub fn closure_kind_origins(&self) -> LocalTableInContext<(Span, ast::Name)> {
+    pub fn closure_kind_origins(&self) -> LocalTableInContext<'_, (Span, ast::Name)> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.closure_kind_origins
         }
     }
 
-    pub fn closure_kind_origins_mut(&mut self) -> LocalTableInContextMut<(Span, ast::Name)> {
+    pub fn closure_kind_origins_mut(&mut self) -> LocalTableInContextMut<'_, (Span, ast::Name)> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.closure_kind_origins
         }
     }
 
-    pub fn liberated_fn_sigs(&self) -> LocalTableInContext<ty::FnSig<'tcx>> {
+    pub fn liberated_fn_sigs(&self) -> LocalTableInContext<'_, ty::FnSig<'tcx>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.liberated_fn_sigs
         }
     }
 
-    pub fn liberated_fn_sigs_mut(&mut self) -> LocalTableInContextMut<ty::FnSig<'tcx>> {
+    pub fn liberated_fn_sigs_mut(&mut self) -> LocalTableInContextMut<'_, ty::FnSig<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.liberated_fn_sigs
         }
     }
 
-    pub fn fru_field_types(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
+    pub fn fru_field_types(&self) -> LocalTableInContext<'_, Vec<Ty<'tcx>>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.fru_field_types
         }
     }
 
-    pub fn fru_field_types_mut(&mut self) -> LocalTableInContextMut<Vec<Ty<'tcx>>> {
+    pub fn fru_field_types_mut(&mut self) -> LocalTableInContextMut<'_, Vec<Ty<'tcx>>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.fru_field_types
         }
     }
 
-    pub fn cast_kinds(&self) -> LocalTableInContext<ty::cast::CastKind> {
+    pub fn cast_kinds(&self) -> LocalTableInContext<'_, ty::cast::CastKind> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.cast_kinds
         }
     }
 
-    pub fn cast_kinds_mut(&mut self) -> LocalTableInContextMut<ty::cast::CastKind> {
+    pub fn cast_kinds_mut(&mut self) -> LocalTableInContextMut<'_, ty::cast::CastKind> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.cast_kinds
@@ -829,12 +829,13 @@ fn hash_stable<W: StableHasherResult>(&self,
 impl<'tcx> CommonTypes<'tcx> {
     fn new(interners: &CtxtInterners<'tcx>) -> CommonTypes<'tcx> {
         // Ensure our type representation does not grow
-        #[cfg(all(not(stage0), target_pointer_width = "64"))]
+        #[cfg(target_pointer_width = "64")]
         #[allow(dead_code)]
-        static ASSERT_TY_KIND: () = [()][!(::std::mem::size_of::<ty::TyKind>() <= 24) as usize];
-        #[cfg(all(not(stage0), target_pointer_width = "64"))]
+        static ASSERT_TY_KIND: () =
+            [()][!(::std::mem::size_of::<ty::TyKind<'_>>() <= 24) as usize];
+        #[cfg(target_pointer_width = "64")]
         #[allow(dead_code)]
-        static ASSERT_TYS: () = [()][!(::std::mem::size_of::<ty::TyS>() <= 32) as usize];
+        static ASSERT_TYS: () = [()][!(::std::mem::size_of::<ty::TyS<'_>>() <= 32) as usize];
 
         let mk = |sty| CtxtInterners::intern_ty(interners, interners, sty);
         let mk_region = |r| {
@@ -2008,7 +2009,7 @@ fn get_tlv() -> usize {
 
     /// This is a callback from libsyntax as it cannot access the implicit state
     /// in librustc otherwise
-    fn span_debug(span: syntax_pos::Span, f: &mut fmt::Formatter) -> fmt::Result {
+    fn span_debug(span: syntax_pos::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         with(|tcx| {
             write!(f, "{}", tcx.sess.source_map().span_to_string(span))
         })
@@ -2131,9 +2132,9 @@ pub fn with_context_opt<F, R>(f: F) -> R
         } else {
             // We could get a ImplicitCtxt pointer from another thread.
             // Ensure that ImplicitCtxt is Sync
-            sync::assert_sync::<ImplicitCtxt>();
+            sync::assert_sync::<ImplicitCtxt<'_, '_, '_>>();
 
-            unsafe { f(Some(&*(context as *const ImplicitCtxt))) }
+            unsafe { f(Some(&*(context as *const ImplicitCtxt<'_, '_, '_>))) }
         }
     }
 
@@ -2157,7 +2158,7 @@ pub fn with_related_context<'a, 'gcx, 'tcx1, F, R>(tcx: TyCtxt<'a, 'gcx, 'tcx1>,
             unsafe {
                 let gcx = tcx.gcx as *const _ as usize;
                 assert!(context.tcx.gcx as *const _ as usize == gcx);
-                let context: &ImplicitCtxt = mem::transmute(context);
+                let context: &ImplicitCtxt<'_, '_, '_> = mem::transmute(context);
                 f(context)
             }
         })
@@ -2177,7 +2178,7 @@ pub fn with_fully_related_context<'a, 'gcx, 'tcx, F, R>(tcx: TyCtxt<'a, 'gcx, 't
                 let interners = tcx.interners as *const _ as usize;
                 assert!(context.tcx.gcx as *const _ as usize == gcx);
                 assert!(context.tcx.interners as *const _ as usize == interners);
-                let context: &ImplicitCtxt = mem::transmute(context);
+                let context: &ImplicitCtxt<'_, '_, '_> = mem::transmute(context);
                 f(context)
             }
         })
@@ -2217,7 +2218,7 @@ struct DebugStat {
                 both_infer: usize,
             }
 
-            pub fn go(tcx: TyCtxt) {
+            pub fn go(tcx: TyCtxt<'_, '_, '_>) {
                 let mut total = DebugStat {
                     total: 0,
                     region_infer: 0, ty_infer: 0, both_infer: 0,
@@ -2459,7 +2460,7 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
 
 direct_interners!('tcx,
     region: mk_region(|r: &RegionKind| r.keep_in_local_tcx()) -> RegionKind,
-    const_: mk_const(|c: &Const| keep_local(&c.ty) || keep_local(&c.val)) -> Const<'tcx>
+    const_: mk_const(|c: &Const<'_>| keep_local(&c.ty) || keep_local(&c.val)) -> Const<'tcx>
 );
 
 macro_rules! slice_interners {
@@ -2468,7 +2469,7 @@ macro_rules! slice_interners {
             &[$ty<'tcx>],
             |a, v| List::from_arena(a, v),
             Deref::deref,
-            |xs: &[$ty]| xs.iter().any(keep_local)) -> List<$ty<'tcx>>);)+
+            |xs: &[$ty<'_>]| xs.iter().any(keep_local)) -> List<$ty<'tcx>>);)+
     )
 }
 
@@ -2858,7 +2859,7 @@ pub fn mk_goals<I: InternAs<[Goal<'tcx>], Goals<'tcx>>>(self, iter: I) -> I::Out
         iter.intern_with(|xs| self.intern_goals(xs))
     }
 
-    pub fn mk_goal(self, goal: Goal<'tcx>) -> &'tcx Goal {
+    pub fn mk_goal(self, goal: Goal<'tcx>) -> &'tcx Goal<'_> {
         &self.intern_goals(&[goal])[0]
     }
 
@@ -3025,7 +3026,7 @@ fn intern_with<I: Iterator<Item=Self>, F: FnOnce(&[T]) -> R>(iter: I, f: F) -> S
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     // FIXME(#44234) - almost all of these queries have no sub-queries and
     // therefore no actual inputs, they're just reading tables calculated in
     // resolve! Does this work? Unsure! That's what the issue is about
index 2fb2154ce6ba0f5a3ca0ce277db399af4941cf04..f53e634a044e7814d857f6b2a275e3af04ca97b0 100644 (file)
@@ -11,7 +11,7 @@
 use ty::{self, Ty, TyCtxt};
 use ty::fold::{TypeFolder, TypeFoldable};
 
-pub(super) fn provide(providers: &mut ty::query::Providers) {
+pub(super) fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         erase_regions_ty,
         ..*providers
index 2b833c57140b4808d3354e0ad7429ee4965f1d69..9f9d918415e7e8221bb414a393bdb736829b85e1 100644 (file)
@@ -68,9 +68,9 @@ pub enum UnconstrainedNumeric {
 /// afterwards to present additional details, particularly when it comes to lifetime-related
 /// errors.
 impl<'tcx> fmt::Display for TypeError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use self::TypeError::*;
-        fn report_maybe_different(f: &mut fmt::Formatter,
+        fn report_maybe_different(f: &mut fmt::Formatter<'_>,
                                   expected: String, found: String) -> fmt::Result {
             // A naive approach to making sure that we're not reporting silly errors such as:
             // (expected closure, found closure).
@@ -237,7 +237,7 @@ pub fn sort_string(&self, tcx: TyCtxt<'a, 'gcx, 'lcx>) -> String {
 
 impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
     pub fn note_and_explain_type_err(self,
-                                     db: &mut DiagnosticBuilder,
+                                     db: &mut DiagnosticBuilder<'_>,
                                      err: &TypeError<'tcx>,
                                      sp: Span) {
         use self::TypeError::*;
index 22a77bd6253c88eac9fae621d4b183aea9f98219..2d055fd307dc440029ec65e495d2234c10ea25f0 100644 (file)
@@ -63,7 +63,7 @@ pub enum SimplifiedTypeGen<D>
 /// `can_simplify_params` should be true if type parameters appear free in `ty` and `false` if they
 /// are to be considered bound.
 pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
-                                     ty: Ty,
+                                     ty: Ty<'_>,
                                      can_simplify_params: bool)
                                      -> Option<SimplifiedType>
 {
index 341ce40d153b0c8dddde45f254485bbaf9be55c8..08d10578238737b21a28118b489dfd33f90ce252 100644 (file)
@@ -28,7 +28,7 @@ fn new() -> FlagComputation {
         }
     }
 
-    pub fn for_sty(st: &ty::TyKind) -> FlagComputation {
+    pub fn for_sty(st: &ty::TyKind<'_>) -> FlagComputation {
         let mut result = FlagComputation::new();
         result.add_sty(st);
         result
@@ -67,7 +67,7 @@ fn add_bound_computation(&mut self, computation: &FlagComputation) {
         }
     }
 
-    fn add_sty(&mut self, st: &ty::TyKind) {
+    fn add_sty(&mut self, st: &ty::TyKind<'_>) {
         match st {
             &ty::Bool |
             &ty::Char |
@@ -204,18 +204,18 @@ fn add_sty(&mut self, st: &ty::TyKind) {
         }
     }
 
-    fn add_ty(&mut self, ty: Ty) {
+    fn add_ty(&mut self, ty: Ty<'_>) {
         self.add_flags(ty.flags);
         self.add_exclusive_binder(ty.outer_exclusive_binder);
     }
 
-    fn add_tys(&mut self, tys: &[Ty]) {
+    fn add_tys(&mut self, tys: &[Ty<'_>]) {
         for &ty in tys {
             self.add_ty(ty);
         }
     }
 
-    fn add_fn_sig(&mut self, fn_sig: ty::PolyFnSig) {
+    fn add_fn_sig(&mut self, fn_sig: ty::PolyFnSig<'_>) {
         let mut computation = FlagComputation::new();
 
         computation.add_tys(fn_sig.skip_binder().inputs());
@@ -224,14 +224,14 @@ fn add_fn_sig(&mut self, fn_sig: ty::PolyFnSig) {
         self.add_bound_computation(&computation);
     }
 
-    fn add_region(&mut self, r: ty::Region) {
+    fn add_region(&mut self, r: ty::Region<'_>) {
         self.add_flags(r.type_flags());
         if let ty::ReLateBound(debruijn, _) = *r {
             self.add_binder(debruijn);
         }
     }
 
-    fn add_const(&mut self, constant: &ty::Const) {
+    fn add_const(&mut self, constant: &ty::Const<'_>) {
         self.add_ty(constant.ty);
         if let ConstValue::Unevaluated(_, substs) = constant.val {
             self.add_flags(TypeFlags::HAS_PROJECTION);
@@ -239,16 +239,16 @@ fn add_const(&mut self, constant: &ty::Const) {
         }
     }
 
-    fn add_existential_projection(&mut self, projection: &ty::ExistentialProjection) {
+    fn add_existential_projection(&mut self, projection: &ty::ExistentialProjection<'_>) {
         self.add_substs(projection.substs);
         self.add_ty(projection.ty);
     }
 
-    fn add_projection_ty(&mut self, projection_ty: &ty::ProjectionTy) {
+    fn add_projection_ty(&mut self, projection_ty: &ty::ProjectionTy<'_>) {
         self.add_substs(projection_ty.substs);
     }
 
-    fn add_substs(&mut self, substs: &Substs) {
+    fn add_substs(&mut self, substs: &Substs<'_>) {
         for ty in substs.types() {
             self.add_ty(ty);
         }
index a661125d1ca03441601dbd08d2c86c494a46d1ab..6bf493b496c8b92b60a9d1b358a5bdcfdbc7bb11 100644 (file)
@@ -708,7 +708,7 @@ struct HasTypeFlagsVisitor {
 }
 
 impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
-    fn visit_ty(&mut self, t: Ty) -> bool {
+    fn visit_ty(&mut self, t: Ty<'_>) -> bool {
         debug!("HasTypeFlagsVisitor: t={:?} t.flags={:?} self.flags={:?}", t, t.flags, self.flags);
         t.flags.intersects(self.flags)
     }
index 68996f52b867a27adf6fd88dd9c2c264c8a35baa..a6e181a26f420479b14f8e753866d1f78de7f5bd 100644 (file)
@@ -114,7 +114,7 @@ pub fn requires_local<'a>(
 }
 
 impl<'tcx> fmt::Display for Instance<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ppaux::parameterized(f, self.substs, self.def_id(), &[])?;
         match self.def {
             InstanceDef::Item(_) => Ok(()),
index 0272865bda45bc9bde1166bb720fa2ec8f02f3c6..1b4ff18f6b8d8fff3c3040309fb093b318c0da5b 100644 (file)
@@ -355,7 +355,7 @@ pub fn parent_def_id(self, def_id: DefId) -> Option<DefId> {
 /// function tries to find a "characteristic def-id" for a
 /// type. It's just a heuristic so it makes some questionable
 /// decisions and we may want to adjust it later.
-pub fn characteristic_def_id_of_type(ty: Ty) -> Option<DefId> {
+pub fn characteristic_def_id_of_type(ty: Ty<'_>) -> Option<DefId> {
     match ty.sty {
         ty::Adt(adt_def, _) => Some(adt_def.did),
 
index 4e37a34a0c8a7f9af70d13a8f8d1cd8a790a3003..e756313a1253db3bae0d45bf2830ac8e7c325a49 100644 (file)
@@ -157,7 +157,7 @@ pub enum LayoutError<'tcx> {
 }
 
 impl<'tcx> fmt::Display for LayoutError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             LayoutError::Unknown(ty) => {
                 write!(f, "the type `{:?}` has an unknown layout", ty)
@@ -195,7 +195,7 @@ fn layout_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     })
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         layout_raw,
         ..*providers
@@ -250,7 +250,7 @@ enum StructKind {
             /// A univariant, but with a prefix of an arbitrary size & alignment (e.g. enum tag).
             Prefixed(Size, Align),
         }
-        let univariant_uninterned = |fields: &[TyLayout], repr: &ReprOptions, kind| {
+        let univariant_uninterned = |fields: &[TyLayout<'_>], repr: &ReprOptions, kind| {
             let packed = repr.packed();
             if packed && repr.align > 0 {
                 bug!("struct cannot be packed and aligned");
@@ -283,7 +283,7 @@ enum StructKind {
                     fields.len()
                 };
                 let optimizing = &mut inverse_memory_index[..end];
-                let field_align = |f: &TyLayout| {
+                let field_align = |f: &TyLayout<'_>| {
                     if packed { f.align.min(pack).abi() } else { f.align.abi() }
                 };
                 match kind {
@@ -464,7 +464,7 @@ enum StructKind {
                 size
             })
         };
-        let univariant = |fields: &[TyLayout], repr: &ReprOptions, kind| {
+        let univariant = |fields: &[TyLayout<'_>], repr: &ReprOptions, kind| {
             Ok(tcx.intern_layout(univariant_uninterned(fields, repr, kind)?))
         };
         debug_assert!(!ty.has_infer_types());
@@ -723,7 +723,7 @@ enum StructKind {
                 // but *not* an encoding of the discriminant (e.g. a tag value).
                 // See issue #49298 for more details on the need to leave space
                 // for non-ZST uninhabited data (mostly partial initialization).
-                let absent = |fields: &[TyLayout]| {
+                let absent = |fields: &[TyLayout<'_>]| {
                     let uninhabited = fields.iter().any(|f| f.abi == Abi::Uninhabited);
                     let is_zst = fields.iter().all(|f| f.is_zst());
                     uninhabited && is_zst
@@ -1403,7 +1403,7 @@ pub fn compute(ty: Ty<'tcx>,
         }
     }
 
-    pub fn same_size(self, other: SizeSkeleton) -> bool {
+    pub fn same_size(self, other: SizeSkeleton<'_>) -> bool {
         match (self, other) {
             (SizeSkeleton::Known(a), SizeSkeleton::Known(b)) => a == b,
             (SizeSkeleton::Pointer { tail: a, .. },
index df9335e909bc5e3d3f64950a0a97aae9bae633d2..b2281691bd66089da9269d309bc5583a0a63121a 100644 (file)
@@ -273,7 +273,7 @@ fn parent(self, id: DefId) -> Option<DefId> {
 }
 
 impl Visibility {
-    pub fn from_hir(visibility: &hir::Visibility, id: NodeId, tcx: TyCtxt) -> Self {
+    pub fn from_hir(visibility: &hir::Visibility, id: NodeId, tcx: TyCtxt<'_, '_, '_>) -> Self {
         match visibility.node {
             hir::VisibilityKind::Public => Visibility::Public,
             hir::VisibilityKind::Crate(_) => Visibility::Restricted(DefId::local(CRATE_DEF_INDEX)),
@@ -536,7 +536,7 @@ impl<'tcx> Eq for TyS<'tcx> {}
 
 impl<'tcx> Hash for TyS<'tcx> {
     fn hash<H: Hasher>(&self, s: &mut H) {
-        (self as *const TyS).hash(s)
+        (self as *const TyS<'_>).hash(s)
     }
 }
 
@@ -649,7 +649,7 @@ fn from_arena<'tcx>(arena: &'tcx SyncDroplessArena, slice: &[T]) -> &'tcx List<T
 }
 
 impl<T: fmt::Debug> fmt::Debug for List<T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         (**self).fmt(f)
     }
 }
@@ -1263,7 +1263,7 @@ pub fn item_def_id(&self) -> DefId {
         self.skip_binder().projection_ty.item_def_id
     }
 
-    pub fn to_poly_trait_ref(&self, tcx: TyCtxt) -> PolyTraitRef<'tcx> {
+    pub fn to_poly_trait_ref(&self, tcx: TyCtxt<'_, '_, '_>) -> PolyTraitRef<'tcx> {
         // Note: unlike with TraitRef::to_poly_trait_ref(),
         // self.0.trait_ref is permitted to have escaping regions.
         // This is because here `self` has a `Binder` and so does our
@@ -1541,7 +1541,7 @@ pub fn as_usize(&self) -> usize {
 }
 
 impl fmt::Debug for UniverseIndex {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(fmt, "U{}", self.as_u32())
     }
 }
@@ -1931,7 +1931,7 @@ pub struct ReprOptions {
 });
 
 impl ReprOptions {
-    pub fn new(tcx: TyCtxt, did: DefId) -> ReprOptions {
+    pub fn new(tcx: TyCtxt<'_, '_, '_>, did: DefId) -> ReprOptions {
         let mut flags = ReprFlags::empty();
         let mut size = None;
         let mut max_align = 0;
@@ -1999,7 +1999,7 @@ pub fn inhibit_struct_field_reordering_opt(&self) -> bool {
 }
 
 impl<'a, 'gcx, 'tcx> AdtDef {
-    fn new(tcx: TyCtxt,
+    fn new(tcx: TyCtxt<'_, '_, '_>,
            did: DefId,
            kind: AdtKind,
            variants: Vec<VariantDef>,
@@ -2644,7 +2644,7 @@ fn associated_item_from_impl_item_ref(self,
         }
     }
 
-    pub fn field_index(self, node_id: NodeId, tables: &TypeckTables) -> usize {
+    pub fn field_index(self, node_id: NodeId, tables: &TypeckTables<'_>) -> usize {
         let hir_id = self.hir.node_to_hir_id(node_id);
         tables.field_indices().get(hir_id).cloned().expect("no index for a field")
     }
@@ -2971,7 +2971,7 @@ fn trait_of_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Option
 }
 
 /// Yields the parent function's `DefId` if `def_id` is an `impl Trait` definition
-pub fn is_impl_trait_defn(tcx: TyCtxt, def_id: DefId) -> Option<DefId> {
+pub fn is_impl_trait_defn(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Option<DefId> {
     if let Some(node_id) = tcx.hir.as_local_node_id(def_id) {
         if let Node::Item(item) = tcx.hir.get(node_id) {
             if let hir::ItemKind::Existential(ref exist_ty) = item.node {
@@ -3051,7 +3051,7 @@ fn instance_def_size_estimate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     context::provide(providers);
     erase_regions::provide(providers);
     layout::provide(providers);
@@ -3106,13 +3106,13 @@ pub fn as_str(&self) -> LocalInternedString {
 }
 
 impl fmt::Display for SymbolName {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(&self.name, fmt)
     }
 }
 
 impl fmt::Debug for SymbolName {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(&self.name, fmt)
     }
 }
index ca6f0b77b6640b5c5c371792fe0f9e680e4e8b18..0fcaef5de54c2dbaa93b881c9c73d93302647b7a 100644 (file)
@@ -294,7 +294,7 @@ You can put new impls into the `config` module. They look something like this:
 
 ```rust
 impl<'tcx> QueryDescription for queries::type_of<'tcx> {
-    fn describe(tcx: TyCtxt, key: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: DefId) -> String {
         format!("computing the type of `{}`", tcx.item_path_str(key))
     }
 }
index 2bbf5aacc1aca85192da2dffc29bf38a3ad04149..9ea655ba6fd5d45402cbd4a72cd5bbcba31fd6bc 100644 (file)
@@ -55,7 +55,7 @@ pub(super) trait QueryAccessors<'tcx>: QueryConfig<'tcx> {
 }
 
 pub(super) trait QueryDescription<'tcx>: QueryAccessors<'tcx> {
-    fn describe(tcx: TyCtxt, key: Self::Key) -> String;
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: Self::Key) -> String;
 
     #[inline]
     fn cache_on_disk(_: Self::Key) -> bool {
@@ -70,7 +70,7 @@ fn try_load_from_disk(_: TyCtxt<'_, 'tcx, 'tcx>,
 }
 
 impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M {
-    default fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    default fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         if !tcx.sess.verbose() {
             format!("processing `{}`", tcx.item_path_str(def_id))
         } else {
@@ -82,7 +82,7 @@ impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M {
 
 impl<'tcx> QueryDescription<'tcx> for queries::normalize_projection_ty<'tcx> {
     fn describe(
-        _tcx: TyCtxt,
+        _tcx: TyCtxt<'_, '_, '_>,
         goal: CanonicalProjectionGoal<'tcx>,
     ) -> String {
         format!("normalizing `{:?}`", goal)
@@ -90,56 +90,57 @@ fn describe(
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::implied_outlives_bounds<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTyGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTyGoal<'tcx>) -> String {
         format!("computing implied outlives bounds for `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dropck_outlives<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTyGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTyGoal<'tcx>) -> String {
         format!("computing dropck types for `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::normalize_ty_after_erasing_regions<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("normalizing `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::evaluate_obligation<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalPredicateGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalPredicateGoal<'tcx>) -> String {
         format!("evaluating trait selection obligation `{}`", goal.value.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_eq<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpEqGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpEqGoal<'tcx>) -> String {
         format!("evaluating `type_op_eq` `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_subtype<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpSubtypeGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpSubtypeGoal<'tcx>) -> String {
         format!("evaluating `type_op_subtype` `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_prove_predicate<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpProvePredicateGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpProvePredicateGoal<'tcx>) -> String {
         format!("evaluating `type_op_prove_predicate` `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_ty<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>,
+                goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>) -> String {
         format!("normalizing `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_predicate<'tcx> {
     fn describe(
-        _tcx: TyCtxt,
+        _tcx: TyCtxt<'_, '_, '_>,
         goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Predicate<'tcx>>,
     ) -> String {
         format!("normalizing `{:?}`", goal)
@@ -148,7 +149,7 @@ fn describe(
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_poly_fn_sig<'tcx> {
     fn describe(
-        _tcx: TyCtxt,
+        _tcx: TyCtxt<'_, '_, '_>,
         goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>>,
     ) -> String {
         format!("normalizing `{:?}`", goal)
@@ -156,56 +157,57 @@ fn describe(
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_fn_sig<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>,
+                goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>) -> String {
         format!("normalizing `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_copy_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` is `Copy`", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_sized_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` is `Sized`", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_freeze_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` is freeze", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::needs_drop_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` needs drop", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::layout_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing layout of `{}`", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::super_predicates_of<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("computing the supertraits of `{}`",
                 tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::erase_regions_ty<'tcx> {
-    fn describe(_tcx: TyCtxt, ty: Ty<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, ty: Ty<'tcx>) -> String {
         format!("erasing regions from `{:?}`", ty)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_param_predicates<'tcx> {
-    fn describe(tcx: TyCtxt, (_, def_id): (DefId, DefId)) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, (_, def_id): (DefId, DefId)) -> String {
         let id = tcx.hir.as_local_node_id(def_id).unwrap();
         format!("computing the bounds for type parameter `{}`",
                 tcx.hir.ty_param_name(id))
@@ -213,69 +215,69 @@ fn describe(tcx: TyCtxt, (_, def_id): (DefId, DefId)) -> String {
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::coherent_trait<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("coherence checking all impls of trait `{}`",
                 tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::upstream_monomorphizations<'tcx> {
-    fn describe(_: TyCtxt, k: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, k: CrateNum) -> String {
         format!("collecting available upstream monomorphizations `{:?}`", k)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls<'tcx> {
-    fn describe(_: TyCtxt, k: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, k: CrateNum) -> String {
         format!("all inherent impls defined in crate `{:?}`", k)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls_overlap_check<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "check for overlap between inherent impls defined in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_variances<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "computing the variances for items in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::inferred_outlives_crate<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "computing the inferred outlives predicates for items in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::mir_shims<'tcx> {
-    fn describe(tcx: TyCtxt, def: ty::InstanceDef<'tcx>) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> String {
         format!("generating MIR shim for `{}`",
                 tcx.item_path_str(def.def_id()))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::privacy_access_levels<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "privacy access levels".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::typeck_item_bodies<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "type-checking all item bodies".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::reachable_set<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "reachability".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> {
-    fn describe(tcx: TyCtxt, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) -> String {
         format!("const-evaluating `{}`", tcx.item_path_str(key.value.instance.def.def_id()))
     }
 
@@ -293,13 +295,13 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::mir_keys<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "getting a list of all mir_keys".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
-    fn describe(_tcx: TyCtxt, instance: ty::Instance<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, instance: ty::Instance<'tcx>) -> String {
         format!("computing the symbol for `{}`", instance)
     }
 
@@ -317,62 +319,62 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::describe_def<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("describe_def")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::def_span<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("def_span")
     }
 }
 
 
 impl<'tcx> QueryDescription<'tcx> for queries::lookup_stability<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("stability")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::lookup_deprecation_entry<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("deprecation")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::item_attrs<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("item_attrs")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_reachable_non_generic<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("is_reachable_non_generic")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::fn_arg_names<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("fn_arg_names")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::impl_parent<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("impl_parent")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::trait_of_item<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("trait_of_item")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_static<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("const checking if rvalue is promotable to static `{}`",
             tcx.item_path_str(def_id))
     }
@@ -391,21 +393,22 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::rvalue_promotable_map<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("checking which parts of `{}` are promotable to static",
                 tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_mir_available<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("checking if item is mir available: `{}`",
             tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx> {
-    fn describe(tcx: TyCtxt, key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>,
+                key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> String {
         format!("checking if `{}` fulfills its obligations", tcx.item_path_str(key.1.def_id()))
     }
 
@@ -423,319 +426,319 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::trait_impls_of<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("trait impls of `{}`", tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_object_safe<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("determine object safety of trait `{}`", tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_const_fn<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("checking if item is const fn: `{}`", tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dylib_dependency_formats<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "dylib dependency formats of crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_panic_runtime<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate is_panic_runtime".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_compiler_builtins<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate is_compiler_builtins".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::has_global_allocator<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate has_global_allocator".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::has_panic_handler<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate has_panic_handler".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::extern_crate<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         "getting crate's ExternCrateData".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::lint_levels<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "computing the lint levels for items in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::specializes<'tcx> {
-    fn describe(_tcx: TyCtxt, _: (DefId, DefId)) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: (DefId, DefId)) -> String {
         "computing whether impls specialize one another".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::in_scope_traits_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "traits in scope at a block".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_no_builtins<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "test whether a crate has #![no_builtins]".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::panic_strategy<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "query a crate's configured panic strategy".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_profiler_runtime<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "query a crate is #![profiler_runtime]".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_sanitizer_runtime<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "query a crate is #![sanitizer_runtime]".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::reachable_non_generics<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the exported symbols of a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::native_libraries<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the native libraries of a linked crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::foreign_modules<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the foreign modules of a linked crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::plugin_registrar_fn<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the plugin registrar for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::derive_registrar_fn<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the derive registrar for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_disambiguator<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the disambiguator a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_hash<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the hash a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::original_crate_name<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the original name a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::extra_filename<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the extra filename for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::implementations_of_trait<'tcx> {
-    fn describe(_tcx: TyCtxt, _: (CrateNum, DefId)) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: (CrateNum, DefId)) -> String {
         "looking up implementations of a trait in a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::all_trait_implementations<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up all (?) trait implementations".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::link_args<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up link arguments for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::resolve_lifetimes<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "resolving lifetimes".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::named_region_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "looking up a named region".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_late_bound_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "testing if a region is late bound".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::object_lifetime_defaults_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "looking up lifetime defaults for a region".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dep_kind<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching what a dependency looks like".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_name<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching what a crate is named".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::get_lib_features<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         format!("calculating the lib features map")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::defined_lib_features<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         format!("calculating the lib features defined in a crate")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::get_lang_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the lang items map".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::defined_lang_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the lang items defined in a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::missing_lang_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the missing lang items in a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::visible_parent_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the visible parent map".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::missing_extern_crate_item<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "seeing if we're missing an `extern crate` item for this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::used_crate_source<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking at the source for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::postorder_cnums<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "generating a postorder list of CrateNums".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::maybe_unused_extern_crates<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up all possibly unused extern crates".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::stability_index<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the stability index for the local crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::all_traits<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching all foreign and local traits".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::all_crate_nums<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching all foreign CrateNum instances".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::exported_symbols<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "exported_symbols".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::collect_and_partition_mono_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "collect_and_partition_mono_items".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::codegen_unit<'tcx> {
-    fn describe(_tcx: TyCtxt, _: InternedString) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: InternedString) -> String {
         "codegen_unit".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::output_filenames<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "output_filenames".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::vtable_methods<'tcx> {
-    fn describe(tcx: TyCtxt, key: ty::PolyTraitRef<'tcx> ) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::PolyTraitRef<'tcx> ) -> String {
         format!("finding all methods for trait {}", tcx.item_path_str(key.def_id()))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up enabled feature gates".to_string()
     }
 }
@@ -773,19 +776,19 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::substitute_normalize_and_test_predicates<'tcx> {
-    fn describe(tcx: TyCtxt, key: (DefId, &'tcx Substs<'tcx>)) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: (DefId, &'tcx Substs<'tcx>)) -> String {
         format!("testing substituted normalized predicates:`{}`", tcx.item_path_str(key.0))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::target_features_whitelist<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the whitelist of target features".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx> {
-    fn describe(tcx: TyCtxt, def: ty::InstanceDef<'tcx>) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> String {
         format!("estimating size for `{}`", tcx.item_path_str(def.def_id()))
     }
 }
@@ -806,25 +809,25 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::program_clauses_for<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefId) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         "generating chalk-style clauses".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::program_clauses_for_env<'tcx> {
-    fn describe(_tcx: TyCtxt, _: ty::ParamEnv<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: ty::ParamEnv<'tcx>) -> String {
         "generating chalk-style clauses for param env".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::wasm_import_module_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "wasm import module map".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dllimport_foreign_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "wasm import module map".to_string()
     }
 }
index 8423b02ee7582d2e73f74f30ba285592aeffba3b..96b0a768001a83b737764b8c7e6d96ac823646b5 100644 (file)
@@ -31,7 +31,7 @@ pub(super) trait Key: Clone + Hash + Eq + Debug {
 
     /// In the event that a cycle occurs, if no explicit span has been
     /// given for a query with key `self`, what span should we use?
-    fn default_span(&self, tcx: TyCtxt) -> Span;
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span;
 }
 
 impl<'tcx> Key for ty::InstanceDef<'tcx> {
@@ -39,7 +39,7 @@ fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
 
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.def_id())
     }
 }
@@ -49,7 +49,7 @@ fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
 
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.def_id())
     }
 }
@@ -59,7 +59,7 @@ fn query_crate(&self) -> CrateNum {
         self.instance.query_crate()
     }
 
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.instance.default_span(tcx)
     }
 }
@@ -68,7 +68,7 @@ impl Key for CrateNum {
     fn query_crate(&self) -> CrateNum {
         *self
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -77,7 +77,7 @@ impl Key for DefIndex {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _tcx: TyCtxt) -> Span {
+    fn default_span(&self, _tcx: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -86,7 +86,7 @@ impl Key for DefId {
     fn query_crate(&self) -> CrateNum {
         self.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(*self)
     }
 }
@@ -95,7 +95,7 @@ impl Key for (DefId, DefId) {
     fn query_crate(&self) -> CrateNum {
         self.0.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.1.default_span(tcx)
     }
 }
@@ -104,7 +104,7 @@ impl Key for (CrateNum, DefId) {
     fn query_crate(&self) -> CrateNum {
         self.0
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.1.default_span(tcx)
     }
 }
@@ -113,7 +113,7 @@ impl Key for (DefId, SimplifiedType) {
     fn query_crate(&self) -> CrateNum {
         self.0.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.0.default_span(tcx)
     }
 }
@@ -122,7 +122,7 @@ impl<'tcx> Key for (DefId, &'tcx Substs<'tcx>) {
     fn query_crate(&self) -> CrateNum {
         self.0.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.0.default_span(tcx)
     }
 }
@@ -131,7 +131,7 @@ impl<'tcx> Key for (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>) {
     fn query_crate(&self) -> CrateNum {
         self.1.def_id().krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.1.def_id())
     }
 }
@@ -140,7 +140,7 @@ impl<'tcx> Key for ty::PolyTraitRef<'tcx>{
     fn query_crate(&self) -> CrateNum {
         self.def_id().krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.def_id())
     }
 }
@@ -149,7 +149,7 @@ impl<'tcx> Key for &'tcx ty::Const<'tcx> {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -158,7 +158,7 @@ impl<'tcx> Key for Ty<'tcx> {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -167,7 +167,7 @@ impl<'tcx> Key for ty::ParamEnv<'tcx> {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -176,7 +176,7 @@ impl<'tcx, T: Key> Key for ty::ParamEnvAnd<'tcx, T> {
     fn query_crate(&self) -> CrateNum {
         self.value.query_crate()
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.value.default_span(tcx)
     }
 }
@@ -185,7 +185,7 @@ impl Key for InternedString {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _tcx: TyCtxt) -> Span {
+    fn default_span(&self, _tcx: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -200,7 +200,7 @@ fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
 
-    fn default_span(&self, _tcx: TyCtxt) -> Span {
+    fn default_span(&self, _tcx: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
index 79c7e517273fc72c6764ba16303abeda4417beb4..e0a503a9cebf51e57c2df7764b0f2626411f4227 100644 (file)
@@ -666,21 +666,21 @@ pub fn try_adt_sized_constraint(
         span: Span,
         key: DefId,
     ) -> Result<&'tcx [Ty<'tcx>], DiagnosticBuilder<'a>> {
-        self.try_get_query::<queries::adt_sized_constraint>(span, key)
+        self.try_get_query::<queries::adt_sized_constraint<'_>>(span, key)
     }
     pub fn try_needs_drop_raw(
         self,
         span: Span,
         key: ty::ParamEnvAnd<'tcx, Ty<'tcx>>,
     ) -> Result<bool, DiagnosticBuilder<'a>> {
-        self.try_get_query::<queries::needs_drop_raw>(span, key)
+        self.try_get_query::<queries::needs_drop_raw<'_>>(span, key)
     }
     pub fn try_optimized_mir(
         self,
         span: Span,
         key: DefId,
     ) -> Result<&'tcx mir::Mir<'tcx>, DiagnosticBuilder<'a>> {
-        self.try_get_query::<queries::optimized_mir>(span, key)
+        self.try_get_query::<queries::optimized_mir<'_>>(span, key)
     }
 }
 
index 296602e21bad74f13c0871478811dc8eb62adfdb..bb877864632237effd2ddd6921e7d8c02a99313c 100644 (file)
@@ -212,23 +212,23 @@ pub fn serialize<'a, 'tcx, E>(&self,
                 let enc = &mut encoder;
                 let qri = &mut query_result_index;
 
-                encode_query_results::<type_of, _>(tcx, enc, qri)?;
-                encode_query_results::<generics_of, _>(tcx, enc, qri)?;
-                encode_query_results::<predicates_of, _>(tcx, enc, qri)?;
-                encode_query_results::<used_trait_imports, _>(tcx, enc, qri)?;
-                encode_query_results::<typeck_tables_of, _>(tcx, enc, qri)?;
-                encode_query_results::<codegen_fulfill_obligation, _>(tcx, enc, qri)?;
-                encode_query_results::<optimized_mir, _>(tcx, enc, qri)?;
-                encode_query_results::<unsafety_check_result, _>(tcx, enc, qri)?;
-                encode_query_results::<borrowck, _>(tcx, enc, qri)?;
-                encode_query_results::<mir_borrowck, _>(tcx, enc, qri)?;
-                encode_query_results::<mir_const_qualif, _>(tcx, enc, qri)?;
-                encode_query_results::<def_symbol_name, _>(tcx, enc, qri)?;
-                encode_query_results::<const_is_rvalue_promotable_to_static, _>(tcx, enc, qri)?;
-                encode_query_results::<symbol_name, _>(tcx, enc, qri)?;
-                encode_query_results::<check_match, _>(tcx, enc, qri)?;
-                encode_query_results::<codegen_fn_attrs, _>(tcx, enc, qri)?;
-                encode_query_results::<specialization_graph_of, _>(tcx, enc, qri)?;
+                encode_query_results::<type_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<generics_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<predicates_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<used_trait_imports<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<typeck_tables_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<codegen_fulfill_obligation<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<optimized_mir<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<unsafety_check_result<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<borrowck<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<mir_borrowck<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<mir_const_qualif<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<def_symbol_name<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<const_is_rvalue_promotable_to_static<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<symbol_name<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<check_match<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<codegen_fn_attrs<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<specialization_graph_of<'_>, _>(tcx, enc, qri)?;
 
                 // const eval is special, it only encodes successfully evaluated constants
                 use ty::query::QueryAccessors;
@@ -323,7 +323,7 @@ pub fn serialize<'a, 'tcx, E>(&self,
 
             return Ok(());
 
-            fn sorted_cnums_including_local_crate(tcx: TyCtxt) -> Vec<CrateNum> {
+            fn sorted_cnums_including_local_crate(tcx: TyCtxt<'_, '_, '_>) -> Vec<CrateNum> {
                 let mut cnums = vec![LOCAL_CRATE];
                 cnums.extend_from_slice(&tcx.crates()[..]);
                 cnums.sort_unstable();
@@ -434,7 +434,7 @@ fn load_indexed<'tcx, T>(&self,
     // current-session-CrateNum. There might be CrateNums from the previous
     // Session that don't occur in the current one. For these, the mapping
     // maps to None.
-    fn compute_cnum_map(tcx: TyCtxt,
+    fn compute_cnum_map(tcx: TyCtxt<'_, '_, '_>,
                         prev_cnums: &[(u32, String, CrateDisambiguator)])
                         -> IndexVec<CrateNum, Option<CrateNum>>
     {
index 25e72f462e680006634de0636a81e0e6e10b0181..510ca08b62100df4c0188a1b03c721b238397102 100644 (file)
@@ -733,7 +733,7 @@ pub fn name(&self) -> &'static str {
                 }
             }
 
-            pub fn describe(&self, tcx: TyCtxt) -> String {
+            pub fn describe(&self, tcx: TyCtxt<'_, '_, '_>) -> String {
                 let (r, name) = match *self {
                     $(Query::$name(key) => {
                         (queries::$name::describe(tcx, key), stringify!($name))
@@ -845,7 +845,7 @@ impl<'a, $tcx, 'lcx> queries::$name<$tcx> {
             ///
             /// Note: The optimization is only available during incr. comp.
             pub fn ensure(tcx: TyCtxt<'a, $tcx, 'lcx>, key: $K) -> () {
-                tcx.ensure_query::<queries::$name>(key);
+                tcx.ensure_query::<queries::$name<'_>>(key);
             }
         })*
 
@@ -881,7 +881,7 @@ pub fn $name(self, key: $K) -> $V {
         impl<'a, $tcx, 'lcx> TyCtxtAt<'a, $tcx, 'lcx> {
             $($(#[$attr])*
             pub fn $name(self, key: $K) -> $V {
-                self.tcx.get_query::<queries::$name>(self.span, key)
+                self.tcx.get_query::<queries::$name<'_>>(self.span, key)
             })*
         }
 
@@ -1028,7 +1028,9 @@ macro_rules! force {
                     )
                 );
 
-                match tcx.force_query::<::ty::query::queries::$query>($key, DUMMY_SP, *dep_node) {
+                match tcx.force_query::<::ty::query::queries::$query<'_>>(
+                    $key, DUMMY_SP, *dep_node
+                ) {
                     Ok(_) => {},
                     Err(e) => {
                         tcx.report_cycle(e).emit();
@@ -1281,7 +1283,7 @@ macro_rules! impl_load_from_cache {
         impl DepNode {
             // Check whether the query invocation corresponding to the given
             // DepNode is eligible for on-disk-caching.
-            pub fn cache_on_disk(&self, tcx: TyCtxt) -> bool {
+            pub fn cache_on_disk(&self, tcx: TyCtxt<'_, '_, '_>) -> bool {
                 use ty::query::queries;
                 use ty::query::QueryDescription;
 
@@ -1299,7 +1301,7 @@ pub fn cache_on_disk(&self, tcx: TyCtxt) -> bool {
             // above `cache_on_disk` methods returns true.
             // Also, as a sanity check, it expects that the corresponding query
             // invocation has been marked as green already.
-            pub fn load_from_on_disk_cache(&self, tcx: TyCtxt) {
+            pub fn load_from_on_disk_cache(&self, tcx: TyCtxt<'_, '_, '_>) {
                 match self.kind {
                     $(DepKind::$dep_kind => {
                         debug_assert!(tcx.dep_graph
index 3ff3cb4cae1d499dddf592c8a9db4854d0f00fcd..1092e23ec3b1d4b182fd9447a7ab7c4731e15f0d 100644 (file)
@@ -42,7 +42,7 @@ pub fn new(value: T) -> Self {
         }
     }
 
-    pub fn borrow(&self) -> MappedReadGuard<T> {
+    pub fn borrow(&self) -> MappedReadGuard<'_, T> {
         ReadGuard::map(self.value.borrow(), |opt| match *opt {
             None => bug!("attempted to read from stolen value"),
             Some(ref v) => v
index 8e4819b68a95f6e1d3e07d531fff2364af15a222..6c40dd892391671f8fd7770b83dd5db68c8a37e6 100644 (file)
@@ -708,7 +708,7 @@ pub fn erase_self_ty(tcx: TyCtxt<'a, 'gcx, 'tcx>,
     pub fn with_self_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, self_ty: Ty<'tcx>)
         -> ty::TraitRef<'tcx>  {
         // otherwise the escaping regions would be captured by the binder
-        debug_assert!(!self_ty.has_escaping_regions());
+        // debug_assert!(!self_ty.has_escaping_regions());
 
         ty::TraitRef {
             def_id: self.def_id,
@@ -864,7 +864,7 @@ impl<'a, 'tcx> ProjectionTy<'tcx> {
     /// Construct a ProjectionTy by searching the trait from trait_ref for the
     /// associated item named item_name.
     pub fn from_ref_and_name(
-        tcx: TyCtxt, trait_ref: ty::TraitRef<'tcx>, item_name: Ident
+        tcx: TyCtxt<'_, '_, '_>, trait_ref: ty::TraitRef<'tcx>, item_name: Ident
     ) -> ProjectionTy<'tcx> {
         let item_def_id = tcx.associated_items(trait_ref.def_id).find(|item| {
             item.kind == ty::AssociatedKind::Type &&
@@ -880,7 +880,7 @@ pub fn from_ref_and_name(
     /// Extracts the underlying trait reference from this projection.
     /// For example, if this is a projection of `<T as Iterator>::Item`,
     /// then this function would return a `T: Iterator` trait reference.
-    pub fn trait_ref(&self, tcx: TyCtxt) -> ty::TraitRef<'tcx> {
+    pub fn trait_ref(&self, tcx: TyCtxt<'_, '_, '_>) -> ty::TraitRef<'tcx> {
         let def_id = tcx.associated_item(self.item_def_id).container.id();
         ty::TraitRef {
             def_id,
@@ -1225,7 +1225,7 @@ impl<'a, 'tcx, 'gcx> ExistentialProjection<'tcx> {
     /// For example, if this is a projection of `exists T. <T as Iterator>::Item == X`,
     /// then this function would return a `exists T. T: Iterator` existential trait
     /// reference.
-    pub fn trait_ref(&self, tcx: TyCtxt) -> ty::ExistentialTraitRef<'tcx> {
+    pub fn trait_ref(&self, tcx: TyCtxt<'_, '_, '_>) -> ty::ExistentialTraitRef<'tcx> {
         let def_id = tcx.associated_item(self.item_def_id).container.id();
         ty::ExistentialTraitRef{
             def_id,
@@ -1569,7 +1569,7 @@ pub fn simd_type(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Ty<'tcx> {
         }
     }
 
-    pub fn simd_size(&self, _cx: TyCtxt) -> usize {
+    pub fn simd_size(&self, _cx: TyCtxt<'_, '_, '_>) -> usize {
         match self.sty {
             Adt(def, _) => def.non_enum_variant().fields.len(),
             _ => bug!("simd_size called on invalid type")
index 696c4d0043c14993dd374c9c10fc943d339174cc..4b3a70e525ec3d11a9382e9b73fb717a56daf654 100644 (file)
@@ -73,13 +73,13 @@ fn pack(self) -> Kind<'tcx> {
 }
 
 impl<'tcx> Ord for Kind<'tcx> {
-    fn cmp(&self, other: &Kind) -> Ordering {
+    fn cmp(&self, other: &Kind<'_>) -> Ordering {
         self.unpack().cmp(&other.unpack())
     }
 }
 
 impl<'tcx> PartialOrd for Kind<'tcx> {
-    fn partial_cmp(&self, other: &Kind) -> Option<Ordering> {
+    fn partial_cmp(&self, other: &Kind<'_>) -> Option<Ordering> {
         Some(self.cmp(&other))
     }
 }
@@ -111,7 +111,7 @@ pub fn unpack(self) -> UnpackedKind<'tcx> {
 }
 
 impl<'tcx> fmt::Debug for Kind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.unpack() {
             UnpackedKind::Lifetime(lt) => write!(f, "{:?}", lt),
             UnpackedKind::Type(ty) => write!(f, "{:?}", ty),
@@ -120,7 +120,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for Kind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.unpack() {
             UnpackedKind::Lifetime(lt) => write!(f, "{}", lt),
             UnpackedKind::Type(ty) => write!(f, "{}", ty),
index cc0429de2f6241a644d97cf05b5f2f615bd44573..93fc77359e43ab082160b05a1ebe8675b1827412 100644 (file)
@@ -39,7 +39,7 @@ pub struct Discr<'tcx> {
 }
 
 impl<'tcx> fmt::Display for Discr<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.ty.sty {
             ty::Int(ity) => {
                 let bits = ty::tls::with(|tcx| {
@@ -846,7 +846,7 @@ fn is_type_structurally_recursive_inner<'a, 'tcx>(
         // To avoid a stack overflow when checking an enum variant or struct that
         // contains a different, structurally recursive type, maintain a stack
         // of seen types and check recursion for each of them (issues #3008, #3779).
-        let mut seen: Vec<Ty> = Vec::new();
+        let mut seen: Vec<Ty<'_>> = Vec::new();
         let mut representable_cache = FxHashMap();
         let r = is_type_structurally_recursive(
             tcx, sp, &mut seen, &mut representable_cache, self);
@@ -1039,7 +1039,7 @@ pub fn determine<P>(
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         is_copy_raw,
         is_sized_raw,
index f2593e4d4b5eeaa5aa0cf22b78cf6ba480f7840d..863b70c3df3f74dee5632c31ff4013c8e2abfe25 100644 (file)
@@ -16,7 +16,7 @@
 
 #[cold]
 #[inline(never)]
-pub fn bug_fmt(file: &'static str, line: u32, args: fmt::Arguments) -> ! {
+pub fn bug_fmt(file: &'static str, line: u32, args: fmt::Arguments<'_>) -> ! {
     // this wrapper mostly exists so I don't have to write a fully
     // qualified path of None::<Span> inside the bug!() macro definition
     opt_span_bug_fmt(file, line, None::<Span>, args);
@@ -28,7 +28,7 @@ pub fn span_bug_fmt<S: Into<MultiSpan>>(
     file: &'static str,
     line: u32,
     span: S,
-    args: fmt::Arguments,
+    args: fmt::Arguments<'_>,
 ) -> ! {
     opt_span_bug_fmt(file, line, Some(span), args);
 }
@@ -37,7 +37,7 @@ fn opt_span_bug_fmt<S: Into<MultiSpan>>(
     file: &'static str,
     line: u32,
     span: Option<S>,
-    args: fmt::Arguments,
+    args: fmt::Arguments<'_>,
 ) -> ! {
     tls::with_opt(move |tcx| {
         let msg = format!("{}:{}: {}", file, line, args);
index 02bdc5f41b35428e04287114043e94ce6ad0b5f5..bcc0b8047ef74f80f0a49272c8e0fcc71ea612a0 100644 (file)
 thread_local!(static TIME_DEPTH: Cell<usize> = Cell::new(0));
 
 lazy_static! {
-    static ref DEFAULT_HOOK: Box<dyn Fn(&panic::PanicInfo) + Sync + Send + 'static> = {
+    static ref DEFAULT_HOOK: Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static> = {
         let hook = panic::take_hook();
         panic::set_hook(Box::new(panic_hook));
         hook
     };
 }
 
-fn panic_hook(info: &panic::PanicInfo) {
+fn panic_hook(info: &panic::PanicInfo<'_>) {
     if !proc_macro::__internal::in_sess() {
         (*DEFAULT_HOOK)(info);
 
index 59dd90dbd329a8e8cb5277fde0123216d4f0c281..10382008e0d43a692e07501268bc91ba3017a3be 100644 (file)
@@ -46,7 +46,7 @@
 
 macro_rules! gen_display_debug_body {
     ( $with:path ) => {
-        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
             let mut cx = PrintContext::new();
             $with(self, f, &mut cx)
         }
@@ -225,9 +225,9 @@ fn print_debug_to_string(&self, cx: &mut PrintContext) -> String {
 impl PrintContext {
     fn fn_sig<F: fmt::Write>(&mut self,
                              f: &mut F,
-                             inputs: &[Ty],
+                             inputs: &[Ty<'_>],
                              variadic: bool,
-                             output: Ty)
+                             output: Ty<'_>)
                              -> fmt::Result {
         write!(f, "(")?;
         let mut inputs = inputs.iter();
@@ -250,9 +250,9 @@ fn fn_sig<F: fmt::Write>(&mut self,
 
     fn parameterized<F: fmt::Write>(&mut self,
                                     f: &mut F,
-                                    substs: &subst::Substs,
+                                    substs: &subst::Substs<'_>,
                                     mut did: DefId,
-                                    projections: &[ty::ProjectionPredicate])
+                                    projections: &[ty::ProjectionPredicate<'_>])
                                     -> fmt::Result {
         let key = ty::tls::with(|tcx| tcx.def_key(did));
         let mut item_name = if let Some(name) = key.disambiguated_data.data.get_opt_name() {
@@ -395,12 +395,12 @@ fn parameterized<F: fmt::Write>(&mut self,
         let print_regions = |f: &mut F, start: &str, skip, count| {
             // Don't print any regions if they're all erased.
             let regions = || substs.regions().skip(skip).take(count);
-            if regions().all(|r: ty::Region| *r == ty::ReErased) {
+            if regions().all(|r: ty::Region<'_>| *r == ty::ReErased) {
                 return Ok(());
             }
 
             for region in regions() {
-                let region: ty::Region = region;
+                let region: ty::Region<'_> = region;
                 start_or_continue(f, start, ", ")?;
                 if verbose {
                     write!(f, "{:?}", region)?;
@@ -564,9 +564,9 @@ pub fn identify_regions() -> bool {
 }
 
 pub fn parameterized<F: fmt::Write>(f: &mut F,
-                                    substs: &subst::Substs,
+                                    substs: &subst::Substs<'_>,
                                     did: DefId,
-                                    projections: &[ty::ProjectionPredicate])
+                                    projections: &[ty::ProjectionPredicate<'_>])
                                     -> fmt::Result {
     PrintContext::new().parameterized(f, substs, did, projections)
 }
@@ -646,7 +646,7 @@ fn print<F: fmt::Write>(&self, f: &mut F, cx: &mut PrintContext) -> fmt::Result
 }
 
 impl fmt::Debug for ty::GenericParamDef {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let type_name = match self.kind {
             ty::GenericParamDefKind::Lifetime => "Lifetime",
             ty::GenericParamDefKind::Type {..} => "Type",
@@ -660,7 +660,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::TraitDef {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ty::tls::with(|tcx| {
             write!(f, "{}", tcx.item_path_str(self.def_id))
         })
@@ -668,7 +668,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::AdtDef {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ty::tls::with(|tcx| {
             write!(f, "{}", tcx.item_path_str(self.did))
         })
@@ -676,7 +676,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for ty::ClosureUpvar<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "ClosureUpvar({:?},{:?})",
                self.def,
                self.ty)
@@ -684,7 +684,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::UpvarId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "UpvarId({:?};`{}`;{:?})",
                self.var_id,
                ty::tls::with(|tcx| tcx.hir.name(tcx.hir.hir_to_node_id(self.var_id))),
@@ -693,7 +693,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for ty::UpvarBorrow<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "UpvarBorrow({:?}, {:?})",
                self.kind, self.region)
     }
@@ -942,25 +942,25 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::TyVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "_#{}t", self.index)
     }
 }
 
 impl fmt::Debug for ty::IntVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "_#{}i", self.index)
     }
 }
 
 impl fmt::Debug for ty::FloatVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "_#{}f", self.index)
     }
 }
 
 impl fmt::Debug for ty::RegionVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         if let Some((region, counter)) = get_highlight_region_for_regionvid() {
             debug!("RegionVid.fmt: region={:?} self={:?} counter={:?}", region, self, counter);
             return if *self == region {
@@ -1006,7 +1006,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::IntVarValue {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             ty::IntType(ref v) => v.fmt(f),
             ty::UintType(ref v) => v.fmt(f),
@@ -1015,7 +1015,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::FloatVarValue {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         self.0.fmt(f)
     }
 }
@@ -1026,7 +1026,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     where T: fmt::Display + for<'a> ty::Lift<'a>,
           for<'a> <T as ty::Lift<'a>>::Lifted: fmt::Display + TypeFoldable<'a>
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ty::tls::with(|tcx| in_binder(f, tcx, self, tcx.lift(self)))
     }
 }*/
index 70760d35f7865c1f3e78d8b208f6990d37cb59d7..37073b6e82080a616db922205dc26b990e4d5310 100644 (file)
@@ -61,7 +61,7 @@ fn new() -> CategoryData {
                 }
             }
 
-            fn print(&self, lock: &mut StdoutLock) {
+            fn print(&self, lock: &mut StdoutLock<'_>) {
                 writeln!(lock, "| Phase            | Time (ms)      | Queries        | Hits (%) |")
                     .unwrap();
                 writeln!(lock, "| ---------------- | -------------- | -------------- | -------- |")
index 2a3404ee830343d10de823c8663c175394c9d7a6..a2017a4ed0ff93dc961f4a87e2560eb2af1d0a6d 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(rustc_private)]
 
 #[macro_use] extern crate log;
index d6e821d427d0580f45266e98cce22d40be793747..6ea722ba769c16181aac010ec8c025bd2eb9e5d2 100644 (file)
@@ -45,7 +45,7 @@
       html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![forbid(unsafe_code)]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(try_from)]
 // See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
 #[allow(unused_extern_crates)]
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..7b845e631ffa341d88db3950e9748e75558e063b 100644 (file)
@@ -10,7 +10,7 @@
 
 #![sanitizer_runtime]
 #![feature(alloc_system)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index 16da8c8a3b8bf6651dc41d8b70ef0f9b7cc8341d..049c4b2bd92d88a8252da9052033c2ea3968612f 100644 (file)
@@ -14,7 +14,7 @@
 
 #![allow(non_camel_case_types)]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(quote)]
 
 #![recursion_limit="256"]
index 9cb233122c3d086d105b6d73e51d7b9259ae1aaa..71d739222b60a1adf17a11084af8f11da282b219 100644 (file)
@@ -26,7 +26,7 @@
 #![feature(in_band_lifetimes)]
 #![allow(unused_attributes)]
 #![feature(libc)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(quote)]
 #![feature(range_contains)]
 #![feature(rustc_diagnostic_macros)]
index 6eec0b0b68c55a1893c8e989a88bba86b47aae2e..765708aeafd94f7e2f1c257a53fb3f0b17d4a754 100644 (file)
 
 use abi::{FnType, FnTypeExt};
 use common::*;
-use llvm;
 use rustc::hir;
 use rustc::ty::{self, Ty, TypeFoldable};
 use rustc::ty::layout::{self, Align, LayoutOf, Size, TyLayout};
-use rustc_target::spec::PanicStrategy;
 use rustc_target::abi::FloatTy;
 use rustc_mir::monomorphize::item::DefPathBasedNames;
 use type_::Type;
@@ -433,12 +431,19 @@ fn pointee_info_at<'a>(&self, cx: &CodegenCx<'a, 'tcx>, offset: Size)
                         PointerKind::Shared
                     },
                     hir::MutMutable => {
-                        // Only emit noalias annotations for LLVM >= 6 or in panic=abort
-                        // mode, as prior versions had many bugs in conjunction with
-                        // unwinding. See also issue #31681.
+                        // Previously we would only emit noalias annotations for LLVM >= 6 or in
+                        // panic=abort mode. That was deemed right, as prior versions had many bugs
+                        // in conjunction with unwinding, but later versions didn’t seem to have
+                        // said issues. See issue #31681.
+                        //
+                        // Alas, later on we encountered a case where noalias would generate wrong
+                        // code altogether even with recent versions of LLVM in *safe* code with no
+                        // unwinding involved. See #54462.
+                        //
+                        // For now, do not enable mutable_noalias by default at all, while the
+                        // issue is being figured out.
                         let mutable_noalias = cx.tcx.sess.opts.debugging_opts.mutable_noalias
-                            .unwrap_or(unsafe { llvm::LLVMRustVersionMajor() >= 6 }
-                                || cx.tcx.sess.panic_strategy() == PanicStrategy::Abort);
+                            .unwrap_or(false);
                         if mutable_noalias {
                             PointerKind::UniqueBorrowed
                         } else {
index 635819e94e8679bfed6b729350c25cb400ce79c9..03b3b20a4e772cd6467d4a00f45a44ce71c9a614 100644 (file)
@@ -19,7 +19,7 @@
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(custom_attribute)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![allow(unused_attributes)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
index 55dec45a0982471fbec041d2f11ec61102625b68..1fe70fa23b7a232684494e3385b418049702a7aa 100644 (file)
@@ -11,7 +11,7 @@
 // See Cargo.toml for a comment explaining this crate.
 #![allow(unused_extern_crates)]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 
 extern crate bitflags;
 extern crate log;
index 43ab38698062615005d81f381667c100c379a0fe..c592a5eb1e043d77c231eb5b6adf575d3150fed2 100644 (file)
@@ -27,8 +27,7 @@
 #![feature(unsize)]
 #![feature(specialization)]
 #![feature(optin_builtin_traits)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(allow_internal_unstable)]
 #![feature(vec_resize_with)]
 
index 27176a821b4affa6e50d8b0587cac045a1e14c1d..b97f5868079c4cd576581c88e62ee4fdbfb2b2e5 100644 (file)
@@ -20,7 +20,7 @@
 
 #![feature(box_syntax)]
 #![cfg_attr(unix, feature(libc))]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(option_replace)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
index 266aa3269816895dc8fbdf3c3fbc9f0983f2d4fc..12f1a43ed05338cd91420236df25cfd2df06b29d 100644 (file)
@@ -16,7 +16,7 @@
 #![allow(unused_attributes)]
 #![feature(range_contains)]
 #![cfg_attr(unix, feature(libc))]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(optin_builtin_traits)]
 
 extern crate atty;
index acdcf2b459e92efc99006e02a97e445be61aaf45..d0897a9618276fcdc2e07e36bc0a6f95d41adf76 100644 (file)
@@ -14,7 +14,7 @@
       html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
       html_root_url = "https://doc.rust-lang.org/nightly/")]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(specialization)]
 
 #![recursion_limit="256"]
index 9e0471f59fbab6548fa741fb4765ca68b20be392..98d4c87dc3b5e810159c8c271c07ecd36f77ad78 100644 (file)
@@ -26,8 +26,7 @@
 #![cfg_attr(test, feature(test))]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(macro_at_most_once_rep)]
index 387660473a887dea0a2524a4bdceefbd0b78b515..1c48d84473921b79c98689c83b73b524e171688b 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(static_nobundle)]
 
 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..7b845e631ffa341d88db3950e9748e75558e063b 100644 (file)
@@ -10,7 +10,7 @@
 
 #![sanitizer_runtime]
 #![feature(alloc_system)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index 09a8bea0941b618a20933ac77ec9a5a079fb1711..7008166b9035d7248c9f29997315a768c97e1a3a 100644 (file)
@@ -15,7 +15,7 @@
 #![feature(box_patterns)]
 #![feature(libc)]
 #![feature(macro_at_most_once_rep)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(proc_macro_internals)]
 #![feature(proc_macro_quote)]
 #![feature(quote)]
index acde4587d77dcad5a75cf0f79a1455850eaf96f4..942f19965bf375d75402e94541a29d57f3edc521 100644 (file)
@@ -70,6 +70,7 @@ pub(super) fn equate_inputs_and_outputs(
         if let Err(terr) = self.eq_opaque_type_and_type(
             mir_output_ty,
             normalized_output_ty,
+            self.mir_def_id,
             Locations::All(output_span),
             ConstraintCategory::BoringNoLocation,
         ) {
index 4c2ef58a3a78321d56ccddc942f42beebd9744d2..ef4cc3452b1ef9e1222f463e1cc019c085a82243 100644 (file)
@@ -901,6 +901,10 @@ fn sub_types(
         )
     }
 
+    /// Try to relate `sub <: sup`; if this fails, instantiate opaque
+    /// variables in `sub` with their inferred definitions and try
+    /// again. This is used for opaque types in places (e.g., `let x:
+    /// impl Foo = ..`).
     fn sub_types_or_anon(
         &mut self,
         sub: Ty<'tcx>,
@@ -910,7 +914,11 @@ fn sub_types_or_anon(
     ) -> Fallible<()> {
         if let Err(terr) = self.sub_types(sub, sup, locations, category) {
             if let TyKind::Opaque(..) = sup.sty {
-                return self.eq_opaque_type_and_type(sub, sup, locations, category);
+                // When you have `let x: impl Foo = ...` in a closure,
+                // the resulting inferend values are stored with the
+                // def-id of the base function.
+                let parent_def_id = self.tcx().closure_base_def_id(self.mir_def_id);
+                return self.eq_opaque_type_and_type(sub, sup, parent_def_id, locations, category);
             } else {
                 return Err(terr);
             }
@@ -958,13 +966,20 @@ fn eq_opaque_type_and_type(
         &mut self,
         revealed_ty: Ty<'tcx>,
         anon_ty: Ty<'tcx>,
+        anon_owner_def_id: DefId,
         locations: Locations,
         category: ConstraintCategory,
     ) -> Fallible<()> {
+        debug!(
+            "eq_opaque_type_and_type( \
+             revealed_ty={:?}, \
+             anon_ty={:?})",
+            revealed_ty, anon_ty
+        );
         let infcx = self.infcx;
         let tcx = infcx.tcx;
         let param_env = self.param_env;
-        let parent_def_id = infcx.tcx.closure_base_def_id(self.mir_def_id);
+        debug!("eq_opaque_type_and_type: mir_def_id={:?}", self.mir_def_id);
         let opaque_type_map = self.fully_perform_op(
             locations,
             category,
@@ -975,7 +990,7 @@ fn eq_opaque_type_and_type(
                     let dummy_body_id = ObligationCause::dummy().body_id;
                     let (output_ty, opaque_type_map) =
                         obligations.add(infcx.instantiate_opaque_types(
-                            parent_def_id,
+                            anon_owner_def_id,
                             dummy_body_id,
                             param_env,
                             &anon_ty,
@@ -996,8 +1011,10 @@ fn eq_opaque_type_and_type(
                         let opaque_defn_ty = opaque_defn_ty.subst(tcx, opaque_decl.substs);
                         let opaque_defn_ty = renumber::renumber_regions(infcx, &opaque_defn_ty);
                         debug!(
-                            "eq_opaque_type_and_type: concrete_ty={:?} opaque_defn_ty={:?}",
-                            opaque_decl.concrete_ty, opaque_defn_ty
+                            "eq_opaque_type_and_type: concrete_ty={:?}={:?} opaque_defn_ty={:?}",
+                            opaque_decl.concrete_ty,
+                            infcx.resolve_type_vars_if_possible(&opaque_decl.concrete_ty),
+                            opaque_defn_ty
                         );
                         obligations.add(infcx
                             .at(&ObligationCause::dummy(), param_env)
index a2d70bc05c1d49c9eb7ee18556a961a153fabdf1..b3ef9eab8017da0f444876def3ea5a1dada7bb6e 100644 (file)
 #![feature(core_intrinsics)]
 #![feature(const_fn)]
 #![feature(decl_macro)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(exhaustive_patterns)]
 #![feature(range_contains)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(rustc_attrs)]
-#![cfg_attr(stage0, feature(attr_literals))]
 #![feature(never_type)]
 #![feature(specialization)]
 #![feature(try_trait)]
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..7b845e631ffa341d88db3950e9748e75558e063b 100644 (file)
@@ -10,7 +10,7 @@
 
 #![sanitizer_runtime]
 #![feature(alloc_system)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index d62cb00923f7047411ff3a17d5da3886d33d6ea9..42ead92783d7af2a424e713bdf92df85fc7510c5 100644 (file)
@@ -18,7 +18,7 @@
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(rustc_diagnostic_macros)]
 
 #[macro_use]
index fa7008be73a0797d7a4570886396af6b3a0db7d9..ca2628078178ba04857c16a3a7afc9a96809c444 100644 (file)
@@ -10,7 +10,7 @@
 
 #![allow(nonstandard_style)]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 
 pub struct Intrinsic {
     pub inputs: &'static [&'static Type],
index 67f53a67313f798f1f9d2979d9f57e0a949095af..2cc3f1efcb5f40b0a57b3d3b2cc95f87cec47ed0 100644 (file)
@@ -64,7 +64,7 @@
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(rustc_diagnostic_macros)]
 
 #[macro_use] extern crate syntax;
index 1fe370b44c5bcf33cbb4ac52254b50eb78a6be8a..60679d6d4304eb508c231fe69bf3b98ccddc9ec6 100644 (file)
@@ -12,7 +12,7 @@
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(rustc_diagnostic_macros)]
 
 #![recursion_limit="256"]
index 5e3f7470099117c806abfd11e5eba77ee59fe066..a68c89deea5b6a070c7be0e57c6f8cf9117ecc47 100644 (file)
@@ -13,7 +13,7 @@
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
 #![feature(crate_visibility_modifier)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(slice_sort_by_cached_key)]
 
index f6045c7b2d2df2b1123406a40153d5e544cdd0c3..1148daef8e39120f9b684c262e86ab7596815c56 100644 (file)
@@ -12,7 +12,7 @@
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(custom_attribute)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![allow(unused_attributes)]
 
 #![recursion_limit="256"]
index c198b19ce616075e3cc55b88973ee1263478363f..93d61b80847ecb876a10191d554f6f4503a9ac02 100644 (file)
@@ -22,9 +22,8 @@
       html_root_url = "https://doc.rust-lang.org/nightly/")]
 
 #![feature(box_syntax)]
-#![cfg_attr(stage0, feature(const_fn))]
-#![cfg_attr(not(stage0), feature(min_const_fn))]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(min_const_fn)]
+#![feature(nll)]
 #![feature(slice_patterns)]
 
 #[macro_use]
index a6618efebb31017bf933de30bace186678c546e4..733804fb9b052c50a908969c3042c76498ae5aa7 100644 (file)
 //! New recursive solver modeled on Chalk's recursive solver. Most of
 //! the guts are broken up into modules; see the comments in those modules.
 
-#![cfg_attr(stage0, feature(crate_in_paths))]
 #![feature(crate_visibility_modifier)]
-#![cfg_attr(stage0, feature(extern_prelude))]
 #![feature(in_band_lifetimes)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 
 #![recursion_limit="256"]
 
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..7b845e631ffa341d88db3950e9748e75558e063b 100644 (file)
@@ -10,7 +10,7 @@
 
 #![sanitizer_runtime]
 #![feature(alloc_system)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index 057a586e9ac98a3f4ec9b8529a0524d212ea5edc..00c6ebafec0d5b4132438f076878396dac8ba32e 100644 (file)
@@ -147,7 +147,7 @@ pub fn ast_region_to_region(&self,
                     bound_region: ty::BrNamed(id, name)
                 }))
 
-                    // (*) -- not late-bound, won't change
+                // (*) -- not late-bound, won't change
             }
 
             None => {
@@ -167,8 +167,8 @@ pub fn ast_region_to_region(&self,
         };
 
         debug!("ast_region_to_region(lifetime={:?}) yields {:?}",
-                lifetime,
-                r);
+               lifetime,
+               r);
 
         r
     }
@@ -218,7 +218,7 @@ fn check_impl_trait(
                 span,
                 E0632,
                 "cannot provide explicit type parameters when `impl Trait` is \
-                used in argument position."
+                 used in argument position."
             };
 
             err.emit();
@@ -538,7 +538,7 @@ fn create_substs_for_ast_path(&self,
         // region with the current anon region binding (in other words,
         // whatever & would get replaced with).
         debug!("create_substs_for_ast_path(def_id={:?}, self_ty={:?}, \
-               generic_args={:?})",
+                generic_args={:?})",
                def_id, self_ty, generic_args);
 
         let tcx = self.tcx();
@@ -609,7 +609,7 @@ fn create_substs_for_ast_path(&self,
                             if default_needs_object_self(param) {
                                 struct_span_err!(tcx.sess, span, E0393,
                                                     "the type parameter `{}` must be explicitly \
-                                                    specified",
+                                                     specified",
                                                     param.name)
                                     .span_label(span,
                                                 format!("missing reference to `{}`", param.name))
@@ -623,7 +623,7 @@ fn create_substs_for_ast_path(&self,
                                 self.normalize_ty(
                                     span,
                                     tcx.at(span).type_of(param.def_id)
-                                        .subst_spanned(tcx, substs.unwrap(), Some(span))
+                                       .subst_spanned(tcx, substs.unwrap(), Some(span))
                                 ).into()
                             }
                         } else if infer_types {
@@ -851,7 +851,7 @@ fn ast_type_binding_to_poly_projection_predicate(
                                 binding.span,
                                 E0582,
                                 "binding for associated type `{}` references lifetime `{}`, \
-                                which does not appear in the trait input types",
+                                 which does not appear in the trait input types",
                                 binding.item_name, br_name)
                     .emit();
             }
@@ -891,7 +891,7 @@ fn ast_type_binding_to_poly_projection_predicate(
                         ref_id,
                         binding.span,
                         &format!("associated type binding `{}` specified more than once",
-                                binding.item_name)
+                                 binding.item_name)
                     );
                     err.span_label(binding.span, "used more than once");
                     err.span_label(*prev_span, format!("first use of `{}`", binding.item_name));
@@ -994,7 +994,7 @@ fn conv_object_ty_poly_trait_ref(&self,
         if !object_safety_violations.is_empty() {
             tcx.report_object_safety_error(
                 span, principal.def_id(), object_safety_violations)
-                .emit();
+               .emit();
             return tcx.types.err;
         }
 
@@ -1014,13 +1014,13 @@ fn conv_object_ty_poly_trait_ref(&self,
         for item_def_id in associated_types {
             let assoc_item = tcx.associated_item(item_def_id);
             let trait_def_id = assoc_item.container.id();
-            struct_span_err!(tcx.sess, span, E0191,
-                "the value of the associated type `{}` (from the trait `{}`) must be specified",
-                        assoc_item.ident,
-                        tcx.item_path_str(trait_def_id))
-                        .span_label(span, format!(
-                            "missing associated type `{}` value", assoc_item.ident))
-                        .emit();
+            struct_span_err!(tcx.sess, span, E0191, "the value of the associated type `{}` \
+                                                     (from the trait `{}`) must be specified",
+                                                    assoc_item.ident,
+                                                    tcx.item_path_str(trait_def_id))
+                .span_label(span, format!("missing associated type `{}` value",
+                                          assoc_item.ident))
+                .emit();
         }
 
         // Dedup auto traits so that `dyn Trait + Send + Send` is the same as `dyn Trait + Send`.
@@ -1032,12 +1032,11 @@ fn conv_object_ty_poly_trait_ref(&self,
             iter::once(ty::ExistentialPredicate::Trait(*existential_principal.skip_binder()))
             .chain(auto_traits.into_iter().map(ty::ExistentialPredicate::AutoTrait))
             .chain(existential_projections
-                   .map(|x| ty::ExistentialPredicate::Projection(*x.skip_binder())))
+                .map(|x| ty::ExistentialPredicate::Projection(*x.skip_binder())))
             .collect::<SmallVec<[_; 8]>>();
         v.sort_by(|a, b| a.stable_cmp(tcx, b));
         let existential_predicates = ty::Binder::bind(tcx.mk_existential_predicates(v.into_iter()));
 
-
         // Explicitly specified region bound. Use that.
         let region_bound = if !lifetime.is_elided() {
             self.ast_region_to_region(lifetime, None)
@@ -1072,7 +1071,7 @@ fn report_ambiguous_associated_type(&self,
         struct_span_err!(self.tcx().sess, span, E0223, "ambiguous associated type")
             .span_label(span, "ambiguous associated type")
             .note(&format!("specify the type using the syntax `<{} as {}>::{}`",
-                  type_str, trait_str, name))
+                           type_str, trait_str, name))
             .emit();
 
     }
@@ -1094,8 +1093,7 @@ fn find_bound_for_assoc_item(&self,
 
         // Check that there is exactly one way to find an associated type with the
         // correct name.
-        let suitable_bounds =
-            traits::transitive_bounds(tcx, &bounds)
+        let suitable_bounds = traits::transitive_bounds(tcx, &bounds)
             .filter(|b| self.trait_defines_associated_type_named(b.def_id(), assoc_name));
 
         let param_node_id = tcx.hir.as_local_node_id(ty_param_def_id).unwrap();
@@ -1110,10 +1108,10 @@ fn find_bound_for_assoc_item(&self,
     // Checks that bounds contains exactly one element and reports appropriate
     // errors otherwise.
     fn one_bound_for_assoc_type<I>(&self,
-                                mut bounds: I,
-                                ty_param_name: &str,
-                                assoc_name: ast::Ident,
-                                span: Span)
+                                   mut bounds: I,
+                                   ty_param_name: &str,
+                                   assoc_name: ast::Ident,
+                                   span: Span)
         -> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
         where I: Iterator<Item=ty::PolyTraitRef<'tcx>>
     {
@@ -1121,9 +1119,9 @@ fn one_bound_for_assoc_type<I>(&self,
             Some(bound) => bound,
             None => {
                 struct_span_err!(self.tcx().sess, span, E0220,
-                          "associated type `{}` not found for `{}`",
-                          assoc_name,
-                          ty_param_name)
+                                 "associated type `{}` not found for `{}`",
+                                 assoc_name,
+                                 ty_param_name)
                   .span_label(span, format!("associated type `{}` not found", assoc_name))
                   .emit();
                 return Err(ErrorReported);
@@ -1142,14 +1140,14 @@ fn one_bound_for_assoc_type<I>(&self,
             for bound in bounds {
                 let bound_span = self.tcx().associated_items(bound.def_id()).find(|item| {
                     item.kind == ty::AssociatedKind::Type &&
-                    self.tcx().hygienic_eq(assoc_name, item.ident, bound.def_id())
+                        self.tcx().hygienic_eq(assoc_name, item.ident, bound.def_id())
                 })
                 .and_then(|item| self.tcx().hir.span_if_local(item.def_id));
 
                 if let Some(span) = bound_span {
                     err.span_label(span, format!("ambiguous `{}` from `{}`",
-                                                  assoc_name,
-                                                  bound));
+                                                 assoc_name,
+                                                 bound));
                 } else {
                     span_note!(&mut err, span,
                                "associated type `{}` could derive from `{}`",
@@ -1198,8 +1196,7 @@ pub fn associated_path_def_to_ty(&self,
                     }
                 };
 
-                let candidates =
-                    traits::supertraits(tcx, ty::Binder::bind(trait_ref))
+                let candidates = traits::supertraits(tcx, ty::Binder::bind(trait_ref))
                     .filter(|r| self.trait_defines_associated_type_named(r.def_id(), assoc_name));
 
                 match self.one_bound_for_assoc_type(candidates, "Self", assoc_name, span) {
@@ -1230,7 +1227,7 @@ pub fn associated_path_def_to_ty(&self,
         let (assoc_ident, def_scope) = tcx.adjust_ident(assoc_name, trait_did, ref_id);
         let item = tcx.associated_items(trait_did).find(|i| {
             Namespace::from(i.kind) == Namespace::Type &&
-            i.ident.modern() == assoc_ident
+                i.ident.modern() == assoc_ident
         })
         .expect("missing associated type");
 
@@ -1293,8 +1290,7 @@ pub fn prohibit_generics<'a, T: IntoIterator<Item = &'a hir::PathSegment>>(&self
                             if err_for_lt { continue }
                             err_for_lt = true;
                             (struct_span_err!(self.tcx().sess, lt.span, E0110,
-                                            "lifetime parameters are not allowed on \
-                                                this type"),
+                                              "lifetime parameters are not allowed on this type"),
                              lt.span,
                              "lifetime")
                         }
@@ -1302,7 +1298,7 @@ pub fn prohibit_generics<'a, T: IntoIterator<Item = &'a hir::PathSegment>>(&self
                             if err_for_ty { continue }
                             err_for_ty = true;
                             (struct_span_err!(self.tcx().sess, ty.span, E0109,
-                                            "type parameters are not allowed on this type"),
+                                              "type parameters are not allowed on this type"),
                              ty.span,
                              "type")
                         }
@@ -1590,7 +1586,7 @@ pub fn ty_of_fn(&self,
         ));
 
         // Find any late-bound regions declared in return type that do
-        // not appear in the arguments. These are not wellformed.
+        // not appear in the arguments. These are not well-formed.
         //
         // Example:
         //     for<'a> fn() -> &'a str <-- 'a is bad
index 5967bd1ba3eea9dcd93cf23e930083c642aa6198..d9dee917b01e47446f63277ba6257ce30a9cc2f8 100644 (file)
@@ -75,7 +75,7 @@ fn check_import(&self, id: ast::NodeId, span: Span) {
         let msg = if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) {
             format!("unused import: `{}`", snippet)
         } else {
-            "unused import".to_string()
+            "unused import".to_owned()
         };
         self.tcx.lint_node(lint::builtin::UNUSED_IMPORTS, id, span, &msg);
     }
index db08bf80953523d79a0504da27649097877c43d0..c54d9e4b47578e205484d37f482a907f5f01a939 100644 (file)
@@ -55,33 +55,29 @@ fn check<F>(&self, trait_def_id: Option<DefId>, mut f: F) -> &Self
 }
 
 fn visit_implementation_of_drop<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did: DefId) {
-    match tcx.type_of(impl_did).sty {
-        ty::Adt(..) => {}
-        _ => {
-            // Destructors only work on nominal types.
-            if let Some(impl_node_id) = tcx.hir.as_local_node_id(impl_did) {
-                match tcx.hir.find(impl_node_id) {
-                    Some(Node::Item(item)) => {
-                        let span = match item.node {
-                            ItemKind::Impl(.., ref ty, _) => ty.span,
-                            _ => item.span,
-                        };
-                        struct_span_err!(tcx.sess,
-                                         span,
-                                         E0120,
-                                         "the Drop trait may only be implemented on \
-                                         structures")
-                            .span_label(span, "implementing Drop requires a struct")
-                            .emit();
-                    }
-                    _ => {
-                        bug!("didn't find impl in ast map");
-                    }
-                }
+    if let ty::Adt(..) = tcx.type_of(impl_did).sty {
+        /* do nothing */
+    } else {
+        // Destructors only work on nominal types.
+        if let Some(impl_node_id) = tcx.hir.as_local_node_id(impl_did) {
+            if let Some(Node::Item(item)) = tcx.hir.find(impl_node_id) {
+                let span = match item.node {
+                    ItemKind::Impl(.., ref ty, _) => ty.span,
+                    _ => item.span,
+                };
+                struct_span_err!(tcx.sess,
+                                 span,
+                                 E0120,
+                                 "the Drop trait may only be implemented on \
+                                  structures")
+                    .span_label(span, "implementing Drop requires a struct")
+                    .emit();
             } else {
-                bug!("found external impl of Drop trait on \
-                      something other than a struct");
+                bug!("didn't find impl in ast map");
             }
+        } else {
+            bug!("found external impl of Drop trait on \
+                  something other than a struct");
         }
     }
 }
@@ -92,8 +88,7 @@ fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did:
     let impl_node_id = if let Some(n) = tcx.hir.as_local_node_id(impl_did) {
         n
     } else {
-        debug!("visit_implementation_of_copy(): impl not in this \
-                crate");
+        debug!("visit_implementation_of_copy(): impl not in this crate");
         return;
     };
 
@@ -119,11 +114,11 @@ fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, impl_did:
             };
 
             let mut err = struct_span_err!(tcx.sess,
-                                          span,
-                                          E0204,
-                                          "the trait `Copy` may not be implemented for this type");
+                                           span,
+                                           E0204,
+                                           "the trait `Copy` may not be implemented for this type");
             for span in fields.iter().map(|f| tcx.def_span(f.did)) {
-                    err.span_label(span, "this field does not implement `Copy`");
+                err.span_label(span, "this field does not implement `Copy`");
             }
             err.emit()
         }
@@ -173,12 +168,9 @@ pub fn coerce_unsized_info<'a, 'gcx>(gcx: TyCtxt<'a, 'gcx, 'gcx>,
     debug!("compute_coerce_unsized_info(impl_did={:?})", impl_did);
     let coerce_unsized_trait = gcx.lang_items().coerce_unsized_trait().unwrap();
 
-    let unsize_trait = match gcx.lang_items().require(UnsizeTraitLangItem) {
-        Ok(id) => id,
-        Err(err) => {
-            gcx.sess.fatal(&format!("`CoerceUnsized` implementation {}", err));
-        }
-    };
+    let unsize_trait = gcx.lang_items().require(UnsizeTraitLangItem).unwrap_or_else(|err| {
+        gcx.sess.fatal(&format!("`CoerceUnsized` implementation {}", err));
+    });
 
     // this provider should only get invoked for local def-ids
     let impl_node_id = gcx.hir.as_local_node_id(impl_did).unwrap_or_else(|| {
@@ -210,9 +202,9 @@ pub fn coerce_unsized_info<'a, 'gcx>(gcx: TyCtxt<'a, 'gcx, 'gcx>,
                            mk_ptr: &dyn Fn(Ty<'gcx>) -> Ty<'gcx>| {
             if (mt_a.mutbl, mt_b.mutbl) == (hir::MutImmutable, hir::MutMutable) {
                 infcx.report_mismatched_types(&cause,
-                                             mk_ptr(mt_b.ty),
-                                             target,
-                                             ty::error::TypeError::Mutability)
+                                              mk_ptr(mt_b.ty),
+                                              target,
+                                              ty::error::TypeError::Mutability)
                     .emit();
             }
             (mt_a.ty, mt_b.ty, unsize_trait, None)
@@ -235,7 +227,7 @@ pub fn coerce_unsized_info<'a, 'gcx>(gcx: TyCtxt<'a, 'gcx, 'gcx>,
             }
 
             (&ty::Adt(def_a, substs_a), &ty::Adt(def_b, substs_b)) if def_a.is_struct() &&
-                                                                          def_b.is_struct() => {
+                                                                      def_b.is_struct() => {
                 if def_a != def_b {
                     let source_path = gcx.item_path_str(def_a.did);
                     let target_path = gcx.item_path_str(def_b.did);
index 52e37b8d0ce11fc9b8ace90f4d6d6ef1102db6c0..1955a709dbfe5ef36c37108edbaefa3df8e73c1e 100644 (file)
@@ -315,8 +315,7 @@ fn check_def_id(&mut self, item: &hir::Item, def_id: DefId) {
                              E0116,
                              "cannot define inherent `impl` for a type outside of the crate \
                               where the type is defined")
-                .span_label(item.span,
-                            "impl for type defined outside of crate.")
+                .span_label(item.span, "impl for type defined outside of crate.")
                 .note("define and implement a trait or new type instead")
                 .emit();
         }
index ecb7a8ea8b62ed4066c50c58ae369f7d017ab2e1..616ca97a7a75d99e751f000aef43cd8030159b9c 100644 (file)
@@ -36,8 +36,8 @@ fn check_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, node_id: ast::NodeId) {
 
     if let Some(trait_ref) = tcx.impl_trait_ref(impl_def_id) {
         debug!("(checking implementation) adding impl for trait '{:?}', item '{}'",
-                trait_ref,
-                tcx.item_path_str(impl_def_id));
+               trait_ref,
+               tcx.item_path_str(impl_def_id));
 
         // Skip impls where one of the self type is an error type.
         // This occurs with e.g. resolve failures (#30589).
index f9b89488232d26e5b098b7efffa7bdd1a4faa041..b155587dddc419f284fcda6978e89a0201c98f98 100644 (file)
@@ -33,131 +33,126 @@ impl<'cx, 'tcx, 'v> ItemLikeVisitor<'v> for OrphanChecker<'cx, 'tcx> {
     /// reports.
     fn visit_item(&mut self, item: &hir::Item) {
         let def_id = self.tcx.hir.local_def_id(item.id);
-        match item.node {
-            hir::ItemKind::Impl(.., Some(_), _, _) => {
-                // "Trait" impl
-                debug!("coherence2::orphan check: trait impl {}",
-                       self.tcx.hir.node_to_string(item.id));
-                let trait_ref = self.tcx.impl_trait_ref(def_id).unwrap();
-                let trait_def_id = trait_ref.def_id;
-                let cm = self.tcx.sess.source_map();
-                let sp = cm.def_span(item.span);
-                match traits::orphan_check(self.tcx, def_id) {
-                    Ok(()) => {}
-                    Err(traits::OrphanCheckErr::NoLocalInputType) => {
-                        struct_span_err!(self.tcx.sess,
-                                         sp,
-                                         E0117,
-                                         "only traits defined in the current crate can be \
-                                          implemented for arbitrary types")
-                            .span_label(sp, "impl doesn't use types inside crate")
-                            .note("the impl does not reference any types defined in this crate")
-                            .note("define and implement a trait or new type instead")
-                            .emit();
-                        return;
-                    }
-                    Err(traits::OrphanCheckErr::UncoveredTy(param_ty)) => {
-                        struct_span_err!(self.tcx.sess,
-                                         sp,
-                                         E0210,
-                                         "type parameter `{}` must be used as the type parameter \
-                                          for some local type (e.g. `MyStruct<{}>`)",
-                                         param_ty,
-                                         param_ty)
-                            .span_label(sp,
-                                        format!("type parameter `{}` must be used as the type \
-                                                 parameter for some local type", param_ty))
-                            .note("only traits defined in the current crate can be implemented \
-                                   for a type parameter")
-                            .emit();
-                        return;
-                    }
+        // "Trait" impl
+        if let hir::ItemKind::Impl(.., Some(_), _, _) = item.node {
+            debug!("coherence2::orphan check: trait impl {}",
+                   self.tcx.hir.node_to_string(item.id));
+            let trait_ref = self.tcx.impl_trait_ref(def_id).unwrap();
+            let trait_def_id = trait_ref.def_id;
+            let cm = self.tcx.sess.source_map();
+            let sp = cm.def_span(item.span);
+            match traits::orphan_check(self.tcx, def_id) {
+                Ok(()) => {}
+                Err(traits::OrphanCheckErr::NoLocalInputType) => {
+                    struct_span_err!(self.tcx.sess,
+                                     sp,
+                                     E0117,
+                                     "only traits defined in the current crate can be \
+                                      implemented for arbitrary types")
+                        .span_label(sp, "impl doesn't use types inside crate")
+                        .note("the impl does not reference any types defined in this crate")
+                        .note("define and implement a trait or new type instead")
+                        .emit();
+                    return;
+                }
+                Err(traits::OrphanCheckErr::UncoveredTy(param_ty)) => {
+                    struct_span_err!(self.tcx.sess,
+                                     sp,
+                                     E0210,
+                                     "type parameter `{}` must be used as the type parameter \
+                                      for some local type (e.g. `MyStruct<{}>`)",
+                                     param_ty,
+                                     param_ty)
+                        .span_label(sp,
+                                    format!("type parameter `{}` must be used as the type \
+                                             parameter for some local type", param_ty))
+                        .note("only traits defined in the current crate can be implemented \
+                               for a type parameter")
+                        .emit();
+                    return;
                 }
+            }
 
-                // In addition to the above rules, we restrict impls of auto traits
-                // so that they can only be implemented on nominal types, such as structs,
-                // enums or foreign types. To see why this restriction exists, consider the
-                // following example (#22978). Imagine that crate A defines an auto trait
-                // `Foo` and a fn that operates on pairs of types:
-                //
-                // ```
-                // // Crate A
-                // auto trait Foo { }
-                // fn two_foos<A:Foo,B:Foo>(..) {
-                //     one_foo::<(A,B)>(..)
-                // }
-                // fn one_foo<T:Foo>(..) { .. }
-                // ```
-                //
-                // This type-checks fine; in particular the fn
-                // `two_foos` is able to conclude that `(A,B):Foo`
-                // because `A:Foo` and `B:Foo`.
-                //
-                // Now imagine that crate B comes along and does the following:
-                //
-                // ```
-                // struct A { }
-                // struct B { }
-                // impl Foo for A { }
-                // impl Foo for B { }
-                // impl !Send for (A, B) { }
-                // ```
-                //
-                // This final impl is legal according to the orpan
-                // rules, but it invalidates the reasoning from
-                // `two_foos` above.
-                debug!("trait_ref={:?} trait_def_id={:?} trait_is_auto={}",
-                       trait_ref,
-                       trait_def_id,
-                       self.tcx.trait_is_auto(trait_def_id));
-                if self.tcx.trait_is_auto(trait_def_id) &&
-                   !trait_def_id.is_local() {
-                    let self_ty = trait_ref.self_ty();
-                    let opt_self_def_id = match self_ty.sty {
-                        ty::Adt(self_def, _) => Some(self_def.did),
-                        ty::Foreign(did) => Some(did),
-                        _ => None,
-                    };
+            // In addition to the above rules, we restrict impls of auto traits
+            // so that they can only be implemented on nominal types, such as structs,
+            // enums or foreign types. To see why this restriction exists, consider the
+            // following example (#22978). Imagine that crate A defines an auto trait
+            // `Foo` and a fn that operates on pairs of types:
+            //
+            // ```
+            // // Crate A
+            // auto trait Foo { }
+            // fn two_foos<A:Foo,B:Foo>(..) {
+            //     one_foo::<(A,B)>(..)
+            // }
+            // fn one_foo<T:Foo>(..) { .. }
+            // ```
+            //
+            // This type-checks fine; in particular the fn
+            // `two_foos` is able to conclude that `(A,B):Foo`
+            // because `A:Foo` and `B:Foo`.
+            //
+            // Now imagine that crate B comes along and does the following:
+            //
+            // ```
+            // struct A { }
+            // struct B { }
+            // impl Foo for A { }
+            // impl Foo for B { }
+            // impl !Send for (A, B) { }
+            // ```
+            //
+            // This final impl is legal according to the orpan
+            // rules, but it invalidates the reasoning from
+            // `two_foos` above.
+            debug!("trait_ref={:?} trait_def_id={:?} trait_is_auto={}",
+                   trait_ref,
+                   trait_def_id,
+                   self.tcx.trait_is_auto(trait_def_id));
+            if self.tcx.trait_is_auto(trait_def_id) &&
+               !trait_def_id.is_local() {
+                let self_ty = trait_ref.self_ty();
+                let opt_self_def_id = match self_ty.sty {
+                    ty::Adt(self_def, _) => Some(self_def.did),
+                    ty::Foreign(did) => Some(did),
+                    _ => None,
+                };
 
-                    let msg = match opt_self_def_id {
-                        // We only want to permit nominal types, but not *all* nominal types.
-                        // They must be local to the current crate, so that people
-                        // can't do `unsafe impl Send for Rc<SomethingLocal>` or
-                        // `impl !Send for Box<SomethingLocalAndSend>`.
-                        Some(self_def_id) => {
-                            if self_def_id.is_local() {
-                                None
-                            } else {
-                                Some((
-                                    format!("cross-crate traits with a default impl, like `{}`, \
-                                             can only be implemented for a struct/enum type \
-                                             defined in the current crate",
-                                            self.tcx.item_path_str(trait_def_id)),
-                                    "can't implement cross-crate trait for type in another crate"
-                                ))
-                            }
-                        }
-                        _ => {
-                            Some((format!("cross-crate traits with a default impl, like `{}`, can \
-                                           only be implemented for a struct/enum type, not `{}`",
-                                          self.tcx.item_path_str(trait_def_id),
-                                          self_ty),
-                                  "can't implement cross-crate trait with a default impl for \
-                                   non-struct/enum type"))
+                let msg = match opt_self_def_id {
+                    // We only want to permit nominal types, but not *all* nominal types.
+                    // They must be local to the current crate, so that people
+                    // can't do `unsafe impl Send for Rc<SomethingLocal>` or
+                    // `impl !Send for Box<SomethingLocalAndSend>`.
+                    Some(self_def_id) => {
+                        if self_def_id.is_local() {
+                            None
+                        } else {
+                            Some((
+                                format!("cross-crate traits with a default impl, like `{}`, \
+                                         can only be implemented for a struct/enum type \
+                                         defined in the current crate",
+                                        self.tcx.item_path_str(trait_def_id)),
+                                "can't implement cross-crate trait for type in another crate"
+                            ))
                         }
-                    };
-
-                    if let Some((msg, label)) = msg {
-                        struct_span_err!(self.tcx.sess, sp, E0321, "{}", msg)
-                            .span_label(sp, label)
-                            .emit();
-                        return;
                     }
+                    _ => {
+                        Some((format!("cross-crate traits with a default impl, like `{}`, can \
+                                       only be implemented for a struct/enum type, not `{}`",
+                                      self.tcx.item_path_str(trait_def_id),
+                                      self_ty),
+                              "can't implement cross-crate trait with a default impl for \
+                               non-struct/enum type"))
+                    }
+                };
+
+                if let Some((msg, label)) = msg {
+                    struct_span_err!(self.tcx.sess, sp, E0321, "{}", msg)
+                        .span_label(sp, label)
+                        .emit();
+                    return;
                 }
             }
-            _ => {
-                // Not an impl
-            }
         }
     }
 
index 9e19854a571fcba1dab34f98f7ed5e60b550fe24..bdbf93ddec286c2506b7d2ce91b703f4fd8a31a5 100644 (file)
@@ -29,52 +29,49 @@ fn check_unsafety_coherence(&mut self,
                                 item: &'v hir::Item,
                                 impl_generics: Option<&hir::Generics>,
                                 unsafety: hir::Unsafety,
-                                polarity: hir::ImplPolarity) {
-        match self.tcx.impl_trait_ref(self.tcx.hir.local_def_id(item.id)) {
-            None => {}
-
-            Some(trait_ref) => {
-                let trait_def = self.tcx.trait_def(trait_ref.def_id);
-                let unsafe_attr = impl_generics.and_then(|generics| {
-                    generics.params.iter().find(|p| p.pure_wrt_drop).map(|_| "may_dangle")
-                });
-                match (trait_def.unsafety, unsafe_attr, unsafety, polarity) {
-                    (Unsafety::Normal, None, Unsafety::Unsafe, hir::ImplPolarity::Positive) => {
-                        span_err!(self.tcx.sess,
-                                  item.span,
-                                  E0199,
-                                  "implementing the trait `{}` is not unsafe",
-                                  trait_ref);
-                    }
+                                polarity: hir::ImplPolarity)
+    {
+        if let Some(trait_ref) = self.tcx.impl_trait_ref(self.tcx.hir.local_def_id(item.id)) {
+            let trait_def = self.tcx.trait_def(trait_ref.def_id);
+            let unsafe_attr = impl_generics.and_then(|generics| {
+                generics.params.iter().find(|p| p.pure_wrt_drop).map(|_| "may_dangle")
+            });
+            match (trait_def.unsafety, unsafe_attr, unsafety, polarity) {
+                (Unsafety::Normal, None, Unsafety::Unsafe, hir::ImplPolarity::Positive) => {
+                    span_err!(self.tcx.sess,
+                              item.span,
+                              E0199,
+                              "implementing the trait `{}` is not unsafe",
+                              trait_ref);
+                }
 
-                    (Unsafety::Unsafe, _, Unsafety::Normal, hir::ImplPolarity::Positive) => {
-                        span_err!(self.tcx.sess,
-                                  item.span,
-                                  E0200,
-                                  "the trait `{}` requires an `unsafe impl` declaration",
-                                  trait_ref);
-                    }
+                (Unsafety::Unsafe, _, Unsafety::Normal, hir::ImplPolarity::Positive) => {
+                    span_err!(self.tcx.sess,
+                              item.span,
+                              E0200,
+                              "the trait `{}` requires an `unsafe impl` declaration",
+                              trait_ref);
+                }
 
-                    (Unsafety::Normal, Some(attr_name), Unsafety::Normal,
-                        hir::ImplPolarity::Positive) =>
-                    {
-                        span_err!(self.tcx.sess,
-                                  item.span,
-                                  E0569,
-                                  "requires an `unsafe impl` declaration due to `#[{}]` attribute",
-                                  attr_name);
-                    }
+                (Unsafety::Normal, Some(attr_name), Unsafety::Normal,
+                    hir::ImplPolarity::Positive) =>
+                {
+                    span_err!(self.tcx.sess,
+                              item.span,
+                              E0569,
+                              "requires an `unsafe impl` declaration due to `#[{}]` attribute",
+                              attr_name);
+                }
 
-                    (_, _, Unsafety::Unsafe, hir::ImplPolarity::Negative) => {
-                        // Reported in AST validation
-                        self.tcx.sess.delay_span_bug(item.span, "unsafe negative impl");
-                    }
-                    (_, _, Unsafety::Normal, hir::ImplPolarity::Negative) |
-                    (Unsafety::Unsafe, _, Unsafety::Unsafe, hir::ImplPolarity::Positive) |
-                    (Unsafety::Normal, Some(_), Unsafety::Unsafe, hir::ImplPolarity::Positive) |
-                    (Unsafety::Normal, None, Unsafety::Normal, _) => {
-                        // OK
-                    }
+                (_, _, Unsafety::Unsafe, hir::ImplPolarity::Negative) => {
+                    // Reported in AST validation
+                    self.tcx.sess.delay_span_bug(item.span, "unsafe negative impl");
+                }
+                (_, _, Unsafety::Normal, hir::ImplPolarity::Negative) |
+                (Unsafety::Unsafe, _, Unsafety::Unsafe, hir::ImplPolarity::Positive) |
+                (Unsafety::Normal, Some(_), Unsafety::Unsafe, hir::ImplPolarity::Positive) |
+                (Unsafety::Normal, None, Unsafety::Normal, _) => {
+                    // OK
                 }
             }
         }
@@ -83,11 +80,8 @@ fn check_unsafety_coherence(&mut self,
 
 impl<'cx, 'tcx, 'v> ItemLikeVisitor<'v> for UnsafetyChecker<'cx, 'tcx> {
     fn visit_item(&mut self, item: &'v hir::Item) {
-        match item.node {
-            hir::ItemKind::Impl(unsafety, polarity, _, ref generics, ..) => {
-                self.check_unsafety_coherence(item, Some(generics), unsafety, polarity);
-            }
-            _ => {}
+        if let hir::ItemKind::Impl(unsafety, polarity, _, ref generics, ..) = item.node {
+            self.check_unsafety_coherence(item, Some(generics), unsafety, polarity);
         }
     }
 
index fe6be5adc6fe6b93fd57f83a900a21673d00cf77..17e0b0431da6e426ffdc9e14ad509db9d68d6c3a 100644 (file)
@@ -64,8 +64,8 @@
 pub fn collect_item_types<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
     let mut visitor = CollectItemTypesVisitor { tcx: tcx };
     tcx.hir
-        .krate()
-        .visit_all_item_likes(&mut visitor.as_deep_visitor());
+       .krate()
+       .visit_all_item_likes(&mut visitor.as_deep_visitor());
 }
 
 pub fn provide(providers: &mut Providers) {
@@ -197,7 +197,8 @@ fn ty_infer(&self, span: Span) -> Ty<'tcx> {
             E0121,
             "the type placeholder `_` is not allowed within types on item signatures"
         ).span_label(span, "not allowed in type signatures")
-            .emit();
+         .emit();
+
         self.tcx().types.err
     }
 
@@ -529,12 +530,11 @@ fn convert_enum_variant_types<'a, 'tcx>(
                 ).span_label(
                     variant.span,
                     format!("overflowed on value after {}", prev_discr.unwrap()),
-                )
-                    .note(&format!(
-                        "explicitly set `{} = {}` if that is desired outcome",
-                        variant.node.name, wrapped_discr
-                    ))
-                    .emit();
+                ).note(&format!(
+                    "explicitly set `{} = {}` if that is desired outcome",
+                    variant.node.name, wrapped_discr
+                ))
+                .emit();
                 None
             }.unwrap_or(wrapped_discr),
         );
@@ -577,8 +577,8 @@ fn convert_variant<'a, 'tcx>(
                     "field `{}` is already declared",
                     f.ident
                 ).span_label(f.span, "field already declared")
-                    .span_label(prev_span, format!("`{}` first declared here", f.ident))
-                    .emit();
+                 .span_label(prev_span, format!("`{}` first declared here", f.ident))
+                 .emit();
             } else {
                 seen_fields.insert(f.ident.modern(), f.span);
             }
@@ -824,14 +824,11 @@ fn has_late_bound_regions<'a, 'tcx>(
             has_late_bound_regions: None,
         };
         for param in &generics.params {
-            match param.kind {
-                GenericParamKind::Lifetime { .. } => {
-                    let hir_id = tcx.hir.node_to_hir_id(param.id);
-                    if tcx.is_late_bound(hir_id) {
-                        return Some(param.span);
-                    }
+            if let GenericParamKind::Lifetime { .. } = param.kind {
+                let hir_id = tcx.hir.node_to_hir_id(param.id);
+                if tcx.is_late_bound(hir_id) {
+                    return Some(param.span);
                 }
-                _ => {}
             }
         }
         visitor.visit_fn_decl(decl);
@@ -1314,6 +1311,7 @@ struct ConstraintLocator<'a, 'tcx: 'a> {
         def_id: DefId,
         found: Option<(Span, ty::Ty<'tcx>)>,
     }
+
     impl<'a, 'tcx> ConstraintLocator<'a, 'tcx> {
         fn check(&mut self, def_id: DefId) {
             trace!("checking {:?}", def_id);
@@ -1347,6 +1345,7 @@ fn check(&mut self, def_id: DefId) {
             }
         }
     }
+
     impl<'a, 'tcx> intravisit::Visitor<'tcx> for ConstraintLocator<'a, 'tcx> {
         fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'this, 'tcx> {
             intravisit::NestedVisitorMap::All(&self.tcx.hir)
@@ -1373,6 +1372,7 @@ fn visit_trait_item(&mut self, it: &'tcx TraitItem) {
             intravisit::walk_trait_item(self, it);
         }
     }
+
     let mut locator = ConstraintLocator {
         def_id,
         tcx,
@@ -1380,7 +1380,9 @@ fn visit_trait_item(&mut self, it: &'tcx TraitItem) {
     };
     let node_id = tcx.hir.as_local_node_id(def_id).unwrap();
     let parent = tcx.hir.get_parent(node_id);
+
     trace!("parent_id: {:?}", parent);
+
     if parent == ast::CRATE_NODE_ID {
         intravisit::walk_crate(&mut locator, tcx.hir.krate());
     } else {
@@ -1395,6 +1397,7 @@ fn visit_trait_item(&mut self, it: &'tcx TraitItem) {
             ),
         }
     }
+
     match locator.found {
         Some((_, ty)) => ty,
         None => {
@@ -1786,17 +1789,14 @@ fn explicit_predicates_of<'a, 'tcx>(
     // Collect the predicates that were written inline by the user on each
     // type parameter (e.g., `<T:Foo>`).
     for param in &ast_generics.params {
-        match param.kind {
-            GenericParamKind::Type { .. } => {
-                let name = param.name.ident().as_interned_str();
-                let param_ty = ty::ParamTy::new(index, name).to_ty(tcx);
-                index += 1;
-
-                let sized = SizedByDefault::Yes;
-                let bounds = compute_bounds(&icx, param_ty, &param.bounds, sized, param.span);
-                predicates.extend(bounds.predicates(tcx, param_ty));
-            }
-            _ => {}
+        if let GenericParamKind::Type { .. } = param.kind {
+            let name = param.name.ident().as_interned_str();
+            let param_ty = ty::ParamTy::new(index, name).to_ty(tcx);
+            index += 1;
+
+            let sized = SizedByDefault::Yes;
+            let bounds = compute_bounds(&icx, param_ty, &param.bounds, sized, param.span);
+            predicates.extend(bounds.predicates(tcx, param_ty));
         }
     }
 
@@ -1835,10 +1835,10 @@ fn explicit_predicates_of<'a, 'tcx>(
                                 &mut projections,
                             );
 
-                            predicates.push((trait_ref.to_predicate(), poly_trait_ref.span));
-                            predicates.extend(projections.iter().map(|&(p, span)| {
-                                (p.to_predicate(), span)
-                            }));
+                            predicates.extend(
+                                iter::once((trait_ref.to_predicate(), poly_trait_ref.span)).chain(
+                                    projections.iter().map(|&(p, span)| (p.to_predicate(), span)
+                            )));
                         }
 
                         &hir::GenericBound::Outlives(ref lifetime) => {
@@ -1852,7 +1852,7 @@ fn explicit_predicates_of<'a, 'tcx>(
 
             &hir::WherePredicate::RegionPredicate(ref region_pred) => {
                 let r1 = AstConv::ast_region_to_region(&icx, &region_pred.lifetime, None);
-                for bound in &region_pred.bounds {
+                predicates.extend(region_pred.bounds.iter().map(|bound| {
                     let (r2, span) = match bound {
                         hir::GenericBound::Outlives(lt) => {
                             (AstConv::ast_region_to_region(&icx, lt, None), lt.span)
@@ -1860,8 +1860,9 @@ fn explicit_predicates_of<'a, 'tcx>(
                         _ => bug!(),
                     };
                     let pred = ty::Binder::bind(ty::OutlivesPredicate(r1, r2));
-                    predicates.push((ty::Predicate::RegionOutlives(pred), span))
-                }
+
+                    (ty::Predicate::RegionOutlives(pred), span)
+                }))
             }
 
             &hir::WherePredicate::EqPredicate(..) => {
@@ -1876,9 +1877,7 @@ fn explicit_predicates_of<'a, 'tcx>(
             let trait_item = tcx.hir.trait_item(trait_item_ref.id);
             let bounds = match trait_item.node {
                 hir::TraitItemKind::Type(ref bounds, _) => bounds,
-                _ => {
-                    return vec![].into_iter();
-                }
+                _ => return vec![].into_iter()
             };
 
             let assoc_ty =
@@ -1939,6 +1938,7 @@ pub fn compute_bounds<'gcx: 'tcx, 'tcx>(
 ) -> Bounds<'tcx> {
     let mut region_bounds = vec![];
     let mut trait_bounds = vec![];
+
     for ast_bound in ast_bounds {
         match *ast_bound {
             hir::GenericBound::Trait(ref b, hir::TraitBoundModifier::None) => trait_bounds.push(b),
@@ -2032,16 +2032,16 @@ fn compute_sig_of_foreign_fn_decl<'a, 'tcx>(
         let check = |ast_ty: &hir::Ty, ty: Ty| {
             if ty.is_simd() {
                 tcx.sess
-                    .struct_span_err(
-                        ast_ty.span,
-                        &format!(
-                            "use of SIMD type `{}` in FFI is highly experimental and \
-                             may result in invalid code",
-                            tcx.hir.node_to_pretty_string(ast_ty.id)
-                        ),
-                    )
-                    .help("add #![feature(simd_ffi)] to the crate attributes to enable")
-                    .emit();
+                   .struct_span_err(
+                       ast_ty.span,
+                       &format!(
+                           "use of SIMD type `{}` in FFI is highly experimental and \
+                            may result in invalid code",
+                           tcx.hir.node_to_pretty_string(ast_ty.id)
+                       ),
+                   )
+                   .help("add #![feature(simd_ffi)] to the crate attributes to enable")
+                   .emit();
             }
         };
         for (input, ty) in decl.inputs.iter().zip(*fty.inputs().skip_binder()) {
@@ -2101,7 +2101,7 @@ fn from_target_feature(
         };
 
         // We allow comma separation to enable multiple features
-        for feature in value.as_str().split(',') {
+        target_features.extend(value.as_str().split(',').filter_map(|feature| {
             // Only allow whitelisted features per platform
             let feature_gate = match whitelist.get(feature) {
                 Some(g) => g,
@@ -2120,7 +2120,7 @@ fn from_target_feature(
                         }
                     }
                     err.emit();
-                    continue;
+                    return None;
                 }
             };
 
@@ -2147,10 +2147,10 @@ fn from_target_feature(
                     feature_gate::GateIssue::Language,
                     &format!("the target feature `{}` is currently unstable", feature),
                 );
-                continue;
+                return None;
             }
-            target_features.push(Symbol::intern(feature));
-        }
+            Some(Symbol::intern(feature))
+        }));
     }
 }
 
@@ -2183,7 +2183,7 @@ fn linkage_by_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId, name: &
                 tcx.sess.span_fatal(span, "invalid linkage specified")
             } else {
                 tcx.sess
-                    .fatal(&format!("invalid linkage specified: {}", name))
+                   .fatal(&format!("invalid linkage specified: {}", name))
             }
         }
     }
@@ -2281,7 +2281,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
                     E0558,
                     "`export_name` attribute has invalid format"
                 ).span_label(attr.span, "did you mean #[export_name=\"*\"]?")
-                    .emit();
+                 .emit();
             }
         } else if attr.check_name("target_feature") {
             if tcx.fn_sig(id).unsafety() == Unsafety::Normal {
index 1ef599ec58f9ea716d941f5c14113a3ca8742323..9299e9b7b8f159ddbfe14c943c1f5f06bde20259 100644 (file)
@@ -77,11 +77,8 @@ fn visit_ty(&mut self, t: Ty<'tcx>) -> bool {
     }
 
     fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
-        match *r {
-            ty::ReEarlyBound(data) => {
-                self.parameters.push(Parameter::from(data));
-            }
-            _ => {}
+        if let ty::ReEarlyBound(data) = *r {
+            self.parameters.push(Parameter::from(data));
         }
         false
     }
@@ -204,6 +201,6 @@ pub fn setup_constraining_predicates<'tcx>(tcx: TyCtxt,
         }
         debug!("setup_constraining_predicates: predicates={:?} \
                 i={} impl_trait_ref={:?} input_parameters={:?}",
-           predicates, i, impl_trait_ref, input_parameters);
+               predicates, i, impl_trait_ref, input_parameters);
     }
 }
index abb59dc9d9a3e0bc6d0f74f7dfdc3e90fd43db69..7e0a8d63e2889a13b70084ca38455829beed28f0 100644 (file)
@@ -71,15 +71,12 @@ struct ImplWfCheck<'a, 'tcx: 'a> {
 
 impl<'a, 'tcx> ItemLikeVisitor<'tcx> for ImplWfCheck<'a, 'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item) {
-        match item.node {
-            hir::ItemKind::Impl(.., ref impl_item_refs) => {
-                let impl_def_id = self.tcx.hir.local_def_id(item.id);
-                enforce_impl_params_are_constrained(self.tcx,
-                                                    impl_def_id,
-                                                    impl_item_refs);
-                enforce_impl_items_are_distinct(self.tcx, impl_item_refs);
-            }
-            _ => { }
+        if let hir::ItemKind::Impl(.., ref impl_item_refs) = item.node {
+            let impl_def_id = self.tcx.hir.local_def_id(item.id);
+            enforce_impl_params_are_constrained(self.tcx,
+                                                impl_def_id,
+                                                impl_item_refs);
+            enforce_impl_items_are_distinct(self.tcx, impl_item_refs);
         }
     }
 
@@ -182,7 +179,7 @@ fn enforce_impl_items_are_distinct<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         let impl_item = tcx.hir.impl_item(impl_item_ref.id);
         let seen_items = match impl_item.node {
             hir::ImplItemKind::Type(_) => &mut seen_type_items,
-            _                    => &mut seen_value_items,
+            _                          => &mut seen_value_items,
         };
         match seen_items.entry(impl_item.ident.modern()) {
             Occupied(entry) => {
@@ -191,7 +188,7 @@ fn enforce_impl_items_are_distinct<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                                impl_item.ident);
                 err.span_label(*entry.get(),
                                format!("previous definition of `{}` here",
-                                        impl_item.ident));
+                                       impl_item.ident));
                 err.span_label(impl_item.span, "duplicate definition");
                 err.emit();
             }
index 1de79ddf4a49f8e53445e35d1398b987cf456ed5..1f5998d8ca39514456b8a9ec5488d33a8ea59aa9 100644 (file)
@@ -75,7 +75,7 @@
 #![feature(box_syntax)]
 #![feature(crate_visibility_modifier)]
 #![feature(exhaustive_patterns)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(quote)]
 #![feature(refcell_replace_swap)]
 #![feature(rustc_diagnostic_macros)]
@@ -146,7 +146,7 @@ fn require_c_abi_if_variadic(tcx: TyCtxt,
                              span: Span) {
     if decl.variadic && !(abi == Abi::C || abi == Abi::Cdecl) {
         let mut err = struct_span_err!(tcx.sess, span, E0045,
-                  "variadic function must have C or cdecl calling convention");
+            "variadic function must have C or cdecl calling convention");
         err.span_label(span, "variadics require C or cdecl calling convention").emit();
     }
 }
@@ -186,35 +186,29 @@ fn check_main_fn_ty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     let main_t = tcx.type_of(main_def_id);
     match main_t.sty {
         ty::FnDef(..) => {
-            match tcx.hir.find(main_id) {
-                Some(Node::Item(it)) => {
-                    match it.node {
-                        hir::ItemKind::Fn(.., ref generics, _) => {
-                            let mut error = false;
-                            if !generics.params.is_empty() {
-                                let msg = "`main` function is not allowed to have generic \
-                                           parameters".to_string();
-                                let label = "`main` cannot have generic parameters".to_string();
-                                struct_span_err!(tcx.sess, generics.span, E0131, "{}", msg)
-                                    .span_label(generics.span, label)
-                                    .emit();
-                                error = true;
-                            }
-                            if let Some(sp) = generics.where_clause.span() {
-                                struct_span_err!(tcx.sess, sp, E0646,
-                                    "`main` function is not allowed to have a `where` clause")
-                                    .span_label(sp, "`main` cannot have a `where` clause")
-                                    .emit();
-                                error = true;
-                            }
-                            if error {
-                                return;
-                            }
-                        }
-                        _ => ()
+            if let Some(Node::Item(it)) = tcx.hir.find(main_id) {
+                if let hir::ItemKind::Fn(.., ref generics, _) = it.node {
+                    let mut error = false;
+                    if !generics.params.is_empty() {
+                        let msg = "`main` function is not allowed to have generic \
+                                   parameters".to_owned();
+                        let label = "`main` cannot have generic parameters".to_string();
+                        struct_span_err!(tcx.sess, generics.span, E0131, "{}", msg)
+                            .span_label(generics.span, label)
+                            .emit();
+                        error = true;
+                    }
+                    if let Some(sp) = generics.where_clause.span() {
+                        struct_span_err!(tcx.sess, sp, E0646,
+                            "`main` function is not allowed to have a `where` clause")
+                            .span_label(sp, "`main` cannot have a `where` clause")
+                            .emit();
+                        error = true;
+                    }
+                    if error {
+                        return;
                     }
                 }
-                _ => ()
             }
 
             let actual = tcx.fn_sig(main_def_id);
@@ -258,34 +252,28 @@ fn check_start_fn_ty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     let start_t = tcx.type_of(start_def_id);
     match start_t.sty {
         ty::FnDef(..) => {
-            match tcx.hir.find(start_id) {
-                Some(Node::Item(it)) => {
-                    match it.node {
-                        hir::ItemKind::Fn(.., ref generics, _) => {
-                            let mut error = false;
-                            if !generics.params.is_empty() {
-                                struct_span_err!(tcx.sess, generics.span, E0132,
-                                    "start function is not allowed to have type parameters")
-                                    .span_label(generics.span,
-                                                "start function cannot have type parameters")
-                                    .emit();
-                                error = true;
-                            }
-                            if let Some(sp) = generics.where_clause.span() {
-                                struct_span_err!(tcx.sess, sp, E0647,
-                                    "start function is not allowed to have a `where` clause")
-                                    .span_label(sp, "start function cannot have a `where` clause")
-                                    .emit();
-                                error = true;
-                            }
-                            if error {
-                                return;
-                            }
-                        }
-                        _ => ()
+            if let Some(Node::Item(it)) = tcx.hir.find(start_id) {
+                if let hir::ItemKind::Fn(.., ref generics, _) = it.node {
+                    let mut error = false;
+                    if !generics.params.is_empty() {
+                        struct_span_err!(tcx.sess, generics.span, E0132,
+                            "start function is not allowed to have type parameters")
+                            .span_label(generics.span,
+                                        "start function cannot have type parameters")
+                            .emit();
+                        error = true;
+                    }
+                    if let Some(sp) = generics.where_clause.span() {
+                        struct_span_err!(tcx.sess, sp, E0647,
+                            "start function is not allowed to have a `where` clause")
+                            .span_label(sp, "start function cannot have a `where` clause")
+                            .emit();
+                        error = true;
+                    }
+                    if error {
+                        return;
                     }
                 }
-                _ => ()
             }
 
             let se_ty = tcx.mk_fn_ptr(ty::Binder::bind(
@@ -388,6 +376,7 @@ pub fn hir_ty_to_ty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, hir_ty: &hir::Ty) ->
     let env_node_id = tcx.hir.get_parent(hir_ty.id);
     let env_def_id = tcx.hir.local_def_id(env_node_id);
     let item_cx = self::collect::ItemCtxt::new(tcx, env_def_id);
+
     astconv::AstConv::ast_ty_to_ty(&item_cx, hir_ty)
 }
 
@@ -403,6 +392,7 @@ pub fn hir_trait_to_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, hir_trait:
     let principal = astconv::AstConv::instantiate_poly_trait_ref_inner(
         &item_cx, hir_trait, tcx.types.err, &mut projections, true
     );
+
     (principal, projections)
 }
 
index 63a424936eb4c75d9ac08fec999dbbc882c51b04..cca77b20d9b30ba3a729aba5b59e974bafa8657a 100644 (file)
@@ -55,9 +55,7 @@ fn inferred_outlives_of<'a, 'tcx>(
                         .iter()
                         .map(|out_pred| match out_pred {
                             ty::Predicate::RegionOutlives(p) => p.to_string(),
-
                             ty::Predicate::TypeOutlives(p) => p.to_string(),
-
                             err => bug!("unexpected predicate {:?}", err),
                         }).collect();
                     pred.sort();
index c3c2ae667ddd950afde58bcfee64f07a7828ca0c..48c495e1c93170806f8a25939ce3c4f4d359b293 100644 (file)
@@ -14,8 +14,8 @@
 
 pub fn test_inferred_outlives<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
     tcx.hir
-        .krate()
-        .visit_all_item_likes(&mut OutlivesTest { tcx });
+       .krate()
+       .visit_all_item_likes(&mut OutlivesTest { tcx });
 }
 
 struct OutlivesTest<'a, 'tcx: 'a> {
index 0d833c50d7e3b310d51836bcff458d042ee06933..6bf7a3501bed997b092bdafbdc8e2b0c5b1530a2 100644 (file)
@@ -148,15 +148,9 @@ fn is_free_region<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, region: Region<'_>) -> bool
         //         field: &'static T, // this would generate a ReStatic
         //     }
         RegionKind::ReStatic => {
-            if tcx
-                .sess
-                .features_untracked()
-                .infer_static_outlives_requirements
-            {
-                true
-            } else {
-                false
-            }
+            tcx.sess
+               .features_untracked()
+               .infer_static_outlives_requirements
         }
 
         // Late-bound regions can appear in `fn` types:
index aaa0fd8e099efa47c492f1987ccdfc57853bd0dd..25f6b259e96bcaebbf59488219fc690adbf8471a 100644 (file)
@@ -55,7 +55,7 @@ fn crate_variances<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum)
 }
 
 fn variances_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_def_id: DefId)
-                            -> Lrc<Vec<ty::Variance>> {
+                          -> Lrc<Vec<ty::Variance>> {
     let id = tcx.hir.as_local_node_id(item_def_id).expect("expected local def-id");
     let unsupported = || {
         // Variance not relevant.
index 2456a5ad14acc61e15c81d5b4cd961d9122bef72..406180c09e8e48b26c0cc7d8ab2ccb732b57d4e1 100644 (file)
@@ -16,7 +16,7 @@
 #![feature(rustc_private)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(set_stdio)]
 #![feature(slice_sort_by_cached_key)]
 #![feature(test)]
index 1f6ee3d867b17b3c7225b31a84266de1f039df8a..98b48ef291857dd59a97b2d626f418a2307fde4a 100644 (file)
@@ -24,7 +24,7 @@
 #![feature(core_intrinsics)]
 #![feature(specialization)]
 #![feature(never_type)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![cfg_attr(test, feature(test))]
 
 pub use self::serialize::{Decoder, Encoder, Decodable, Encodable};
index 6753ed4a3df6d03d50287427d2aa4a485884d40e..31fc9ed3f772d3e254a4f103866a072a9ae1d098 100644 (file)
@@ -151,14 +151,12 @@ pub mod __default_lib_allocator {
     // ABI
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rdl_alloc(size: usize, align: usize) -> *mut u8 {
         let layout = Layout::from_size_align_unchecked(size, align);
         System.alloc(layout)
     }
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rdl_dealloc(ptr: *mut u8,
                                        size: usize,
                                        align: usize) {
@@ -166,7 +164,6 @@ pub mod __default_lib_allocator {
     }
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rdl_realloc(ptr: *mut u8,
                                        old_size: usize,
                                        align: usize,
@@ -176,7 +173,6 @@ pub mod __default_lib_allocator {
     }
 
     #[rustc_std_internal_symbol]
-    #[cfg_attr(stage0, no_mangle)]
     pub unsafe extern fn __rdl_alloc_zeroed(size: usize, align: usize) -> *mut u8 {
         let layout = Layout::from_size_align_unchecked(size, align);
         System.alloc_zeroed(layout)
index 1eb76d6c45ec47783b4619a8cb5b667ca85d4461..7ae4f2de4c36d16789f3d4ace9beb668b6cdc597 100644 (file)
 #![feature(cfg_target_vendor)]
 #![feature(char_error_internals)]
 #![feature(compiler_builtins_lib)]
-#![cfg_attr(stage0, feature(const_fn))]
-#![cfg_attr(not(stage0), feature(min_const_fn))]
+#![feature(min_const_fn)]
 #![feature(const_int_ops)]
 #![feature(const_ip)]
 #![feature(core_intrinsics)]
 #![feature(libc)]
 #![feature(link_args)]
 #![feature(linkage)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(needs_panic_runtime)]
 #![feature(never_type)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(exhaustive_patterns)]
 #![feature(on_unimplemented)]
 #![feature(optin_builtin_traits)]
 #![feature(rustc_attrs)]
 #![feature(rustc_const_unstable)]
 #![feature(std_internals)]
-#![feature(stdsimd)]
+#![cfg_attr(not(stage0), feature(stdsimd))]
 #![feature(shrink_to)]
 #![feature(slice_concat_ext)]
 #![feature(slice_internals)]
 #![feature(unboxed_closures)]
 #![feature(untagged_unions)]
 #![feature(unwind_attributes)]
-#![cfg_attr(stage0, feature(use_extern_macros))]
 #![feature(doc_cfg)]
 #![feature(doc_masked)]
 #![feature(doc_spotlight)]
-#![cfg_attr(all(windows, stage0), feature(used))]
 #![feature(doc_alias)]
 #![feature(doc_keyword)]
 #![feature(panic_info_message)]
-#![cfg_attr(stage0, feature(panic_implementation))]
 #![feature(non_exhaustive)]
 
 #![default_lib_allocator]
index f79c986cc89e454603eb3aa283a45d97c09461f4..df085a7f450b099640410acceff6427440379882 100644 (file)
@@ -319,8 +319,7 @@ pub fn panicking() -> bool {
 
 /// Entry point of panic from the libcore crate.
 #[cfg(not(test))]
-#[cfg_attr(stage0, panic_implementation)]
-#[cfg_attr(not(stage0), panic_handler)]
+#[panic_handler]
 #[unwind(allowed)]
 pub fn rust_begin_panic(info: &PanicInfo) -> ! {
     continue_panic_fmt(&info)
@@ -398,7 +397,7 @@ fn get(&mut self) -> &(dyn Any + Send) {
 #[unstable(feature = "libstd_sys_internals",
            reason = "used by the panic! macro",
            issue = "0")]
-#[cfg_attr(not(any(stage0, test)), lang = "begin_panic")]
+#[cfg_attr(not(test), lang = "begin_panic")]
 #[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible
 pub fn begin_panic<M: Any + Send>(msg: M, file_line_col: &(&'static str, u32, u32)) -> ! {
     // Note that this should be the only allocation performed in this code path.
index a1b031a655f8577988016d249d4c967aac0e242b..9077eca18215c0010d3e57a52570f97b3e44a1bd 100644 (file)
@@ -21,7 +21,7 @@
 
 #![feature(crate_visibility_modifier)]
 #![feature(macro_at_most_once_rep)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(rustc_attrs)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(slice_sort_by_cached_key)]
index 31089c9ff82cefefc9a3111d6e65b91aafcbb024..7c023fc5c9c224f6c723c17471ae1c6bd8906f1b 100644 (file)
@@ -16,7 +16,7 @@
 
 #![feature(proc_macro_internals)]
 #![feature(decl_macro)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(str_escape)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
index 67fd847a2ae9197790a0d2a71917e0cec74d84fb..45eaf1d3190f2f5ac4dc285d9b05b7f873b0629a 100644 (file)
 #![feature(const_fn)]
 #![feature(crate_visibility_modifier)]
 #![feature(custom_attribute)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(non_exhaustive)]
 #![feature(optin_builtin_traits)]
 #![feature(specialization)]
-#![feature(stdsimd)]
+#![cfg_attr(not(stage0), feature(stdsimd))]
 
 use std::borrow::Cow;
 use std::cell::Cell;
index a49fd67639dbe5210fe1118a2f1e672f8958f7b5..5ac46c2c5ebdc8cb6fdd32399fba239be8958248 100644 (file)
@@ -50,7 +50,7 @@
 #![cfg_attr(windows, feature(libc))]
 // Handle rustfmt skips
 #![feature(custom_attribute)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![allow(unused_attributes)]
 
 use std::io::prelude::*;
index f6383c19cb5e6dc61bc2f96881b59c1b710aeb4d..0e862bcf5ca46cf10f9d6e49c0775fd0fcac0256 100644 (file)
@@ -35,7 +35,7 @@
 #![feature(asm)]
 #![feature(fnbox)]
 #![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(set_stdio)]
 #![feature(panic_unwind)]
 #![feature(staged_api)]
index 424a7e3d009ecaa6c930c200c7819552b7609e89..954eb9d6d03ba81b27c0ed6ed92ca2d0d85e11de 100644 (file)
@@ -13,7 +13,7 @@
 
 #![feature(cfg_target_vendor)]
 #![feature(link_cfg)]
-#![cfg_attr(not(stage0), feature(nll))]
+#![feature(nll)]
 #![feature(staged_api)]
 #![feature(unwind_attributes)]
 #![feature(static_nobundle)]
index 69e8140cdf19d64fdedce5e756e269a84d8d7515..f0967d1ba8ae6d41fe01e773643dba94c25f21e3 100644 (file)
@@ -12,7 +12,7 @@
 # source tarball for a stable release you'll likely see `1.x.0` for rustc and
 # `0.x.0` for Cargo where they were released on `date`.
 
-date: 2018-09-11
+date: 2018-09-23
 rustc: beta
 cargo: beta
 
index 0bd021f8ae2d68a90127754ec2a9e1719a339e27..5061d9a915e2e9296fe462c750dc1f7f0a3a02ec 100644 (file)
@@ -53,13 +53,13 @@ pub fn named_borrow<'r>(_: &'r i32) {
 pub fn unsafe_borrow(_: &UnsafeInner) {
 }
 
-// CHECK: @mutable_unsafe_borrow(i16* noalias dereferenceable(2) %arg0)
+// CHECK: @mutable_unsafe_borrow(i16* dereferenceable(2) %arg0)
 // ... unless this is a mutable borrow, those never alias
 #[no_mangle]
 pub fn mutable_unsafe_borrow(_: &mut UnsafeInner) {
 }
 
-// CHECK: @mutable_borrow(i32* noalias dereferenceable(4) %arg0)
+// CHECK: @mutable_borrow(i32* dereferenceable(4) %arg0)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn mutable_borrow(_: &mut i32) {
@@ -102,7 +102,7 @@ pub fn helper(_: usize) {
 pub fn slice(_: &[u8]) {
 }
 
-// CHECK: @mutable_slice([0 x i8]* noalias nonnull %arg0.0, [[USIZE]] %arg0.1)
+// CHECK: @mutable_slice([0 x i8]* nonnull %arg0.0, [[USIZE]] %arg0.1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn mutable_slice(_: &mut [u8]) {
index c965a3ed86c82d7336d47961b9a95f69935d4f84..460e28fc794f0f921556e50a2d498641303c55c3 100644 (file)
@@ -12,7 +12,6 @@
 
 #![feature(plugin_registrar, rustc_private)]
 #![feature(box_syntax)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 #[macro_use] extern crate rustc;
index 082f15a39dd955254c7b94b62ef41ef0eeb9f295..1057649d969d171b2a9bad77cda15d5e52d487a9 100644 (file)
@@ -12,7 +12,6 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 // Load rustc as a plugin to get macros
index 315dad7eea515279f0aa1d06b15ba5ea2ded568b..b0183a3c56bc4a5dd4b236ddbf844a7582f0254d 100644 (file)
@@ -12,7 +12,6 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 extern crate syntax;
index 601003827c6a287a463e193bda77647ff4274a62..00c419a8d09e833f02adf03bb4bccda2080809c1 100644 (file)
@@ -12,7 +12,6 @@
 
 #![feature(plugin_registrar, rustc_private)]
 #![feature(box_syntax)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 #[macro_use] extern crate rustc;
index f525e0f082a44b723facd5f3f5aae20274762a8a..e0acf340a79fdfc6faecb27f63c04d322ec81af6 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 #![crate_type = "dylib"]
 
diff --git a/src/test/run-pass/issue-54462-mutable-noalias-correctness.rs b/src/test/run-pass/issue-54462-mutable-noalias-correctness.rs
new file mode 100644 (file)
index 0000000..f0e52b2
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+//
+// compile-flags: -Ccodegen-units=1 -O
+
+fn linidx(row: usize, col: usize) -> usize {
+    row * 1 + col * 3
+}
+
+fn main() {
+    let mut mat = [1.0f32, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0];
+
+    for i in 0..2 {
+        for j in i+1..3 {
+            if mat[linidx(j, 3)] > mat[linidx(i, 3)] {
+                    for k in 0..4 {
+                            let (x, rest) = mat.split_at_mut(linidx(i, k) + 1);
+                            let a = x.last_mut().unwrap();
+                            let b = rest.get_mut(linidx(j, k) - linidx(i, k) - 1).unwrap();
+                            ::std::mem::swap(a, b);
+                    }
+            }
+        }
+    }
+    assert_eq!([9.0, 5.0, 1.0, 10.0, 6.0, 2.0, 11.0, 7.0, 3.0, 12.0, 8.0, 4.0], mat);
+}
index 984a31d4d520e8e204a33b63cc3a21ddc8f813b6..c5f82ce5f0c0659183c12023debb964f5d181d0d 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 // run-pass
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 //{{{ issue 40569 ==============================================================
 
index 7d8bb430232fe24589525e174b7acc1dea2a8343..8e68a3c00455f21668d2c48570409f207157efa8 100644 (file)
@@ -10,7 +10,6 @@
 
 // run-pass
 #![allow(dead_code, unused_imports)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(crate_visibility_modifier)]
 
 /**
index 082f15a39dd955254c7b94b62ef41ef0eeb9f295..1057649d969d171b2a9bad77cda15d5e52d487a9 100644 (file)
@@ -12,7 +12,6 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 // Load rustc as a plugin to get macros
index 315dad7eea515279f0aa1d06b15ba5ea2ded568b..b0183a3c56bc4a5dd4b236ddbf844a7582f0254d 100644 (file)
@@ -12,7 +12,6 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 extern crate syntax;
index e184c0919d0ecf333fc94177986d761eeb128bb2..7d2acd7aa4c86b7c106a3ff52f1dec37cfa316e4 100644 (file)
@@ -10,7 +10,6 @@
 
 #![feature(plugin_registrar)]
 #![feature(box_syntax, rustc_private)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![feature(macro_at_most_once_rep)]
 
 extern crate syntax;
diff --git a/src/test/ui/impl-trait/closure-calling-parent-fn.rs b/src/test/ui/impl-trait/closure-calling-parent-fn.rs
new file mode 100644 (file)
index 0000000..cb5f78b
--- /dev/null
@@ -0,0 +1,14 @@
+#![feature(nll)]
+
+// Regression test for #54593: the MIR type checker was going wrong
+// when a closure returns the `impl Copy` from its parent fn. It was
+// (incorrectly) replacing the `impl Copy` in its return type with the
+// hidden type (`()`) but that type resulted from a recursive call to
+// `foo` and hence is treated opaquely within the closure body.  This
+// resulted in a failed subtype relationship.
+//
+// run-pass
+
+fn foo() -> impl Copy { || foo(); }
+fn bar() -> impl Copy { || bar(); }
+fn main() { }
index 46c8cb740ded7cfc3b101d87a2039115490963b2..a8458ccacc3c041e477ceba116b565e29f00a11c 100644 (file)
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 macro_rules! foo {
     ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree
index fa736edc47f5bf8207b045f332a00575764ab0d4..bdbb99de4608fa22312e92c6bc74718ba8fc0299 100644 (file)
@@ -1,5 +1,5 @@
 error: repetition matches empty token tree
-  --> $DIR/issue-42755.rs:14:7
+  --> $DIR/issue-42755.rs:13:7
    |
 LL |     ($($p:vis)*) => {} //~ ERROR repetition matches empty token tree
    |       ^^^^^^^^
index 0089617b11c0b9a84e1c3f5db6b8731694185a69..b58bbe74c97319aa8cd5d96bd551484119426836 100644 (file)
@@ -16,7 +16,6 @@
 
 // compile-pass
 
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 #![allow(unused)]
 #![warn(unreachable_pub)]
index 1cbfbd211255dcef575ea683832093185fd28fe9..ed45ba8e85d46fa151924cbf00ec24437664123d 100644 (file)
@@ -1,5 +1,5 @@
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:26:5
+  --> $DIR/unreachable_pub-pub_crate.rs:25:5
    |
 LL |     pub use std::fmt;
    |     ---^^^^^^^^^^^^^^
@@ -7,14 +7,14 @@ LL |     pub use std::fmt;
    |     help: consider restricting its visibility: `pub(crate)`
    |
 note: lint level defined here
-  --> $DIR/unreachable_pub-pub_crate.rs:22:9
+  --> $DIR/unreachable_pub-pub_crate.rs:21:9
    |
 LL | #![warn(unreachable_pub)]
    |         ^^^^^^^^^^^^^^^
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:27:24
+  --> $DIR/unreachable_pub-pub_crate.rs:26:24
    |
 LL |     pub use std::env::{Args}; // braced-use has different item spans than unbraced
    |     ---                ^^^^
@@ -24,7 +24,7 @@ LL |     pub use std::env::{Args}; // braced-use has different item spans than u
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:29:5
+  --> $DIR/unreachable_pub-pub_crate.rs:28:5
    |
 LL |     pub struct Hydrogen {
    |     ---^^^^^^^^^^^^^^^^
@@ -34,7 +34,7 @@ LL |     pub struct Hydrogen {
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` field
-  --> $DIR/unreachable_pub-pub_crate.rs:31:9
+  --> $DIR/unreachable_pub-pub_crate.rs:30:9
    |
 LL |         pub neutrons: usize,
    |         ---^^^^^^^^^^^^^^^^
@@ -42,7 +42,7 @@ LL |         pub neutrons: usize,
    |         help: consider restricting its visibility: `pub(crate)`
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:37:9
+  --> $DIR/unreachable_pub-pub_crate.rs:36:9
    |
 LL |         pub fn count_neutrons(&self) -> usize { self.neutrons }
    |         ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -50,7 +50,7 @@ LL |         pub fn count_neutrons(&self) -> usize { self.neutrons }
    |         help: consider restricting its visibility: `pub(crate)`
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:41:5
+  --> $DIR/unreachable_pub-pub_crate.rs:40:5
    |
 LL |     pub enum Helium {}
    |     ---^^^^^^^^^^^^
@@ -60,7 +60,7 @@ LL |     pub enum Helium {}
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:42:5
+  --> $DIR/unreachable_pub-pub_crate.rs:41:5
    |
 LL |     pub union Lithium { c1: usize, c2: u8 }
    |     ---^^^^^^^^^^^^^^
@@ -70,7 +70,7 @@ LL |     pub union Lithium { c1: usize, c2: u8 }
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:43:5
+  --> $DIR/unreachable_pub-pub_crate.rs:42:5
    |
 LL |     pub fn beryllium() {}
    |     ---^^^^^^^^^^^^^^^
@@ -80,7 +80,7 @@ LL |     pub fn beryllium() {}
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:44:5
+  --> $DIR/unreachable_pub-pub_crate.rs:43:5
    |
 LL |     pub trait Boron {}
    |     ---^^^^^^^^^^^^
@@ -90,7 +90,7 @@ LL |     pub trait Boron {}
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:45:5
+  --> $DIR/unreachable_pub-pub_crate.rs:44:5
    |
 LL |     pub const CARBON: usize = 1;
    |     ---^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -100,7 +100,7 @@ LL |     pub const CARBON: usize = 1;
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:46:5
+  --> $DIR/unreachable_pub-pub_crate.rs:45:5
    |
 LL |     pub static NITROGEN: usize = 2;
    |     ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -110,7 +110,7 @@ LL |     pub static NITROGEN: usize = 2;
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:47:5
+  --> $DIR/unreachable_pub-pub_crate.rs:46:5
    |
 LL |     pub type Oxygen = bool;
    |     ---^^^^^^^^^^^^^^^^^^^^
@@ -120,7 +120,7 @@ LL |     pub type Oxygen = bool;
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:50:47
+  --> $DIR/unreachable_pub-pub_crate.rs:49:47
    |
 LL |         ($visibility: vis, $name: ident) => { $visibility struct $name {} }
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -134,7 +134,7 @@ LL |     define_empty_struct_with_visibility!(pub, Fluorine);
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub-pub_crate.rs:55:9
+  --> $DIR/unreachable_pub-pub_crate.rs:54:9
    |
 LL |         pub fn catalyze() -> bool;
    |         ---^^^^^^^^^^^^^^^^^^^^^^^
index 7fd4a901090711bcfaf666bf456533ca5d9128a3..217e26e44047a5527877f3992cc94cfc830a4220 100644 (file)
@@ -11,7 +11,6 @@
 // compile-pass
 
 #![feature(crate_visibility_modifier)]
-#![cfg_attr(stage0, feature(macro_vis_matcher))]
 
 #![allow(unused)]
 #![warn(unreachable_pub)]
index 25046055aa0247310a6d086251ab09a66d5fa5bc..e1d00d13717123572e1a9128b583bdd77440c47c 100644 (file)
@@ -1,5 +1,5 @@
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:21:5
+  --> $DIR/unreachable_pub.rs:20:5
    |
 LL |     pub use std::fmt;
    |     ---^^^^^^^^^^^^^^
@@ -7,14 +7,14 @@ LL |     pub use std::fmt;
    |     help: consider restricting its visibility: `crate`
    |
 note: lint level defined here
-  --> $DIR/unreachable_pub.rs:17:9
+  --> $DIR/unreachable_pub.rs:16:9
    |
 LL | #![warn(unreachable_pub)]
    |         ^^^^^^^^^^^^^^^
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:22:24
+  --> $DIR/unreachable_pub.rs:21:24
    |
 LL |     pub use std::env::{Args}; // braced-use has different item spans than unbraced
    |     ---                ^^^^
@@ -24,7 +24,7 @@ LL |     pub use std::env::{Args}; // braced-use has different item spans than u
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:24:5
+  --> $DIR/unreachable_pub.rs:23:5
    |
 LL |     pub struct Hydrogen {
    |     ---^^^^^^^^^^^^^^^^
@@ -34,7 +34,7 @@ LL |     pub struct Hydrogen {
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` field
-  --> $DIR/unreachable_pub.rs:26:9
+  --> $DIR/unreachable_pub.rs:25:9
    |
 LL |         pub neutrons: usize,
    |         ---^^^^^^^^^^^^^^^^
@@ -42,7 +42,7 @@ LL |         pub neutrons: usize,
    |         help: consider restricting its visibility: `crate`
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:32:9
+  --> $DIR/unreachable_pub.rs:31:9
    |
 LL |         pub fn count_neutrons(&self) -> usize { self.neutrons }
    |         ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -50,7 +50,7 @@ LL |         pub fn count_neutrons(&self) -> usize { self.neutrons }
    |         help: consider restricting its visibility: `crate`
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:36:5
+  --> $DIR/unreachable_pub.rs:35:5
    |
 LL |     pub enum Helium {}
    |     ---^^^^^^^^^^^^
@@ -60,7 +60,7 @@ LL |     pub enum Helium {}
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:37:5
+  --> $DIR/unreachable_pub.rs:36:5
    |
 LL |     pub union Lithium { c1: usize, c2: u8 }
    |     ---^^^^^^^^^^^^^^
@@ -70,7 +70,7 @@ LL |     pub union Lithium { c1: usize, c2: u8 }
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:38:5
+  --> $DIR/unreachable_pub.rs:37:5
    |
 LL |     pub fn beryllium() {}
    |     ---^^^^^^^^^^^^^^^
@@ -80,7 +80,7 @@ LL |     pub fn beryllium() {}
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:39:5
+  --> $DIR/unreachable_pub.rs:38:5
    |
 LL |     pub trait Boron {}
    |     ---^^^^^^^^^^^^
@@ -90,7 +90,7 @@ LL |     pub trait Boron {}
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:40:5
+  --> $DIR/unreachable_pub.rs:39:5
    |
 LL |     pub const CARBON: usize = 1;
    |     ---^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -100,7 +100,7 @@ LL |     pub const CARBON: usize = 1;
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:41:5
+  --> $DIR/unreachable_pub.rs:40:5
    |
 LL |     pub static NITROGEN: usize = 2;
    |     ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -110,7 +110,7 @@ LL |     pub static NITROGEN: usize = 2;
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:42:5
+  --> $DIR/unreachable_pub.rs:41:5
    |
 LL |     pub type Oxygen = bool;
    |     ---^^^^^^^^^^^^^^^^^^^^
@@ -120,7 +120,7 @@ LL |     pub type Oxygen = bool;
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:45:47
+  --> $DIR/unreachable_pub.rs:44:47
    |
 LL |         ($visibility: vis, $name: ident) => { $visibility struct $name {} }
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -134,7 +134,7 @@ LL |     define_empty_struct_with_visibility!(pub, Fluorine);
    = help: or consider exporting it for use by other crates
 
 warning: unreachable `pub` item
-  --> $DIR/unreachable_pub.rs:50:9
+  --> $DIR/unreachable_pub.rs:49:9
    |
 LL |         pub fn catalyze() -> bool;
    |         ---^^^^^^^^^^^^^^^^^^^^^^^