From bf089a1ac108346b5540d55be1d51c087b33931e Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:19:53 -0400 Subject: [PATCH 01/24] [nll] libcore: enable feature(nll) for bootstrap --- src/libcore/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index dc4a2d7c0d7b1..178ae62dd3dfa 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -92,6 +92,7 @@ #![feature(lang_items)] #![feature(link_llvm_intrinsics)] #![feature(never_type)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(exhaustive_patterns)] #![feature(macro_at_most_once_rep)] #![feature(no_core)] From 26991eb8bf8fb4f368db4acba31d9ed4a819fa5f Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:20:20 -0400 Subject: [PATCH 02/24] [nll] libprofiler_builtins: enable feature(nll) for bootstrap --- src/libprofiler_builtins/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libprofiler_builtins/lib.rs b/src/libprofiler_builtins/lib.rs index 6d0d6d115b716..a85593253b100 100644 --- a/src/libprofiler_builtins/lib.rs +++ b/src/libprofiler_builtins/lib.rs @@ -15,4 +15,5 @@ reason = "internal implementation detail of rustc right now", issue = "0")] #![allow(unused_features)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(staged_api)] From ed55520371c349666ba048a3e602d0b7018bf26d Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:20:41 -0400 Subject: [PATCH 03/24] [nll] librustc: enable feature(nll) for bootstrap --- src/librustc/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 804481846afdc..3cc1ca01b7871 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -51,6 +51,7 @@ #![feature(never_type)] #![feature(exhaustive_patterns)] #![feature(extern_types)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(non_exhaustive)] #![feature(proc_macro_internals)] #![feature(quote)] From 9207cc9bd90be84edac8d2d331a47adba50e07af Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:21:01 -0400 Subject: [PATCH 04/24] [nll] librustc_allocator: enable feature(nll) for bootstrap --- src/librustc_allocator/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_allocator/lib.rs b/src/librustc_allocator/lib.rs index b217d3665a245..a920bb0f2b918 100644 --- a/src/librustc_allocator/lib.rs +++ b/src/librustc_allocator/lib.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(not(stage0), feature(nll))] #![feature(rustc_private)] #[macro_use] extern crate log; From c556cff96f05530ee63d49eeb55acb3210de0060 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:21:23 -0400 Subject: [PATCH 05/24] [nll] librustc_data_structures: enable feature(nll) for bootstrap --- src/librustc_data_structures/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs index dd90cf7ae19e4..67f1c119ea839 100644 --- a/src/librustc_data_structures/lib.rs +++ b/src/librustc_data_structures/lib.rs @@ -26,6 +26,7 @@ #![feature(specialization)] #![feature(optin_builtin_traits)] #![feature(macro_vis_matcher)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(allow_internal_unstable)] #![feature(vec_resize_with)] From 75fa16bc60f86a391d5293503a2a066068c19797 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:22:08 -0400 Subject: [PATCH 06/24] [nll] libserialize: enable feature(nll) for bootstrap --- src/libserialize/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index a5f4b32b329e7..794fc095096a4 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -24,6 +24,7 @@ Core encoding and decoding interfaces. #![feature(core_intrinsics)] #![feature(specialization)] #![feature(never_type)] +#![cfg_attr(not(stage0), feature(nll))] #![cfg_attr(test, feature(test))] pub use self::serialize::{Decoder, Encoder, Decodable, Encodable}; From 6858bd890a9cbf7df481f6e643f70f4cb4192730 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:22:33 -0400 Subject: [PATCH 07/24] [nll] libsyntax: enable feature(nll) for bootstrap --- src/libsyntax/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index c8e60620248b3..0948ebea15df4 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -21,6 +21,7 @@ #![feature(crate_visibility_modifier)] #![feature(macro_at_most_once_rep)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(rustc_attrs)] #![feature(rustc_diagnostic_macros)] #![feature(slice_sort_by_cached_key)] From 9d2c4a3acd352488adfd18fc105f163b710c8f2b Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 09:22:45 -0400 Subject: [PATCH 08/24] [nll] libtest: enable feature(nll) for bootstrap --- src/libtest/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 3f8be97571fd7..30094223d0858 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -35,6 +35,7 @@ #![feature(asm)] #![feature(fnbox)] #![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))] +#![cfg_attr(not(stage0), feature(nll))] #![feature(set_stdio)] #![feature(panic_unwind)] #![feature(staged_api)] From 2cb91dad9fa5b2c82cf29828a727fde3f40507d3 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:28:39 -0400 Subject: [PATCH 09/24] [nll] libsyntax_ext: enable feature(nll) for bootstrap --- src/libsyntax_ext/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index f0d33835cd0fb..1ba4ab474258c 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -16,6 +16,7 @@ #![feature(proc_macro_internals)] #![feature(decl_macro)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(str_escape)] #![feature(rustc_diagnostic_macros)] From ce5b9c662f2ee203fb08c6a07f0a3f059f1697f4 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:32:23 -0400 Subject: [PATCH 10/24] [nll] libsyntax_ext: remove unnecessary mut annotation on variable Pointed out by nll. It is correct that the mut annotation is not needed. --- src/libsyntax_ext/deriving/generic/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index e0f985c26c7a1..f5e607fc23d22 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -554,7 +554,7 @@ impl<'a> TraitDef<'a> { GenericParamKind::Type { .. } => { // I don't think this can be moved out of the loop, since // a GenericBound requires an ast id - let mut bounds: Vec<_> = + let bounds: Vec<_> = // extra restrictions on the generics parameters to the // type being derived upon self.additional_bounds.iter().map(|p| { From 48616432ba4474bbbe6c152dfc284f0681b5bd55 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:32:45 -0400 Subject: [PATCH 11/24] [nll] libproc_macro: enable feature(nll) for bootstrap --- src/libproc_macro/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index bf6e4a3aaa405..fec90008c6701 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -31,6 +31,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(rustc_private)] #![feature(staged_api)] #![feature(lang_items)] From 4b42a2100bf4060b09dab325c83ff6aa7e0a97f8 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:33:06 -0400 Subject: [PATCH 12/24] [nll] librustc_codegen_utils: enable feature(nll) for bootstrap --- src/librustc_codegen_utils/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_codegen_utils/lib.rs b/src/librustc_codegen_utils/lib.rs index 3ff2388beea2a..635819e94e867 100644 --- a/src/librustc_codegen_utils/lib.rs +++ b/src/librustc_codegen_utils/lib.rs @@ -19,6 +19,7 @@ #![feature(box_patterns)] #![feature(box_syntax)] #![feature(custom_attribute)] +#![cfg_attr(not(stage0), feature(nll))] #![allow(unused_attributes)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] From 8172485b4d3bf89c62f8989f29c4428458096566 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:33:24 -0400 Subject: [PATCH 13/24] [nll] librustc_llvm: enable feature(nll) for bootstrap --- src/librustc_llvm/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index ffa97bd6fa59d..387660473a887 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![cfg_attr(not(stage0), feature(nll))] #![feature(static_nobundle)] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", From 588dbed3925a3e48e1d50d25bf8cb282b53cf41d Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:33:50 -0400 Subject: [PATCH 14/24] [nll] librustc_lsan: enable feature(nll) for bootstrap --- src/librustc_lsan/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_lsan/lib.rs b/src/librustc_lsan/lib.rs index 0c78fd74a234e..b3ba86ad8a4b3 100644 --- a/src/librustc_lsan/lib.rs +++ b/src/librustc_lsan/lib.rs @@ -10,6 +10,7 @@ #![sanitizer_runtime] #![feature(alloc_system)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(sanitizer_runtime)] #![feature(staged_api)] #![no_std] From d9f2b51a89b1d802ac98636c6020f398b0606bc1 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:34:05 -0400 Subject: [PATCH 15/24] [nll] librustc_msan: enable feature(nll) for bootstrap --- src/librustc_msan/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_msan/lib.rs b/src/librustc_msan/lib.rs index 0c78fd74a234e..b3ba86ad8a4b3 100644 --- a/src/librustc_msan/lib.rs +++ b/src/librustc_msan/lib.rs @@ -10,6 +10,7 @@ #![sanitizer_runtime] #![feature(alloc_system)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(sanitizer_runtime)] #![feature(staged_api)] #![no_std] From 58407351dde1d42b116b0fc4c64a65fe753d96cf Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:34:31 -0400 Subject: [PATCH 16/24] [nll] librustc_platform_intrinsics: enable feature(nll) for bootstrap --- src/librustc_platform_intrinsics/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc_platform_intrinsics/lib.rs b/src/librustc_platform_intrinsics/lib.rs index b57debdd99486..d41f4cd61f763 100644 --- a/src/librustc_platform_intrinsics/lib.rs +++ b/src/librustc_platform_intrinsics/lib.rs @@ -10,6 +10,8 @@ #![allow(bad_style)] +#![cfg_attr(not(stage0), feature(nll))] + pub struct Intrinsic { pub inputs: &'static [&'static Type], pub output: &'static Type, From ac9b7be50b5009308c12ca3e161ee2d9ca1d7258 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:34:54 -0400 Subject: [PATCH 17/24] [nll] librustc_typeck: enable feature(nll) for bootstrap --- src/librustc_typeck/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index ecc167d5a1967..62f93ea20e48c 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -76,6 +76,7 @@ This API is completely unstable and subject to change. #![feature(crate_visibility_modifier)] #![feature(exhaustive_patterns)] #![feature(iterator_find_map)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(quote)] #![feature(refcell_replace_swap)] #![feature(rustc_diagnostic_macros)] From 4aced68e1835d79c01c739c1bf731d840f6f5c51 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 15:35:06 -0400 Subject: [PATCH 18/24] [nll] librustdoc: enable feature(nll) for bootstrap --- src/librustdoc/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 78ecfd13e2f96..7581965cc0cad 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -17,6 +17,7 @@ #![feature(box_patterns)] #![feature(box_syntax)] #![feature(iterator_find_map)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(set_stdio)] #![feature(slice_sort_by_cached_key)] #![feature(test)] From ef34a16c611419a1b3b3637dee5b97c4ccef1d03 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Thu, 9 Aug 2018 17:31:15 -0400 Subject: [PATCH 19/24] [nll] librustc_data_structures: remove unused mut annotation in test --- src/librustc_data_structures/indexed_set.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_data_structures/indexed_set.rs b/src/librustc_data_structures/indexed_set.rs index 2e95a45479c4f..09c734fc01b4d 100644 --- a/src/librustc_data_structures/indexed_set.rs +++ b/src/librustc_data_structures/indexed_set.rs @@ -326,7 +326,7 @@ fn test_set_up_to() { #[test] fn test_new_filled() { for i in 0..128 { - let mut idx_buf = IdxSetBuf::new_filled(i); + let idx_buf = IdxSetBuf::new_filled(i); let elems: Vec = idx_buf.iter().collect(); let expected: Vec = (0..i).collect(); assert_eq!(elems, expected); From e8d95a5ba1ebc7b4a53ec45b04e344584ac4e93a Mon Sep 17 00:00:00 2001 From: memoryruins Date: Fri, 10 Aug 2018 06:27:10 -0400 Subject: [PATCH 20/24] [nll] libstd: enable feature(nll) for bootstrap --- src/libstd/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 0bc968b6c5cda..5d463225ae93b 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -273,6 +273,7 @@ #![feature(macro_vis_matcher)] #![feature(needs_panic_runtime)] #![feature(never_type)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(exhaustive_patterns)] #![feature(on_unimplemented)] #![feature(optin_builtin_traits)] From 5d6ca8e4c52eebeca6721b2276d548a0b29984b3 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Fri, 10 Aug 2018 06:27:35 -0400 Subject: [PATCH 21/24] [nll] librustc_mir: enable feature(nll) for bootstrap --- src/librustc_mir/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 05c843096d27d..42682c34407ca 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -14,6 +14,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! */ +#![cfg_attr(not(stage0), feature(nll))] #![feature(infer_outlives_requirements)] #![feature(in_band_lifetimes)] #![feature(slice_patterns)] From 46b818e276a83b50f6f68f9f54995e4f5a474f88 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Fri, 10 Aug 2018 06:28:24 -0400 Subject: [PATCH 22/24] [nll] librustc_codegen_llvm: enable feature(nll) for bootstrap --- src/librustc_codegen_llvm/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index 9599ccfe97964..f66c83cac7c32 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -26,6 +26,7 @@ #![feature(in_band_lifetimes)] #![allow(unused_attributes)] #![feature(libc)] +#![cfg_attr(not(stage0), feature(nll))] #![feature(quote)] #![feature(range_contains)] #![feature(rustc_diagnostic_macros)] From 085535bbe1da2350fb1c58907bf63df446e03dff Mon Sep 17 00:00:00 2001 From: memoryruins Date: Fri, 10 Aug 2018 06:31:10 -0400 Subject: [PATCH 23/24] [nll] librustc_codegen_llvm: change Child signature to fix error pointed out by nll As explained by eddyb in #53221, "An &ArchiveChild doesn't point into the archive itself, it points to an owned object that itself points to the archive, and LLVMRustArchiveMemberNew copies the ArchiveChild (whereas the current signature suggests it keeps the &ArchiveChild)." --- src/librustc_codegen_llvm/llvm/ffi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index a894f8e2fdb96..68a21a537070b 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1564,7 +1564,7 @@ extern "C" { -> LLVMRustResult; pub fn LLVMRustArchiveMemberNew(Filename: *const c_char, Name: *const c_char, - Child: Option<&'a ArchiveChild>) + Child: Option<&ArchiveChild<'a>>) -> &'a mut RustArchiveMember<'a>; pub fn LLVMRustArchiveMemberFree(Member: &'a mut RustArchiveMember<'a>); From 0123ac12e28e1d8672e66404678893bd1d641714 Mon Sep 17 00:00:00 2001 From: memoryruins Date: Fri, 10 Aug 2018 06:31:40 -0400 Subject: [PATCH 24/24] [nll] librustc_codegen_llvm: remove unused mut annotation --- src/librustc_codegen_llvm/type_of.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_codegen_llvm/type_of.rs b/src/librustc_codegen_llvm/type_of.rs index 5fd4f15acd157..69d91b327283d 100644 --- a/src/librustc_codegen_llvm/type_of.rs +++ b/src/librustc_codegen_llvm/type_of.rs @@ -89,7 +89,7 @@ fn uncached_llvm_type<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, Type::struct_(cx, &[fill], packed) } Some(ref name) => { - let mut llty = Type::named_struct(cx, name); + let llty = Type::named_struct(cx, name); llty.set_struct_body(&[fill], packed); llty }