From b8a040fc5f5edc41af0ccb070239898c0c5d5484 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 25 Sep 2019 13:14:43 -0400 Subject: [PATCH 01/18] Remove tx_to_llvm_workers from TyCtxt This can be kept within the codegen backend crates entirely --- src/librustc/ty/context.rs | 11 -------- src/librustc_codegen_llvm/base.rs | 8 ++++-- src/librustc_codegen_llvm/lib.rs | 13 ++++++---- src/librustc_codegen_ssa/back/write.rs | 23 +++++++++-------- src/librustc_codegen_ssa/base.rs | 25 ++++++------------- src/librustc_codegen_ssa/traits/backend.rs | 8 +++++- src/librustc_codegen_utils/codegen_backend.rs | 2 -- src/librustc_interface/passes.rs | 6 +---- src/librustc_interface/queries.rs | 15 ----------- .../hotplug_codegen_backend/the_backend.rs | 1 - 10 files changed, 42 insertions(+), 70 deletions(-) diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index a25ef21d6978f..d45b294690c2b 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -64,7 +64,6 @@ use std::fmt; use std::mem; use std::ops::{Deref, Bound}; use std::iter; -use std::sync::mpsc; use std::sync::Arc; use rustc_target::spec::abi; use rustc_macros::HashStable; @@ -1064,14 +1063,6 @@ pub struct GlobalCtxt<'tcx> { layout_interner: ShardedHashMap<&'tcx LayoutDetails, ()>, - /// A general purpose channel to throw data out the back towards LLVM worker - /// threads. - /// - /// This is intended to only get used during the codegen phase of the compiler - /// when satisfying the query for a particular codegen unit. Internally in - /// the query it'll send data along this channel to get processed later. - pub tx_to_llvm_workers: Lock>>, - output_filenames: Arc, } @@ -1184,7 +1175,6 @@ impl<'tcx> TyCtxt<'tcx> { hir: hir_map::Map<'tcx>, on_disk_query_result_cache: query::OnDiskCache<'tcx>, crate_name: &str, - tx: mpsc::Sender>, output_filenames: &OutputFilenames, ) -> GlobalCtxt<'tcx> { let data_layout = TargetDataLayout::parse(&s.target.target).unwrap_or_else(|err| { @@ -1291,7 +1281,6 @@ impl<'tcx> TyCtxt<'tcx> { stability_interner: Default::default(), allocation_interner: Default::default(), alloc_map: Lock::new(interpret::AllocMap::new()), - tx_to_llvm_workers: Lock::new(tx), output_filenames: Arc::new(output_filenames.clone()), } } diff --git a/src/librustc_codegen_llvm/base.rs b/src/librustc_codegen_llvm/base.rs index 21c19e167cfbe..5758cdbebf7d7 100644 --- a/src/librustc_codegen_llvm/base.rs +++ b/src/librustc_codegen_llvm/base.rs @@ -103,7 +103,11 @@ pub fn iter_globals(llmod: &'ll llvm::Module) -> ValueIter<'ll> { } } -pub fn compile_codegen_unit(tcx: TyCtxt<'tcx>, cgu_name: InternedString) { +pub fn compile_codegen_unit( + tcx: TyCtxt<'tcx>, + cgu_name: InternedString, + tx_to_llvm_workers: &std::sync::mpsc::Sender>, +) { let start_time = Instant::now(); let dep_node = tcx.codegen_unit(cgu_name).codegen_dep_node(tcx); @@ -121,7 +125,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'tcx>, cgu_name: InternedString) { let cost = time_to_codegen.as_secs() * 1_000_000_000 + time_to_codegen.subsec_nanos() as u64; - submit_codegened_module_to_llvm(&LlvmCodegenBackend(()), tcx, module, cost); + submit_codegened_module_to_llvm(&LlvmCodegenBackend(()), tx_to_llvm_workers, module, cost); fn module_codegen( tcx: TyCtxt<'_>, diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index 34e39af3c39fc..2a63011c2f545 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -52,7 +52,7 @@ use syntax::ext::allocator::AllocatorKind; use syntax_pos::symbol::InternedString; pub use llvm_util::target_features; use std::any::Any; -use std::sync::{mpsc, Arc}; +use std::sync::Arc; use std::ffi::CStr; use rustc::dep_graph::DepGraph; @@ -122,8 +122,12 @@ impl ExtraBackendMethods for LlvmCodegenBackend { ) { unsafe { allocator::codegen(tcx, mods, kind) } } - fn compile_codegen_unit(&self, tcx: TyCtxt<'_>, cgu_name: InternedString) { - base::compile_codegen_unit(tcx, cgu_name); + fn compile_codegen_unit( + &self, tcx: TyCtxt<'_>, + cgu_name: InternedString, + tx: &std::sync::mpsc::Sender>, + ) { + base::compile_codegen_unit(tcx, cgu_name, tx); } fn target_machine_factory( &self, @@ -284,10 +288,9 @@ impl CodegenBackend for LlvmCodegenBackend { tcx: TyCtxt<'tcx>, metadata: EncodedMetadata, need_metadata_module: bool, - rx: mpsc::Receiver>, ) -> Box { box rustc_codegen_ssa::base::codegen_crate( - LlvmCodegenBackend(()), tcx, metadata, need_metadata_module, rx) + LlvmCodegenBackend(()), tcx, metadata, need_metadata_module) } fn join_codegen_and_link( diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs index 1a2c23ae0d4f7..3c5fbfd0f866f 100644 --- a/src/librustc_codegen_ssa/back/write.rs +++ b/src/librustc_codegen_ssa/back/write.rs @@ -376,9 +376,9 @@ pub fn start_async_codegen( backend: B, tcx: TyCtxt<'_>, metadata: EncodedMetadata, - coordinator_receive: Receiver>, total_cgus: usize, ) -> OngoingCodegen { + let (coordinator_send, coordinator_receive) = channel(); let sess = tcx.sess; let crate_name = tcx.crate_name(LOCAL_CRATE); let crate_hash = tcx.crate_hash(LOCAL_CRATE); @@ -500,7 +500,8 @@ pub fn start_async_codegen( sess.jobserver.clone(), Arc::new(modules_config), Arc::new(metadata_config), - Arc::new(allocator_config)); + Arc::new(allocator_config), + coordinator_send.clone()); OngoingCodegen { backend, @@ -511,7 +512,7 @@ pub fn start_async_codegen( linker_info, crate_info, - coordinator_send: tcx.tx_to_llvm_workers.lock().clone(), + coordinator_send, codegen_worker_receive, shared_emitter_main, future: coordinator_thread, @@ -1005,8 +1006,9 @@ fn start_executing_work( modules_config: Arc, metadata_config: Arc, allocator_config: Arc, + tx_to_llvm_workers: Sender>, ) -> thread::JoinHandle> { - let coordinator_send = tcx.tx_to_llvm_workers.lock().clone(); + let coordinator_send = tx_to_llvm_workers; let sess = tcx.sess; // Compute the set of symbols we need to retain when doing LTO (if we need to) @@ -1857,7 +1859,7 @@ impl OngoingCodegen { // These are generally cheap and won't throw off scheduling. let cost = 0; - submit_codegened_module_to_llvm(&self.backend, tcx, module, cost); + submit_codegened_module_to_llvm(&self.backend, &self.coordinator_send, module, cost); } pub fn codegen_finished(&self, tcx: TyCtxt<'_>) { @@ -1899,12 +1901,12 @@ impl OngoingCodegen { pub fn submit_codegened_module_to_llvm( _backend: &B, - tcx: TyCtxt<'_>, + tx_to_llvm_workers: &Sender>, module: ModuleCodegen, cost: u64, ) { let llvm_work_item = WorkItem::Optimize(module); - drop(tcx.tx_to_llvm_workers.lock().send(Box::new(Message::CodegenDone:: { + drop(tx_to_llvm_workers.send(Box::new(Message::CodegenDone:: { llvm_work_item, cost, }))); @@ -1912,11 +1914,11 @@ pub fn submit_codegened_module_to_llvm( pub fn submit_post_lto_module_to_llvm( _backend: &B, - tcx: TyCtxt<'_>, + tx_to_llvm_workers: &Sender>, module: CachedModuleCodegen, ) { let llvm_work_item = WorkItem::CopyPostLtoArtifacts(module); - drop(tcx.tx_to_llvm_workers.lock().send(Box::new(Message::CodegenDone:: { + drop(tx_to_llvm_workers.send(Box::new(Message::CodegenDone:: { llvm_work_item, cost: 0, }))); @@ -1925,6 +1927,7 @@ pub fn submit_post_lto_module_to_llvm( pub fn submit_pre_lto_module_to_llvm( _backend: &B, tcx: TyCtxt<'_>, + tx_to_llvm_workers: &Sender>, module: CachedModuleCodegen, ) { let filename = pre_lto_bitcode_filename(&module.name); @@ -1939,7 +1942,7 @@ pub fn submit_pre_lto_module_to_llvm( }) }; // Schedule the module to be loaded - drop(tcx.tx_to_llvm_workers.lock().send(Box::new(Message::AddImportOnlyModule:: { + drop(tx_to_llvm_workers.send(Box::new(Message::AddImportOnlyModule:: { module_data: SerializedModule::FromUncompressedFile(mmap), work_product: module.source, }))); diff --git a/src/librustc_codegen_ssa/base.rs b/src/librustc_codegen_ssa/base.rs index 98d3022a4185d..4f9e7d398a370 100644 --- a/src/librustc_codegen_ssa/base.rs +++ b/src/librustc_codegen_ssa/base.rs @@ -43,11 +43,9 @@ use crate::mir; use crate::traits::*; -use std::any::Any; use std::cmp; use std::ops::{Deref, DerefMut}; use std::time::{Instant, Duration}; -use std::sync::mpsc; use syntax_pos::Span; use syntax::attr; use rustc::hir; @@ -482,19 +480,13 @@ pub fn codegen_crate( tcx: TyCtxt<'tcx>, metadata: EncodedMetadata, need_metadata_module: bool, - rx: mpsc::Receiver>, ) -> OngoingCodegen { check_for_rustc_errors_attr(tcx); // Skip crate items and just output metadata in -Z no-codegen mode. if tcx.sess.opts.debugging_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() { - let ongoing_codegen = start_async_codegen( - backend, - tcx, - metadata, - rx, - 1); + let ongoing_codegen = start_async_codegen(backend, tcx, metadata, 1); ongoing_codegen.codegen_finished(tcx); @@ -523,12 +515,7 @@ pub fn codegen_crate( } } - let ongoing_codegen = start_async_codegen( - backend.clone(), - tcx, - metadata, - rx, - codegen_units.len()); + let ongoing_codegen = start_async_codegen(backend.clone(), tcx, metadata, codegen_units.len()); let ongoing_codegen = AbortCodegenOnDrop::(Some(ongoing_codegen)); // Codegen an allocator shim, if necessary. @@ -614,20 +601,22 @@ pub fn codegen_crate( CguReuse::No => { tcx.sess.profiler(|p| p.start_activity(format!("codegen {}", cgu.name()))); let start_time = Instant::now(); - backend.compile_codegen_unit(tcx, *cgu.name()); + backend.compile_codegen_unit(tcx, *cgu.name(), &ongoing_codegen.coordinator_send); total_codegen_time += start_time.elapsed(); tcx.sess.profiler(|p| p.end_activity(format!("codegen {}", cgu.name()))); false } CguReuse::PreLto => { - submit_pre_lto_module_to_llvm(&backend, tcx, CachedModuleCodegen { + submit_pre_lto_module_to_llvm(&backend, tcx, &ongoing_codegen.coordinator_send, + CachedModuleCodegen { name: cgu.name().to_string(), source: cgu.work_product(tcx), }); true } CguReuse::PostLto => { - submit_post_lto_module_to_llvm(&backend, tcx, CachedModuleCodegen { + submit_post_lto_module_to_llvm(&backend, &ongoing_codegen.coordinator_send, + CachedModuleCodegen { name: cgu.name().to_string(), source: cgu.work_product(tcx), }); diff --git a/src/librustc_codegen_ssa/traits/backend.rs b/src/librustc_codegen_ssa/traits/backend.rs index 9fbb44dcc9959..cb197f51460a1 100644 --- a/src/librustc_codegen_ssa/traits/backend.rs +++ b/src/librustc_codegen_ssa/traits/backend.rs @@ -8,6 +8,7 @@ use rustc::session::{Session, config}; use rustc::ty::TyCtxt; use rustc_codegen_utils::codegen_backend::CodegenBackend; use std::sync::Arc; +use std::sync::mpsc; use syntax::ext::allocator::AllocatorKind; use syntax_pos::symbol::InternedString; @@ -44,7 +45,12 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se mods: &mut Self::Module, kind: AllocatorKind, ); - fn compile_codegen_unit(&self, tcx: TyCtxt<'_>, cgu_name: InternedString); + fn compile_codegen_unit( + &self, + tcx: TyCtxt<'_>, + cgu_name: InternedString, + tx_to_llvm_workers: &mpsc::Sender>, + ); // If find_features is true this won't access `sess.crate_types` by assuming // that `is_pie_binary` is false. When we discover LLVM target features // `sess.crate_types` is uninitialized so we cannot access it. diff --git a/src/librustc_codegen_utils/codegen_backend.rs b/src/librustc_codegen_utils/codegen_backend.rs index 262cfb1658ef9..2e3af8431eed0 100644 --- a/src/librustc_codegen_utils/codegen_backend.rs +++ b/src/librustc_codegen_utils/codegen_backend.rs @@ -7,7 +7,6 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")] use std::any::Any; -use std::sync::mpsc; use syntax::symbol::Symbol; use rustc::session::Session; @@ -36,7 +35,6 @@ pub trait CodegenBackend { tcx: TyCtxt<'tcx>, metadata: EncodedMetadata, need_metadata_module: bool, - rx: mpsc::Receiver>, ) -> Box; /// This is called on the returned `Box` from `codegen_backend` diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 37b33466d70b8..6abc6e32d243b 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -54,7 +54,6 @@ use std::fs; use std::io::{self, Write}; use std::iter; use std::path::PathBuf; -use std::sync::mpsc; use std::cell::RefCell; use std::rc::Rc; @@ -816,7 +815,6 @@ pub fn create_global_ctxt( defs: hir::map::Definitions, resolutions: Resolutions, outputs: OutputFilenames, - tx: mpsc::Sender>, crate_name: &str, ) -> BoxedGlobalCtxt { let sess = compiler.session().clone(); @@ -858,7 +856,6 @@ pub fn create_global_ctxt( hir_map, query_result_on_disk_cache, &crate_name, - tx, &outputs ); @@ -1068,7 +1065,6 @@ fn encode_and_write_metadata( pub fn start_codegen<'tcx>( codegen_backend: &dyn CodegenBackend, tcx: TyCtxt<'tcx>, - rx: mpsc::Receiver>, outputs: &OutputFilenames, ) -> Box { if log_enabled!(::log::Level::Info) { @@ -1082,7 +1078,7 @@ pub fn start_codegen<'tcx>( tcx.sess.profiler(|p| p.start_activity("codegen crate")); let codegen = time(tcx.sess, "codegen", move || { - codegen_backend.codegen_crate(tcx, metadata, need_metadata_module, rx) + codegen_backend.codegen_crate(tcx, metadata, need_metadata_module) }); tcx.sess.profiler(|p| p.end_activity("codegen crate")); diff --git a/src/librustc_interface/queries.rs b/src/librustc_interface/queries.rs index ff5cd8b8c695d..cd72dc9453c7e 100644 --- a/src/librustc_interface/queries.rs +++ b/src/librustc_interface/queries.rs @@ -10,7 +10,6 @@ use rustc::ty::steal::Steal; use rustc::dep_graph::DepGraph; use std::cell::{Ref, RefMut, RefCell}; use std::rc::Rc; -use std::sync::mpsc; use std::any::Any; use std::mem; use syntax::{self, ast}; @@ -80,8 +79,6 @@ pub(crate) struct Queries { dep_graph: Query, lower_to_hir: Query<(Steal, ExpansionResult)>, prepare_outputs: Query, - codegen_channel: Query<(Steal>>, - Steal>>)>, global_ctxt: Query, ongoing_codegen: Query>, link: Query<()>, @@ -211,14 +208,6 @@ impl Compiler { }) } - pub fn codegen_channel(&self) -> Result<&Query<(Steal>>, - Steal>>)>> { - self.queries.codegen_channel.compute(|| { - let (tx, rx) = mpsc::channel(); - Ok((Steal::new(tx), Steal::new(rx))) - }) - } - pub fn global_ctxt(&self) -> Result<&Query> { self.queries.global_ctxt.compute(|| { let crate_name = self.crate_name()?.peek().clone(); @@ -226,21 +215,18 @@ impl Compiler { let hir = self.lower_to_hir()?; let hir = hir.peek(); let (ref hir_forest, ref expansion) = *hir; - let tx = self.codegen_channel()?.peek().0.steal(); Ok(passes::create_global_ctxt( self, hir_forest.steal(), expansion.defs.steal(), expansion.resolutions.steal(), outputs, - tx, &crate_name)) }) } pub fn ongoing_codegen(&self) -> Result<&Query>> { self.queries.ongoing_codegen.compute(|| { - let rx = self.codegen_channel()?.peek().1.steal(); let outputs = self.prepare_outputs()?; self.global_ctxt()?.peek_mut().enter(|tcx| { tcx.analysis(LOCAL_CRATE).ok(); @@ -251,7 +237,6 @@ impl Compiler { Ok(passes::start_codegen( &***self.codegen_backend(), tcx, - rx, &*outputs.peek() )) }) diff --git a/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs b/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs index ec1868f32d487..c1bcb8a1aa262 100644 --- a/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs +++ b/src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs @@ -64,7 +64,6 @@ impl CodegenBackend for TheBackend { tcx: TyCtxt<'tcx>, _metadata: EncodedMetadata, _need_metadata_module: bool, - _rx: mpsc::Receiver> ) -> Box { use rustc::hir::def_id::LOCAL_CRATE; From 80db06d6daa290fbc722fbae6dbfa0728ca259b5 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Tue, 24 Sep 2019 21:34:44 -0700 Subject: [PATCH 02/18] Fix ExitStatus on Fuchsia Fuchsia exit codes don't follow the convention of libc::WEXITSTATUS et al, and they are 64 bits instead of 32 bits. This gives Fuchsia its own representation of ExitStatus. Additionally, the zircon syscall structs were out of date, causing us to see bogus return codes. --- src/libstd/sys/unix/process/mod.rs | 4 +- src/libstd/sys/unix/process/process_common.rs | 51 ------------------ .../sys/unix/process/process_fuchsia.rs | 38 ++++++++++++-- src/libstd/sys/unix/process/process_unix.rs | 52 +++++++++++++++++++ src/libstd/sys/unix/process/zircon.rs | 23 ++------ 5 files changed, 93 insertions(+), 75 deletions(-) diff --git a/src/libstd/sys/unix/process/mod.rs b/src/libstd/sys/unix/process/mod.rs index 056a20345f404..553e980f08e97 100644 --- a/src/libstd/sys/unix/process/mod.rs +++ b/src/libstd/sys/unix/process/mod.rs @@ -1,5 +1,5 @@ -pub use self::process_common::{Command, ExitStatus, ExitCode, Stdio, StdioPipes}; -pub use self::process_inner::Process; +pub use self::process_common::{Command, ExitCode, Stdio, StdioPipes}; +pub use self::process_inner::{ExitStatus, Process}; pub use crate::ffi::OsString as EnvKey; mod process_common; diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs index 713d308555956..4edd2ebf8c598 100644 --- a/src/libstd/sys/unix/process/process_common.rs +++ b/src/libstd/sys/unix/process/process_common.rs @@ -393,57 +393,6 @@ impl fmt::Debug for Command { } } -/// Unix exit statuses -#[derive(PartialEq, Eq, Clone, Copy, Debug)] -pub struct ExitStatus(c_int); - -impl ExitStatus { - pub fn new(status: c_int) -> ExitStatus { - ExitStatus(status) - } - - fn exited(&self) -> bool { - unsafe { libc::WIFEXITED(self.0) } - } - - pub fn success(&self) -> bool { - self.code() == Some(0) - } - - pub fn code(&self) -> Option { - if self.exited() { - Some(unsafe { libc::WEXITSTATUS(self.0) }) - } else { - None - } - } - - pub fn signal(&self) -> Option { - if !self.exited() { - Some(unsafe { libc::WTERMSIG(self.0) }) - } else { - None - } - } -} - -impl From for ExitStatus { - fn from(a: c_int) -> ExitStatus { - ExitStatus(a) - } -} - -impl fmt::Display for ExitStatus { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if let Some(code) = self.code() { - write!(f, "exit code: {}", code) - } else { - let signal = self.signal().unwrap(); - write!(f, "signal: {}", signal) - } - } -} - #[derive(PartialEq, Eq, Clone, Copy, Debug)] pub struct ExitCode(u8); diff --git a/src/libstd/sys/unix/process/process_fuchsia.rs b/src/libstd/sys/unix/process/process_fuchsia.rs index fff9fc6b3bbc8..2b1a3ecfd70f5 100644 --- a/src/libstd/sys/unix/process/process_fuchsia.rs +++ b/src/libstd/sys/unix/process/process_fuchsia.rs @@ -1,11 +1,13 @@ +use crate::convert::TryInto; use crate::io; +use crate::fmt; use crate::mem; use crate::ptr; use crate::sys::process::zircon::{Handle, zx_handle_t}; use crate::sys::process::process_common::*; -use libc::size_t; +use libc::{c_int, size_t}; //////////////////////////////////////////////////////////////////////////////// // Command @@ -160,7 +162,7 @@ impl Process { return Err(io::Error::new(io::ErrorKind::InvalidData, "Failed to get exit status of process")); } - Ok(ExitStatus::new(proc_info.rec.return_code)) + Ok(ExitStatus(proc_info.return_code)) } pub fn try_wait(&mut self) -> io::Result> { @@ -190,6 +192,36 @@ impl Process { return Err(io::Error::new(io::ErrorKind::InvalidData, "Failed to get exit status of process")); } - Ok(Some(ExitStatus::new(proc_info.rec.return_code))) + Ok(Some(ExitStatus(proc_info.return_code))) + } +} + +#[derive(PartialEq, Eq, Clone, Copy, Debug)] +pub struct ExitStatus(i64); + +impl ExitStatus { + pub fn success(&self) -> bool { + self.code() == Some(0) + } + + pub fn code(&self) -> Option { + // FIXME: support extracting return code as an i64 + self.0.try_into().ok() + } + + pub fn signal(&self) -> Option { + None + } +} + +impl From for ExitStatus { + fn from(a: c_int) -> ExitStatus { + ExitStatus(a as i64) + } +} + +impl fmt::Display for ExitStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "exit code: {}", self.0) } } diff --git a/src/libstd/sys/unix/process/process_unix.rs b/src/libstd/sys/unix/process/process_unix.rs index e6a742bd45d0b..507dc6892613a 100644 --- a/src/libstd/sys/unix/process/process_unix.rs +++ b/src/libstd/sys/unix/process/process_unix.rs @@ -1,3 +1,4 @@ +use crate::fmt; use crate::io::{self, Error, ErrorKind}; use crate::ptr; use crate::sys::cvt; @@ -441,3 +442,54 @@ impl Process { } } } + +/// Unix exit statuses +#[derive(PartialEq, Eq, Clone, Copy, Debug)] +pub struct ExitStatus(c_int); + +impl ExitStatus { + pub fn new(status: c_int) -> ExitStatus { + ExitStatus(status) + } + + fn exited(&self) -> bool { + unsafe { libc::WIFEXITED(self.0) } + } + + pub fn success(&self) -> bool { + self.code() == Some(0) + } + + pub fn code(&self) -> Option { + if self.exited() { + Some(unsafe { libc::WEXITSTATUS(self.0) }) + } else { + None + } + } + + pub fn signal(&self) -> Option { + if !self.exited() { + Some(unsafe { libc::WTERMSIG(self.0) }) + } else { + None + } + } +} + +impl From for ExitStatus { + fn from(a: c_int) -> ExitStatus { + ExitStatus(a) + } +} + +impl fmt::Display for ExitStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if let Some(code) = self.code() { + write!(f, "exit code: {}", code) + } else { + let signal = self.signal().unwrap(); + write!(f, "signal: {}", signal) + } + } +} diff --git a/src/libstd/sys/unix/process/zircon.rs b/src/libstd/sys/unix/process/zircon.rs index 1ba48de3c0785..188a6b5f2da4a 100644 --- a/src/libstd/sys/unix/process/zircon.rs +++ b/src/libstd/sys/unix/process/zircon.rs @@ -65,29 +65,14 @@ impl Drop for Handle { } } -// Common ZX_INFO header -#[derive(Default)] -#[repr(C)] -pub struct zx_info_header_t { - pub topic: u32, // identifies the info struct - pub avail_topic_size: u16, // “native” size of the struct - pub topic_size: u16, // size of the returned struct (<=topic_size) - pub avail_count: u32, // number of records the kernel has - pub count: u32, // number of records returned (limited by buffer size) -} - -#[derive(Default)] -#[repr(C)] -pub struct zx_record_process_t { - pub return_code: c_int, -} - // Returned for topic ZX_INFO_PROCESS #[derive(Default)] #[repr(C)] pub struct zx_info_process_t { - pub hdr: zx_info_header_t, - pub rec: zx_record_process_t, + pub return_code: i64, + pub started: bool, + pub exited: bool, + pub debugger_attached: bool, } extern { From 5418e15a50d033474ef8868468ba0604b63ca471 Mon Sep 17 00:00:00 2001 From: Haoran Wang Date: Wed, 25 Sep 2019 17:22:46 -0400 Subject: [PATCH 03/18] Fix issue #64732 Based on issue #64732, when creating a byte literal with single quotes, the suggestion message would indicate that you meant to write a `str` literal, but we actually meant to write a byte string literal. So I changed the unescape_error_reporting.rs to decide whether to print out "if you meant to write a `str` literal, use double quotes", or "if you meant to write a byte string literal, use double quotes". --- src/libsyntax/parse/unescape_error_reporting.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libsyntax/parse/unescape_error_reporting.rs b/src/libsyntax/parse/unescape_error_reporting.rs index 7eee07e61a95d..5565015179c2d 100644 --- a/src/libsyntax/parse/unescape_error_reporting.rs +++ b/src/libsyntax/parse/unescape_error_reporting.rs @@ -47,6 +47,12 @@ pub(crate) fn emit_unescape_error( .emit(); } EscapeError::MoreThanOneChar => { + let msg = if mode.is_bytes() { + "if you meant to write a byte string literal, use double quotes" + } else { + "if you meant to write a `str` literal, use double quotes" + }; + handler .struct_span_err( span_with_quotes, @@ -54,7 +60,7 @@ pub(crate) fn emit_unescape_error( ) .span_suggestion( span_with_quotes, - "if you meant to write a `str` literal, use double quotes", + msg, format!("\"{}\"", lit), Applicability::MachineApplicable, ).emit() From a048447ff42c0e7c793aa33c92aa8daf61576b71 Mon Sep 17 00:00:00 2001 From: Haoran Wang Date: Wed, 25 Sep 2019 20:18:25 -0400 Subject: [PATCH 04/18] Add test case for issue #64732 --- src/test/ui/issues/issue-64732.rs | 9 +++++++++ src/test/ui/issues/issue-64732.stderr | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/test/ui/issues/issue-64732.rs create mode 100644 src/test/ui/issues/issue-64732.stderr diff --git a/src/test/ui/issues/issue-64732.rs b/src/test/ui/issues/issue-64732.rs new file mode 100644 index 0000000000000..2db51ea6042aa --- /dev/null +++ b/src/test/ui/issues/issue-64732.rs @@ -0,0 +1,9 @@ +#![allow(unused)] +fn main() { + let _foo = b'hello\0'; + //~^ ERROR character literal may only contain one codepoint + //~| HELP if you meant to write a byte string literal, use double quotes + let _bar = 'hello'; + //~^ ERROR character literal may only contain one codepoint + //~| HELP if you meant to write a `str` literal, use double quotes +} diff --git a/src/test/ui/issues/issue-64732.stderr b/src/test/ui/issues/issue-64732.stderr new file mode 100644 index 0000000000000..fc0e8e3bdb20f --- /dev/null +++ b/src/test/ui/issues/issue-64732.stderr @@ -0,0 +1,22 @@ +error: character literal may only contain one codepoint + --> $DIR/issue-64732.rs:3:17 + | +LL | let _foo = b'hello\0'; + | ^^^^^^^^^ +help: if you meant to write a byte string literal, use double quotes + | +LL | let _foo = b"hello\0"; + | ^^^^^^^^^ + +error: character literal may only contain one codepoint + --> $DIR/issue-64732.rs:6:16 + | +LL | let _bar = 'hello'; + | ^^^^^^^ +help: if you meant to write a `str` literal, use double quotes + | +LL | let _bar = "hello"; + | ^^^^^^^ + +error: aborting due to 2 previous errors + From ece6f833dfe99db87d17c02efeaa8aac88ad302b Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 11:41:57 +0200 Subject: [PATCH 05/18] Refuse downgrading NLL errors on Rust 2015. --- src/librustc_mir/borrow_check/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 32c6dd67a4b5a..241a398a08cda 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -259,10 +259,8 @@ fn do_mir_borrowck<'a, 'tcx>( move_error_reported: BTreeMap::new(), uninitialized_error_reported: Default::default(), errors_buffer, - // Only downgrade errors on Rust 2015 and refuse to do so on Rust 2018. - // FIXME(Centril): In Rust 1.40.0, refuse doing so on 2015 as well and - // proceed to throwing out the migration infrastructure. - disable_error_downgrading: body.span.rust_2018(), + // FIXME(Centril): throw out the migration infrastructure. + disable_error_downgrading: true, nonlexical_regioncx: regioncx, used_mut: Default::default(), used_mut_upvars: SmallVec::new(), From aff9c833e5a82307b79302c48ce2d245d56c3031 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 11:54:50 +0200 Subject: [PATCH 06/18] rustc_mir: remove dead code for downgrading errors. --- .../borrow_check/conflict_errors.rs | 3 - src/librustc_mir/borrow_check/mod.rs | 56 +------------------ 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/src/librustc_mir/borrow_check/conflict_errors.rs b/src/librustc_mir/borrow_check/conflict_errors.rs index 599a0ad0d0c52..b828317c57ba8 100644 --- a/src/librustc_mir/borrow_check/conflict_errors.rs +++ b/src/librustc_mir/borrow_check/conflict_errors.rs @@ -105,9 +105,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { format!("{} occurs due to use{}", desired_action.as_noun(), use_spans.describe()), ); - // This error should not be downgraded to a warning, - // even in migrate mode. - self.disable_error_downgrading(); err.buffer(&mut self.errors_buffer); } else { if let Some((reported_place, _)) = self.move_error_reported.get(&move_out_indices) { diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index 241a398a08cda..1c842eac474f9 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -7,7 +7,6 @@ use rustc::hir::def_id::DefId; use rustc::infer::InferCtxt; use rustc::lint::builtin::UNUSED_MUT; use rustc::lint::builtin::{MUTABLE_BORROW_RESERVATION_CONFLICT}; -use rustc::middle::borrowck::SignalledError; use rustc::mir::{AggregateKind, BasicBlock, BorrowCheckResult, BorrowKind}; use rustc::mir::{ ClearCrossCrate, Local, Location, Body, Mutability, Operand, Place, PlaceBase, PlaceElem, @@ -18,7 +17,7 @@ use rustc::mir::{Terminator, TerminatorKind}; use rustc::ty::query::Providers; use rustc::ty::{self, TyCtxt}; -use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, Level}; +use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder}; use rustc_data_structures::bit_set::BitSet; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::graph::dominators::Dominators; @@ -259,8 +258,6 @@ fn do_mir_borrowck<'a, 'tcx>( move_error_reported: BTreeMap::new(), uninitialized_error_reported: Default::default(), errors_buffer, - // FIXME(Centril): throw out the migration infrastructure. - disable_error_downgrading: true, nonlexical_regioncx: regioncx, used_mut: Default::default(), used_mut_upvars: SmallVec::new(), @@ -372,33 +369,6 @@ fn do_mir_borrowck<'a, 'tcx>( if !mbcx.errors_buffer.is_empty() { mbcx.errors_buffer.sort_by_key(|diag| diag.span.primary_span()); - if !mbcx.disable_error_downgrading && tcx.migrate_borrowck() { - // When borrowck=migrate, check if AST-borrowck would - // error on the given code. - - // rust-lang/rust#55492, rust-lang/rust#58776 check the base def id - // for errors. AST borrowck is responsible for aggregating - // `signalled_any_error` from all of the nested closures here. - let base_def_id = tcx.closure_base_def_id(def_id); - - match tcx.borrowck(base_def_id).signalled_any_error { - SignalledError::NoErrorsSeen => { - // if AST-borrowck signalled no errors, then - // downgrade all the buffered MIR-borrowck errors - // to warnings. - - for err in mbcx.errors_buffer.iter_mut() { - downgrade_if_error(err); - } - } - SignalledError::SawSomeError => { - // if AST-borrowck signalled a (cancelled) error, - // then we will just emit the buffered - // MIR-borrowck errors as normal. - } - } - } - for diag in mbcx.errors_buffer.drain(..) { mbcx.infcx.tcx.sess.diagnostic().emit_diagnostic(&diag); } @@ -414,21 +384,6 @@ fn do_mir_borrowck<'a, 'tcx>( result } -fn downgrade_if_error(diag: &mut Diagnostic) { - if diag.is_error() { - diag.level = Level::Warning; - diag.warn( - "this error has been downgraded to a warning for backwards \ - compatibility with previous releases", - ).warn( - "this represents potential undefined behavior in your code and \ - this warning will become a hard error in the future", - ).note( - "for more information, try `rustc --explain E0729`" - ); - } -} - crate struct MirBorrowckCtxt<'cx, 'tcx> { crate infcx: &'cx InferCtxt<'cx, 'tcx>, body: &'cx Body<'tcx>, @@ -489,9 +444,6 @@ crate struct MirBorrowckCtxt<'cx, 'tcx> { uninitialized_error_reported: FxHashSet>, /// Errors to be reported buffer errors_buffer: Vec, - /// If there are no errors reported by the HIR borrow checker, we downgrade - /// all NLL errors to warnings. Setting this flag disables downgrading. - disable_error_downgrading: bool, /// This field keeps track of all the local variables that are declared mut and are mutated. /// Used for the warning issued by an unused mutable local variable. used_mut: FxHashSet, @@ -932,12 +884,6 @@ impl InitializationRequiringAction { } impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { - /// If there are no errors reported by the HIR borrow checker, we downgrade - /// all NLL errors to warnings. Calling this disables downgrading. - crate fn disable_error_downgrading(&mut self) { - self.disable_error_downgrading = true; - } - /// Checks an access to the given place to see if it is allowed. Examines the set of borrows /// that are in scope, as well as which paths have been initialized, to ensure that (a) the /// place is initialized and (b) it is not borrowed in some way that would prevent this From 6ec9b3a0b6510fcac75bd60e5a317de7f29310ef Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 15:47:50 +0200 Subject: [PATCH 07/18] Adjust & --bless tests due to no longer downgrading NLL errors on 2015. --- .../borrowck-anon-fields-variant.nll.stderr | 40 -- .../borrowck/borrowck-anon-fields-variant.rs | 4 +- .../borrowck-anon-fields-variant.stderr | 12 +- .../borrowck-describe-lvalue.nll.stderr | 366 ------------------ .../ui/borrowck/borrowck-describe-lvalue.rs | 12 +- .../borrowck/borrowck-describe-lvalue.stderr | 30 +- .../borrowck-migrate-to-nll.edition.stderr | 14 - .../ui/borrowck/borrowck-migrate-to-nll.rs | 36 -- .../borrowck-migrate-to-nll.zflag.stderr | 15 - .../min_const_fn/min_const_fn.nll.stderr | 328 ---------------- .../ui/consts/min_const_fn/min_const_fn.rs | 4 +- .../consts/min_const_fn/min_const_fn.stderr | 14 +- .../min_const_fn/min_const_fn_dyn.nll.stderr | 31 -- .../consts/min_const_fn/min_const_fn_dyn.rs | 4 +- .../min_const_fn/min_const_fn_dyn.stderr | 8 +- src/test/ui/feature-gates/feature-gate-nll.rs | 14 +- .../ui/feature-gates/feature-gate-nll.stderr | 20 +- .../ui/issues/issue-40510-1.migrate.stderr | 11 +- src/test/ui/issues/issue-40510-1.nll.stderr | 2 +- src/test/ui/issues/issue-40510-1.rs | 11 +- ...igrate.nll.stderr => issue-40510-1.stderr} | 2 +- .../ui/issues/issue-40510-3.migrate.stderr | 11 +- src/test/ui/issues/issue-40510-3.nll.stderr | 2 +- src/test/ui/issues/issue-40510-3.rs | 11 +- ...igrate.nll.stderr => issue-40510-3.stderr} | 2 +- ...96-scribble-on-boxed-borrow.migrate.stderr | 32 +- .../issue-45696-scribble-on-boxed-borrow.rs | 43 +- ...ssue-45696-scribble-on-boxed-borrow.stderr | 33 ++ src/test/ui/issues/issue-49824.nll.stderr | 18 - src/test/ui/issues/issue-49824.rs | 10 +- src/test/ui/issues/issue-49824.stderr | 21 +- .../ui/nll/borrowed-referent-issue-38899.rs | 2 - .../nll/borrowed-referent-issue-38899.stderr | 2 +- .../pattern-bindings-after-at.nll.stderr | 22 -- .../ui/pattern/pattern-bindings-after-at.rs | 4 +- .../pattern/pattern-bindings-after-at.stderr | 8 +- src/test/ui/thread-local-in-ctfe.nll.stderr | 49 --- src/test/ui/thread-local-in-ctfe.rs | 8 +- src/test/ui/thread-local-in-ctfe.stderr | 22 +- 39 files changed, 104 insertions(+), 1174 deletions(-) delete mode 100644 src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr delete mode 100644 src/test/ui/borrowck/borrowck-describe-lvalue.nll.stderr delete mode 100644 src/test/ui/borrowck/borrowck-migrate-to-nll.edition.stderr delete mode 100644 src/test/ui/borrowck/borrowck-migrate-to-nll.rs delete mode 100644 src/test/ui/borrowck/borrowck-migrate-to-nll.zflag.stderr delete mode 100644 src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr delete mode 100644 src/test/ui/consts/min_const_fn/min_const_fn_dyn.nll.stderr rename src/test/ui/issues/{issue-40510-1.migrate.nll.stderr => issue-40510-1.stderr} (93%) rename src/test/ui/issues/{issue-40510-3.migrate.nll.stderr => issue-40510-3.stderr} (94%) create mode 100644 src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr delete mode 100644 src/test/ui/issues/issue-49824.nll.stderr delete mode 100644 src/test/ui/pattern/pattern-bindings-after-at.nll.stderr delete mode 100644 src/test/ui/thread-local-in-ctfe.nll.stderr diff --git a/src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr b/src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr deleted file mode 100644 index f66994b3f100a..0000000000000 --- a/src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr +++ /dev/null @@ -1,40 +0,0 @@ -error[E0503]: cannot use `y` because it was mutably borrowed - --> $DIR/borrowck-anon-fields-variant.rs:17:7 - | -LL | Foo::Y(ref mut a, _) => a, - | --------- borrow of `y.0` occurs here -... -LL | Foo::Y(_, ref mut b) => b, - | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0` -... -LL | *a += 1; - | ------- borrow later used here - -error[E0503]: cannot use `y` because it was mutably borrowed - --> $DIR/borrowck-anon-fields-variant.rs:37:7 - | -LL | Foo::Y(ref mut a, _) => a, - | --------- borrow of `y.0` occurs here -... -LL | Foo::Y(ref mut b, _) => b, - | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0` -... -LL | *a += 1; - | ------- borrow later used here - -error[E0499]: cannot borrow `y.0` as mutable more than once at a time - --> $DIR/borrowck-anon-fields-variant.rs:37:14 - | -LL | Foo::Y(ref mut a, _) => a, - | --------- first mutable borrow occurs here -... -LL | Foo::Y(ref mut b, _) => b, - | ^^^^^^^^^ second mutable borrow occurs here -... -LL | *a += 1; - | ------- first borrow later used here - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0499, E0503. -For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/borrowck/borrowck-anon-fields-variant.rs b/src/test/ui/borrowck/borrowck-anon-fields-variant.rs index 695809f58c551..cecc278e1931c 100644 --- a/src/test/ui/borrowck/borrowck-anon-fields-variant.rs +++ b/src/test/ui/borrowck/borrowck-anon-fields-variant.rs @@ -15,9 +15,7 @@ fn distinct_variant() { // reference. let b = match y { Foo::Y(_, ref mut b) => b, - //~^ WARNING cannot use `y` - //~| WARNING this error has been downgraded to a warning - //~| WARNING this warning will become a hard error in the future + //~^ ERROR cannot use `y` Foo::X => panic!() }; diff --git a/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr b/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr index e2d3e417ac3ac..2caeed1bd44ea 100644 --- a/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr +++ b/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr @@ -1,4 +1,4 @@ -warning[E0503]: cannot use `y` because it was mutably borrowed +error[E0503]: cannot use `y` because it was mutably borrowed --> $DIR/borrowck-anon-fields-variant.rs:17:7 | LL | Foo::Y(ref mut a, _) => a, @@ -9,13 +9,9 @@ LL | Foo::Y(_, ref mut b) => b, ... LL | *a += 1; | ------- borrow later used here - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` error[E0503]: cannot use `y` because it was mutably borrowed - --> $DIR/borrowck-anon-fields-variant.rs:37:7 + --> $DIR/borrowck-anon-fields-variant.rs:35:7 | LL | Foo::Y(ref mut a, _) => a, | --------- borrow of `y.0` occurs here @@ -27,7 +23,7 @@ LL | *a += 1; | ------- borrow later used here error[E0499]: cannot borrow `y.0` as mutable more than once at a time - --> $DIR/borrowck-anon-fields-variant.rs:37:14 + --> $DIR/borrowck-anon-fields-variant.rs:35:14 | LL | Foo::Y(ref mut a, _) => a, | --------- first mutable borrow occurs here @@ -38,7 +34,7 @@ LL | Foo::Y(ref mut b, _) => b, LL | *a += 1; | ------- first borrow later used here -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors Some errors have detailed explanations: E0499, E0503. For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.nll.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.nll.stderr deleted file mode 100644 index 20f05353d4633..0000000000000 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.nll.stderr +++ /dev/null @@ -1,366 +0,0 @@ -error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-describe-lvalue.rs:262:13 - | -LL | let y = &mut x; - | ------ first mutable borrow occurs here -LL | &mut x; - | ^^^^^^ second mutable borrow occurs here -LL | *y = 1; - | ------ first borrow later used here - -error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-describe-lvalue.rs:272:20 - | -LL | let y = &mut x; - | ------ first mutable borrow occurs here -LL | &mut x; - | ^^^^^^ second mutable borrow occurs here -LL | *y = 1; - | ------ first borrow later used here - -error: captured variable cannot escape `FnMut` closure body - --> $DIR/borrowck-describe-lvalue.rs:270:16 - | -LL | || { - | - inferred to be a `FnMut` closure -LL | / || { -LL | | let y = &mut x; -LL | | &mut x; -LL | | *y = 1; -LL | | drop(y); -LL | | } - | |_________________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body - | - = note: `FnMut` closures only have access to their captured variables while they are executing... - = note: ...therefore, they cannot allow references to captured variables to escape - -error[E0503]: cannot use `f.x` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:41:9 - | -LL | let x = f.x(); - | - borrow of `f` occurs here -LL | f.x; - | ^^^ use of borrowed `f` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `g.0` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:48:9 - | -LL | let x = g.x(); - | - borrow of `g` occurs here -LL | g.0; - | ^^^ use of borrowed `g` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `h.0` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:55:9 - | -LL | let x = &mut h.0; - | -------- borrow of `h.0` occurs here -LL | h.0; - | ^^^ use of borrowed `h.0` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `e.0` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:63:20 - | -LL | let x = e.x(); - | - borrow of `e` occurs here -LL | match e { -LL | Baz::X(value) => value - | ^^^^^ use of borrowed `e` -LL | }; -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `u.a` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:71:9 - | -LL | let x = &mut u.a; - | -------- borrow of `u.a` occurs here -LL | u.a; - | ^^^ use of borrowed `u.a` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `f.x` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:78:9 - | -LL | let x = f.x(); - | - borrow of `*f` occurs here -LL | f.x; - | ^^^ use of borrowed `*f` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `g.0` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:85:9 - | -LL | let x = g.x(); - | - borrow of `*g` occurs here -LL | g.0; - | ^^^ use of borrowed `*g` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `h.0` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:92:9 - | -LL | let x = &mut h.0; - | -------- borrow of `h.0` occurs here -LL | h.0; - | ^^^ use of borrowed `h.0` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `e.0` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:100:20 - | -LL | let x = e.x(); - | - borrow of `*e` occurs here -LL | match *e { -LL | Baz::X(value) => value - | ^^^^^ use of borrowed `*e` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `u.a` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:109:9 - | -LL | let x = &mut u.a; - | -------- borrow of `u.a` occurs here -LL | u.a; - | ^^^ use of borrowed `u.a` -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:117:15 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -LL | match v { -LL | &[x, _, .., _, _] => println!("{}", x), - | ^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:122:18 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -... -LL | &[_, x, .., _, _] => println!("{}", x), - | ^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:127:25 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -... -LL | &[_, _, .., x, _] => println!("{}", x), - | ^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:132:28 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -... -LL | &[_, _, .., _, x] => println!("{}", x), - | ^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:143:15 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -LL | match v { -LL | &[x @ ..] => println!("{:?}", x), - | ^^^^^^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:148:18 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -... -LL | &[_, x @ ..] => println!("{:?}", x), - | ^^^^^^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:153:15 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -... -LL | &[x @ .., _] => println!("{:?}", x), - | ^^^^^^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[..]` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:158:18 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -... -LL | &[_, x @ .., _] => println!("{:?}", x), - | ^^^^^^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `e` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:171:13 - | -LL | let x = &mut e; - | ------ borrow of `e` occurs here -LL | match e { -LL | E::A(ref ax) => - | ^^^^^^^^^^^^ use of borrowed `e` -... -LL | drop(x); - | - borrow later used here - -error[E0502]: cannot borrow `e.0` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:171:18 - | -LL | let x = &mut e; - | ------ mutable borrow occurs here -LL | match e { -LL | E::A(ref ax) => - | ^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error[E0502]: cannot borrow `e.x` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:175:23 - | -LL | let x = &mut e; - | ------ mutable borrow occurs here -... -LL | E::B { x: ref bx } => - | ^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error[E0502]: cannot borrow `s.y.0` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:188:22 - | -LL | let x = &mut s; - | ------ mutable borrow occurs here -LL | match s { -LL | S { y: (ref y0, _), .. } => - | ^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error[E0502]: cannot borrow `s.x.y` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:194:28 - | -LL | let x = &mut s; - | ------ mutable borrow occurs here -... -LL | S { x: F { y: ref x0, .. }, .. } => - | ^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error[E0503]: cannot use `*v` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:240:9 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -LL | v[0].y; - | ^^^^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0503]: cannot use `v[_].y` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:240:9 - | -LL | let x = &mut v; - | ------ borrow of `v` occurs here -LL | v[0].y; - | ^^^^^^ use of borrowed `v` -... -LL | drop(x); - | - borrow later used here - -error[E0502]: cannot borrow `v[..].x` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:251:24 - | -LL | let x = &mut v; - | ------ mutable borrow occurs here -LL | match v { -LL | &[_, F {x: ref xf, ..}] => println!("{}", xf), - | ^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:210:29 - | -LL | let x = &mut block; - | ---------- mutable borrow occurs here -LL | let p: &'a u8 = &*block.current; - | ^^^^^^^^^^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:227:33 - | -LL | let x = &mut block; - | ---------- mutable borrow occurs here -LL | let p : *const u8 = &*(*block).current; - | ^^^^^^^^^^^^^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error[E0382]: use of moved value: `x` - --> $DIR/borrowck-describe-lvalue.rs:282:22 - | -LL | drop(x); - | - value moved here -LL | drop(x); - | ^ value used here after move - | - = note: move occurs because `x` has type `std::vec::Vec`, which does not implement the `Copy` trait - -error: aborting due to 32 previous errors - -Some errors have detailed explanations: E0382, E0499, E0502, E0503. -For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.rs b/src/test/ui/borrowck/borrowck-describe-lvalue.rs index c27d9519dc798..8425960aa8600 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.rs +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.rs @@ -208,10 +208,8 @@ fn main() { fn bump<'a>(mut block: &mut Block<'a>) { let x = &mut block; let p: &'a u8 = &*block.current; - //~^ WARNING cannot borrow `*block.current` as immutable because it is also borrowed as mutable - //~| this error has been downgraded - //~| this warning will become a hard error in the future - // Warning because of issue rust#38899 + //~^ ERROR cannot borrow `*block.current` as immutable because it is also borrowed as mutable + // See issue rust#38899 drop(x); } } @@ -225,10 +223,8 @@ fn main() { unsafe fn bump2(mut block: *mut Block2) { let x = &mut block; let p : *const u8 = &*(*block).current; - //~^ WARNING cannot borrow `*block.current` as immutable because it is also borrowed as mutable - //~| this error has been downgraded - //~| this warning will become a hard error in the future - // Warning because of issue rust#38899 + //~^ ERROR cannot borrow `*block.current` as immutable because it is also borrowed as mutable + // See issue rust#38899 drop(x); } } diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr index 38d847a90ff95..4213523d2fa4b 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-describe-lvalue.rs:262:13 + --> $DIR/borrowck-describe-lvalue.rs:258:13 | LL | let y = &mut x; | ------ first mutable borrow occurs here @@ -9,7 +9,7 @@ LL | *y = 1; | ------ first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-describe-lvalue.rs:272:20 + --> $DIR/borrowck-describe-lvalue.rs:268:20 | LL | let y = &mut x; | ------ first mutable borrow occurs here @@ -19,7 +19,7 @@ LL | *y = 1; | ------ first borrow later used here error: captured variable cannot escape `FnMut` closure body - --> $DIR/borrowck-describe-lvalue.rs:270:16 + --> $DIR/borrowck-describe-lvalue.rs:266:16 | LL | || { | - inferred to be a `FnMut` closure @@ -295,7 +295,7 @@ LL | drop(x); | - mutable borrow later used here error[E0503]: cannot use `*v` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:240:9 + --> $DIR/borrowck-describe-lvalue.rs:236:9 | LL | let x = &mut v; | ------ borrow of `v` occurs here @@ -306,7 +306,7 @@ LL | drop(x); | - borrow later used here error[E0503]: cannot use `v[_].y` because it was mutably borrowed - --> $DIR/borrowck-describe-lvalue.rs:240:9 + --> $DIR/borrowck-describe-lvalue.rs:236:9 | LL | let x = &mut v; | ------ borrow of `v` occurs here @@ -317,7 +317,7 @@ LL | drop(x); | - borrow later used here error[E0502]: cannot borrow `v[..].x` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:251:24 + --> $DIR/borrowck-describe-lvalue.rs:247:24 | LL | let x = &mut v; | ------ mutable borrow occurs here @@ -328,7 +328,7 @@ LL | &[_, F {x: ref xf, ..}] => println!("{}", xf), LL | drop(x); | - mutable borrow later used here -warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable +error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable --> $DIR/borrowck-describe-lvalue.rs:210:29 | LL | let x = &mut block; @@ -338,13 +338,9 @@ LL | let p: &'a u8 = &*block.current; ... LL | drop(x); | - mutable borrow later used here - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` -warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-describe-lvalue.rs:227:33 +error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:225:33 | LL | let x = &mut block; | ---------- mutable borrow occurs here @@ -353,13 +349,9 @@ LL | let p : *const u8 = &*(*block).current; ... LL | drop(x); | - mutable borrow later used here - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` error[E0382]: use of moved value: `x` - --> $DIR/borrowck-describe-lvalue.rs:282:22 + --> $DIR/borrowck-describe-lvalue.rs:278:22 | LL | drop(x); | - value moved here @@ -368,7 +360,7 @@ LL | drop(x); | = note: move occurs because `x` has type `std::vec::Vec`, which does not implement the `Copy` trait -error: aborting due to 30 previous errors +error: aborting due to 32 previous errors Some errors have detailed explanations: E0382, E0499, E0502, E0503. For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/borrowck/borrowck-migrate-to-nll.edition.stderr b/src/test/ui/borrowck/borrowck-migrate-to-nll.edition.stderr deleted file mode 100644 index 58f2cadcc6573..0000000000000 --- a/src/test/ui/borrowck/borrowck-migrate-to-nll.edition.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-migrate-to-nll.rs:29:21 - | -LL | let x = &mut block; - | ---------- mutable borrow occurs here -LL | let p: &'a u8 = &*block.current; - | ^^^^^^^^^^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/borrowck/borrowck-migrate-to-nll.rs b/src/test/ui/borrowck/borrowck-migrate-to-nll.rs deleted file mode 100644 index 6587dfdbc03f3..0000000000000 --- a/src/test/ui/borrowck/borrowck-migrate-to-nll.rs +++ /dev/null @@ -1,36 +0,0 @@ -// This is a test of the borrowck migrate mode. It leverages #38899, a -// bug that is fixed by NLL: this code is (unsoundly) accepted by -// AST-borrowck, but is correctly rejected by the NLL borrowck. -// -// Therefore, for backwards-compatiblity, under borrowck=migrate the -// NLL checks will be emitted as *warnings*. -// -// In Rust 2018, no errors will be downgraded to warnings. - -// NLL mode makes this compile-fail; we cannot currently encode a -// test that is run-pass or compile-fail based on compare-mode. So -// just ignore it instead: - -// ignore-compare-mode-nll -// ignore-compare-mode-polonius - -// revisions: zflag edition -//[zflag]compile-flags: -Z borrowck=migrate -//[edition]edition:2018 -//[zflag] check-pass - -pub struct Block<'a> { - current: &'a u8, - unrelated: &'a u8, -} - -fn bump<'a>(mut block: &mut Block<'a>) { - let x = &mut block; - let p: &'a u8 = &*block.current; - //[edition]~^ ERROR cannot borrow `*block.current` as immutable - // (use `x` and `p` so enabling NLL doesn't assign overly short lifetimes) - drop(x); - drop(p); -} - -fn main() {} diff --git a/src/test/ui/borrowck/borrowck-migrate-to-nll.zflag.stderr b/src/test/ui/borrowck/borrowck-migrate-to-nll.zflag.stderr deleted file mode 100644 index ace336a3bf32a..0000000000000 --- a/src/test/ui/borrowck/borrowck-migrate-to-nll.zflag.stderr +++ /dev/null @@ -1,15 +0,0 @@ -warning[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-migrate-to-nll.rs:29:21 - | -LL | let x = &mut block; - | ---------- mutable borrow occurs here -LL | let p: &'a u8 = &*block.current; - | ^^^^^^^^^^^^^^^ immutable borrow occurs here -... -LL | drop(x); - | - mutable borrow later used here - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` - diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr b/src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr deleted file mode 100644 index 4b43a0d0a1a1b..0000000000000 --- a/src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr +++ /dev/null @@ -1,328 +0,0 @@ -error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/min_const_fn.rs:37:25 - | -LL | const fn into_inner(self) -> T { self.0 } - | ^^^^ constant functions cannot evaluate destructors - -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:39:36 - | -LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 } - | ^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/min_const_fn.rs:44:28 - | -LL | const fn into_inner_lt(self) -> T { self.0 } - | ^^^^ constant functions cannot evaluate destructors - -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:46:42 - | -LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } - | ^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/min_const_fn.rs:51:27 - | -LL | const fn into_inner_s(self) -> T { self.0 } - | ^^^^ constant functions cannot evaluate destructors - -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:53:38 - | -LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } - | ^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:58:39 - | -LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } - | ^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:76:16 - | -LL | const fn foo11(t: T) -> T { t } - | ^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:78:18 - | -LL | const fn foo11_2(t: T) -> T { t } - | ^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_fn.rs:80:33 - | -LL | const fn foo19(f: f32) -> f32 { f * 2.0 } - | ^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_fn.rs:82:35 - | -LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f } - | ^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: only int and `bool` operations are stable in const fn - --> $DIR/min_const_fn.rs:84:35 - | -LL | const fn foo19_3(f: f32) -> f32 { -f } - | ^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: only int, `bool` and `char` operations are stable in const fn - --> $DIR/min_const_fn.rs:86:43 - | -LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g } - | ^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: cannot access `static` items in const fn - --> $DIR/min_const_fn.rs:90:27 - | -LL | const fn foo25() -> u32 { BAR } - | ^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: cannot access `static` items in const fn - --> $DIR/min_const_fn.rs:91:36 - | -LL | const fn foo26() -> &'static u32 { &BAR } - | ^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: casting pointers to ints is unstable in const fn - --> $DIR/min_const_fn.rs:92:42 - | -LL | const fn foo30(x: *const u32) -> usize { x as usize } - | ^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: casting pointers to ints is unstable in const fn - --> $DIR/min_const_fn.rs:94:63 - | -LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } } - | ^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: casting pointers to ints is unstable in const fn - --> $DIR/min_const_fn.rs:96:42 - | -LL | const fn foo30_2(x: *mut u32) -> usize { x as usize } - | ^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: casting pointers to ints is unstable in const fn - --> $DIR/min_const_fn.rs:98:63 - | -LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } } - | ^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: loops and conditional expressions are not stable in const fn - --> $DIR/min_const_fn.rs:100:38 - | -LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } } - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: loops are not allowed in const fn - --> $DIR/min_const_fn.rs:102:29 - | -LL | const fn foo30_5(b: bool) { while b { } } - | ^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: loops and conditional expressions are not stable in const fn - --> $DIR/min_const_fn.rs:105:44 - | -LL | const fn foo36(a: bool, b: bool) -> bool { a && b } - | ^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: loops and conditional expressions are not stable in const fn - --> $DIR/min_const_fn.rs:107:44 - | -LL | const fn foo37(a: bool, b: bool) -> bool { a || b } - | ^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: mutable references in const fn are unstable - --> $DIR/min_const_fn.rs:109:14 - | -LL | const fn inc(x: &mut i32) { *x += 1 } - | ^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:114:6 - | -LL | impl Foo { - | ^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:119:6 - | -LL | impl Foo { - | ^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:124:6 - | -LL | impl Foo { - | ^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: `impl Trait` in const fn is unstable - --> $DIR/min_const_fn.rs:130:24 - | -LL | const fn no_rpit2() -> AlanTuring { AlanTuring(0) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:132:34 - | -LL | const fn no_apit2(_x: AlanTuring) {} - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:134:22 - | -LL | const fn no_apit(_x: impl std::fmt::Debug) {} - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: `impl Trait` in const fn is unstable - --> $DIR/min_const_fn.rs:135:23 - | -LL | const fn no_rpit() -> impl std::fmt::Debug {} - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:136:23 - | -LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} - | ^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:137:32 - | -LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0515]: cannot return reference to temporary value - --> $DIR/min_const_fn.rs:137:63 - | -LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } - | ^-- - | || - | |temporary value created here - | returns a reference to data owned by the current function - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:145:41 - | -LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn.rs:148:21 - | -LL | const fn no_fn_ptrs(_x: fn()) {} - | ^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn.rs:150:27 - | -LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo } - | ^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error: aborting due to 37 previous errors - -Some errors have detailed explanations: E0515, E0723. -For more information about an error, try `rustc --explain E0515`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.rs b/src/test/ui/consts/min_const_fn/min_const_fn.rs index 8b423da788292..d0f63b148ff2b 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn.rs @@ -136,9 +136,7 @@ const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized` const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } //~^ ERROR trait bounds other than `Sized` -//~| WARNING cannot return reference to temporary value -//~| WARNING this error has been downgraded to a warning -//~| WARNING this warning will become a hard error in the future +//~| ERROR cannot return reference to temporary value const fn no_unsafe() { unsafe {} } diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.stderr b/src/test/ui/consts/min_const_fn/min_const_fn.stderr index 211902b687b1b..7919cfe987cfc 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn.stderr @@ -286,7 +286,7 @@ LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 = help: add `#![feature(const_fn)]` to the crate attributes to enable -warning[E0515]: cannot return reference to temporary value +error[E0515]: cannot return reference to temporary value --> $DIR/min_const_fn.rs:137:63 | LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } @@ -294,13 +294,9 @@ LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } | || | |temporary value created here | returns a reference to data owned by the current function - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn.rs:145:41 + --> $DIR/min_const_fn.rs:143:41 | LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -309,7 +305,7 @@ LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 = help: add `#![feature(const_fn)]` to the crate attributes to enable error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn.rs:148:21 + --> $DIR/min_const_fn.rs:146:21 | LL | const fn no_fn_ptrs(_x: fn()) {} | ^^ @@ -318,7 +314,7 @@ LL | const fn no_fn_ptrs(_x: fn()) {} = help: add `#![feature(const_fn)]` to the crate attributes to enable error[E0723]: function pointers in const fn are unstable - --> $DIR/min_const_fn.rs:150:27 + --> $DIR/min_const_fn.rs:148:27 | LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo } | ^^^^ @@ -326,7 +322,7 @@ LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo } = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 = help: add `#![feature(const_fn)]` to the crate attributes to enable -error: aborting due to 36 previous errors +error: aborting due to 37 previous errors Some errors have detailed explanations: E0515, E0723. For more information about an error, try `rustc --explain E0515`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.nll.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.nll.stderr deleted file mode 100644 index 0ea950d678f87..0000000000000 --- a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.nll.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn_dyn.rs:9:5 - | -LL | x.0.field; - | ^^^^^^^^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0723]: trait bounds other than `Sized` on const fn parameters are unstable - --> $DIR/min_const_fn_dyn.rs:12:66 - | -LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } - | ^^ - | - = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 - = help: add `#![feature(const_fn)]` to the crate attributes to enable - -error[E0716]: temporary value dropped while borrowed - --> $DIR/min_const_fn_dyn.rs:12:67 - | -LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } - | -^ - temporary value is freed at the end of this statement - | || - | |creates a temporary which is freed while still in use - | cast requires that borrow lasts for `'static` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0716, E0723. -For more information about an error, try `rustc --explain E0716`. diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs index 75b67192f0081..3833510c0b3b5 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.rs @@ -11,8 +11,6 @@ const fn no_inner_dyn_trait2(x: Hide) { } const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } //~^ ERROR trait bounds other than `Sized` -//~| WARNING temporary value dropped while borrowed -//~| WARNING this error has been downgraded to a warning -//~| WARNING this warning will become a hard error in the future +//~| ERROR temporary value dropped while borrowed fn main() {} diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr index 02ddb0395296c..0ea950d678f87 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr +++ b/src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr @@ -16,7 +16,7 @@ LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } = note: for more information, see issue https://github.com/rust-lang/rust/issues/57563 = help: add `#![feature(const_fn)]` to the crate attributes to enable -warning[E0716]: temporary value dropped while borrowed +error[E0716]: temporary value dropped while borrowed --> $DIR/min_const_fn_dyn.rs:12:67 | LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } @@ -24,12 +24,8 @@ LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) } | || | |creates a temporary which is freed while still in use | cast requires that borrow lasts for `'static` - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors Some errors have detailed explanations: E0716, E0723. For more information about an error, try `rustc --explain E0716`. diff --git a/src/test/ui/feature-gates/feature-gate-nll.rs b/src/test/ui/feature-gates/feature-gate-nll.rs index 8ec752409ab00..fd6c5b67ef69e 100644 --- a/src/test/ui/feature-gates/feature-gate-nll.rs +++ b/src/test/ui/feature-gates/feature-gate-nll.rs @@ -1,20 +1,18 @@ // There isn't a great way to test feature(nll), since it just disables migrate -// mode and changes some error messages. We just test for migrate mode. +// mode and changes some error messages. + +// FIXME(Centril): This test is probably obsolete now and `nll` should become +// `accepted`. // Don't use compare-mode=nll, since that turns on NLL. // ignore-compare-mode-nll // ignore-compare-mode-polonius -#![feature(rustc_attrs)] - -#[rustc_error] -fn main() { //~ ERROR compilation successful +fn main() { let mut x = (33, &0); let m = &mut x; let p = &*x.1; - //~^ WARNING cannot borrow - //~| WARNING this error has been downgraded to a warning - //~| WARNING this warning will become a hard error in the future + //~^ ERROR cannot borrow m; } diff --git a/src/test/ui/feature-gates/feature-gate-nll.stderr b/src/test/ui/feature-gates/feature-gate-nll.stderr index e5b28bbfa2477..edfc22c32c936 100644 --- a/src/test/ui/feature-gates/feature-gate-nll.stderr +++ b/src/test/ui/feature-gates/feature-gate-nll.stderr @@ -1,29 +1,13 @@ -warning[E0502]: cannot borrow `*x.1` as immutable because it is also borrowed as mutable +error[E0502]: cannot borrow `*x.1` as immutable because it is also borrowed as mutable --> $DIR/feature-gate-nll.rs:15:13 | LL | let m = &mut x; | ------ mutable borrow occurs here LL | let p = &*x.1; | ^^^^^ immutable borrow occurs here -... +LL | LL | m; | - mutable borrow later used here - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` - -error: compilation successful - --> $DIR/feature-gate-nll.rs:11:1 - | -LL | / fn main() { -LL | | let mut x = (33, &0); -LL | | -LL | | let m = &mut x; -... | -LL | | m; -LL | | } - | |_^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40510-1.migrate.stderr b/src/test/ui/issues/issue-40510-1.migrate.stderr index 28aaa2a797e05..776a724d3106a 100644 --- a/src/test/ui/issues/issue-40510-1.migrate.stderr +++ b/src/test/ui/issues/issue-40510-1.migrate.stderr @@ -1,4 +1,4 @@ -warning: captured variable cannot escape `FnMut` closure body +error: captured variable cannot escape `FnMut` closure body --> $DIR/issue-40510-1.rs:11:9 | LL | || { @@ -8,15 +8,6 @@ LL | &mut x | = note: `FnMut` closures only have access to their captured variables while they are executing... = note: ...therefore, they cannot allow references to captured variables to escape - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` - -error: compilation successful - --> $DIR/issue-40510-1.rs:20:1 - | -LL | fn main() {} - | ^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40510-1.nll.stderr b/src/test/ui/issues/issue-40510-1.nll.stderr index 776a724d3106a..f4fda0abc2049 100644 --- a/src/test/ui/issues/issue-40510-1.nll.stderr +++ b/src/test/ui/issues/issue-40510-1.nll.stderr @@ -1,5 +1,5 @@ error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-40510-1.rs:11:9 + --> $DIR/issue-40510-1.rs:7:9 | LL | || { | - inferred to be a `FnMut` closure diff --git a/src/test/ui/issues/issue-40510-1.rs b/src/test/ui/issues/issue-40510-1.rs index 6ecbeefd88115..ca53dcd9b41fa 100644 --- a/src/test/ui/issues/issue-40510-1.rs +++ b/src/test/ui/issues/issue-40510-1.rs @@ -1,21 +1,12 @@ -#![feature(rustc_attrs)] #![allow(unused)] -// revisions: migrate nll -#![cfg_attr(nll, feature(nll))] - fn f() { let mut x: Box<()> = Box::new(()); || { &mut x }; - //[migrate]~^^ WARNING captured variable cannot escape `FnMut` closure body - //[migrate]~| WARNING this error has been downgraded to a warning - //[migrate]~| WARNING this warning will become a hard error in the future - //[nll]~^^^^^ ERROR captured variable cannot escape `FnMut` closure body + //~^^ ERROR captured variable cannot escape `FnMut` closure body } -#[rustc_error] fn main() {} -//[migrate]~^ ERROR diff --git a/src/test/ui/issues/issue-40510-1.migrate.nll.stderr b/src/test/ui/issues/issue-40510-1.stderr similarity index 93% rename from src/test/ui/issues/issue-40510-1.migrate.nll.stderr rename to src/test/ui/issues/issue-40510-1.stderr index 776a724d3106a..f4fda0abc2049 100644 --- a/src/test/ui/issues/issue-40510-1.migrate.nll.stderr +++ b/src/test/ui/issues/issue-40510-1.stderr @@ -1,5 +1,5 @@ error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-40510-1.rs:11:9 + --> $DIR/issue-40510-1.rs:7:9 | LL | || { | - inferred to be a `FnMut` closure diff --git a/src/test/ui/issues/issue-40510-3.migrate.stderr b/src/test/ui/issues/issue-40510-3.migrate.stderr index f00690efc312c..a49475a8570a1 100644 --- a/src/test/ui/issues/issue-40510-3.migrate.stderr +++ b/src/test/ui/issues/issue-40510-3.migrate.stderr @@ -1,4 +1,4 @@ -warning: captured variable cannot escape `FnMut` closure body +error: captured variable cannot escape `FnMut` closure body --> $DIR/issue-40510-3.rs:11:9 | LL | || { @@ -10,15 +10,6 @@ LL | | } | = note: `FnMut` closures only have access to their captured variables while they are executing... = note: ...therefore, they cannot allow references to captured variables to escape - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` - -error: compilation successful - --> $DIR/issue-40510-3.rs:22:1 - | -LL | fn main() {} - | ^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-40510-3.nll.stderr b/src/test/ui/issues/issue-40510-3.nll.stderr index a49475a8570a1..4bc7d0f5deac5 100644 --- a/src/test/ui/issues/issue-40510-3.nll.stderr +++ b/src/test/ui/issues/issue-40510-3.nll.stderr @@ -1,5 +1,5 @@ error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-40510-3.rs:11:9 + --> $DIR/issue-40510-3.rs:7:9 | LL | || { | - inferred to be a `FnMut` closure diff --git a/src/test/ui/issues/issue-40510-3.rs b/src/test/ui/issues/issue-40510-3.rs index 205d982363128..181263adcbfa8 100644 --- a/src/test/ui/issues/issue-40510-3.rs +++ b/src/test/ui/issues/issue-40510-3.rs @@ -1,9 +1,5 @@ -#![feature(rustc_attrs)] #![allow(unused)] -// revisions: migrate nll -#![cfg_attr(nll, feature(nll))] - fn f() { let mut x: Vec<()> = Vec::new(); @@ -11,13 +7,8 @@ fn f() { || { x.push(()) } - //[migrate]~^^^ WARNING captured variable cannot escape `FnMut` closure body - //[migrate]~| WARNING this error has been downgraded to a warning - //[migrate]~| WARNING this warning will become a hard error in the future - //[nll]~^^^^^^ ERROR captured variable cannot escape `FnMut` closure body + //~^^^ ERROR captured variable cannot escape `FnMut` closure body }; } -#[rustc_error] fn main() {} -//[migrate]~^ ERROR diff --git a/src/test/ui/issues/issue-40510-3.migrate.nll.stderr b/src/test/ui/issues/issue-40510-3.stderr similarity index 94% rename from src/test/ui/issues/issue-40510-3.migrate.nll.stderr rename to src/test/ui/issues/issue-40510-3.stderr index a49475a8570a1..4bc7d0f5deac5 100644 --- a/src/test/ui/issues/issue-40510-3.migrate.nll.stderr +++ b/src/test/ui/issues/issue-40510-3.stderr @@ -1,5 +1,5 @@ error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-40510-3.rs:11:9 + --> $DIR/issue-40510-3.rs:7:9 | LL | || { | - inferred to be a `FnMut` closure diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr index 2e99572d01828..45b22511d27d6 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr @@ -1,4 +1,4 @@ -warning[E0713]: borrow may still be in use when destructor runs +error[E0713]: borrow may still be in use when destructor runs --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:52:5 | LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { @@ -8,12 +8,8 @@ LL | &mut *s.0 ... LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` -warning[E0713]: borrow may still be in use when destructor runs +error[E0713]: borrow may still be in use when destructor runs --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5 | LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { @@ -23,12 +19,8 @@ LL | &mut *(*s).0 ... LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` -warning[E0713]: borrow may still be in use when destructor runs +error[E0713]: borrow may still be in use when destructor runs --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:74:5 | LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { @@ -38,23 +30,7 @@ LL | &mut *(**s).0 ... LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` - -error: compilation successful - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:81:1 - | -LL | / fn main() { -LL | | let mut x = 1; -LL | | { -LL | | let mut long_lived = Scribble(&mut x); -... | -LL | | *boxed_boxed_scribbled(Box::new(Box::new(Scribble(&mut x)))) += 10; -LL | | } - | |_^ -error: aborting due to previous error +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0713`. diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs index 9f261884f3d2d..b73637efe6e99 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs @@ -2,27 +2,16 @@ // mutable borrows that would be scribbled over by destructors before // the return occurs. // -// We will explicitly test NLL, and migration modes; -// thus we will also skip the automated compare-mode=nll. +// We will explicitly test NLL; thus we will also skip the automated compare-mode=nll. -// revisions: nll migrate // ignore-compare-mode-nll // ignore-compare-mode-polonius -// This test is going to pass in the migrate revision, because the AST-borrowck -// accepted this code in the past (see notes below). So we use `#[rustc_error]` -// to keep the outcome as an error in all scenarios, and rely on the stderr -// files to show what the actual behavior is. (See rust-lang/rust#49855.) -#![feature(rustc_attrs)] - -#![cfg_attr(nll, feature(nll))] - struct Scribble<'a>(&'a mut u32); impl<'a> Drop for Scribble<'a> { fn drop(&mut self) { *self.0 = 42; } } -// this is okay, in both AST-borrowck and NLL: The `Scribble` here *has* -// to strictly outlive `'a` +// this is okay: The `Scribble` here *has* to strictly outlive `'a` fn borrowed_scribble<'a>(s: &'a mut Scribble) -> &'a mut u32 { &mut *s.0 } @@ -44,41 +33,21 @@ fn boxed_boxed_borrowed_scribble<'a>(s: Box>) -> &'a mut u // * (Maybe in the future the two-phase borrows system will be // extended to support this case. But for now, it is an error in // NLL, even with two-phase borrows.) -// -// In any case, the AST-borrowck was not smart enough to know that -// this should be an error. (Which is perhaps the essence of why -// rust-lang/rust#45696 arose in the first place.) fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { - &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] - //[migrate]~^ WARNING borrow may still be in use when destructor runs [E0713] - //[migrate]~| WARNING this error has been downgraded to a warning for backwards compatibility - //[migrate]~| WARNING this represents potential undefined behavior in your code + &mut *s.0 //~ ERROR borrow may still be in use when destructor runs [E0713] } // This, by analogy to previous case, is *also* not okay. -// -// (But again, AST-borrowck was not smart enogh to know that this -// should be an error.) fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { - &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] - //[migrate]~^ WARNING borrow may still be in use when destructor runs [E0713] - //[migrate]~| WARNING this error has been downgraded to a warning for backwards compatibility - //[migrate]~| WARNING this represents potential undefined behavior in your code + &mut *(*s).0 //~ ERROR borrow may still be in use when destructor runs [E0713] } // This, by analogy to previous case, is *also* not okay. -// -// (But again, AST-borrowck was not smart enogh to know that this -// should be an error.) fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { - &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] - //[migrate]~^ WARNING borrow may still be in use when destructor runs [E0713] - //[migrate]~| WARNING this error has been downgraded to a warning for backwards compatibility - //[migrate]~| WARNING this represents potential undefined behavior in your code + &mut *(**s).0 //~ ERROR borrow may still be in use when destructor runs [E0713] } -#[rustc_error] -fn main() { //[migrate]~ ERROR compilation successful +fn main() { let mut x = 1; { let mut long_lived = Scribble(&mut x); diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr new file mode 100644 index 0000000000000..d1fdc289cd68e --- /dev/null +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr @@ -0,0 +1,33 @@ +error[E0713]: borrow may still be in use when destructor runs + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:37:5 + | +LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { + | -- lifetime `'a` defined here +LL | &mut *s.0 + | ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` +LL | } + | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait + +error[E0713]: borrow may still be in use when destructor runs + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:42:5 + | +LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { + | -- lifetime `'a` defined here +LL | &mut *(*s).0 + | ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` +LL | } + | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait + +error[E0713]: borrow may still be in use when destructor runs + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:47:5 + | +LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { + | -- lifetime `'a` defined here +LL | &mut *(**s).0 + | ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` +LL | } + | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0713`. diff --git a/src/test/ui/issues/issue-49824.nll.stderr b/src/test/ui/issues/issue-49824.nll.stderr deleted file mode 100644 index 9c6f8d4532a70..0000000000000 --- a/src/test/ui/issues/issue-49824.nll.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-49824.rs:10:9 - | -LL | || { - | - inferred to be a `FnMut` closure -LL | / || { -LL | | -LL | | -LL | | -LL | | let _y = &mut x; -LL | | } - | |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body - | - = note: `FnMut` closures only have access to their captured variables while they are executing... - = note: ...therefore, they cannot allow references to captured variables to escape - -error: aborting due to previous error - diff --git a/src/test/ui/issues/issue-49824.rs b/src/test/ui/issues/issue-49824.rs index b0d01b3d98d51..bc1cd6856bc92 100644 --- a/src/test/ui/issues/issue-49824.rs +++ b/src/test/ui/issues/issue-49824.rs @@ -1,16 +1,8 @@ -#![feature(rustc_attrs)] - -// This test checks that a warning occurs with migrate mode. - -#[rustc_error] fn main() { - //~^ ERROR compilation successful let mut x = 0; || { || { - //~^ WARNING captured variable cannot escape `FnMut` closure body - //~| WARNING this error has been downgraded to a warning - //~| WARNING this warning will become a hard error in the future + //~^ ERROR captured variable cannot escape `FnMut` closure body let _y = &mut x; } }; diff --git a/src/test/ui/issues/issue-49824.stderr b/src/test/ui/issues/issue-49824.stderr index d5f1af88e133a..6b486aafcdf40 100644 --- a/src/test/ui/issues/issue-49824.stderr +++ b/src/test/ui/issues/issue-49824.stderr @@ -1,33 +1,16 @@ -warning: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-49824.rs:10:9 +error: captured variable cannot escape `FnMut` closure body + --> $DIR/issue-49824.rs:4:9 | LL | || { | - inferred to be a `FnMut` closure LL | / || { LL | | -LL | | -LL | | LL | | let _y = &mut x; LL | | } | |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body | = note: `FnMut` closures only have access to their captured variables while they are executing... = note: ...therefore, they cannot allow references to captured variables to escape - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` - -error: compilation successful - --> $DIR/issue-49824.rs:6:1 - | -LL | / fn main() { -LL | | -LL | | let mut x = 0; -LL | | || { -... | -LL | | }; -LL | | } - | |_^ error: aborting due to previous error diff --git a/src/test/ui/nll/borrowed-referent-issue-38899.rs b/src/test/ui/nll/borrowed-referent-issue-38899.rs index d4b05fb793160..1fe1332832a14 100644 --- a/src/test/ui/nll/borrowed-referent-issue-38899.rs +++ b/src/test/ui/nll/borrowed-referent-issue-38899.rs @@ -1,7 +1,5 @@ // Regression test for issue #38899 -#![feature(nll)] - pub struct Block<'a> { current: &'a u8, unrelated: &'a u8, diff --git a/src/test/ui/nll/borrowed-referent-issue-38899.stderr b/src/test/ui/nll/borrowed-referent-issue-38899.stderr index 38a6e27a0e560..16588cbcfb285 100644 --- a/src/test/ui/nll/borrowed-referent-issue-38899.stderr +++ b/src/test/ui/nll/borrowed-referent-issue-38899.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable - --> $DIR/borrowed-referent-issue-38899.rs:13:21 + --> $DIR/borrowed-referent-issue-38899.rs:11:21 | LL | let x = &mut block; | ---------- mutable borrow occurs here diff --git a/src/test/ui/pattern/pattern-bindings-after-at.nll.stderr b/src/test/ui/pattern/pattern-bindings-after-at.nll.stderr deleted file mode 100644 index 35ee7877f2f78..0000000000000 --- a/src/test/ui/pattern/pattern-bindings-after-at.nll.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0303]: pattern bindings are not allowed after an `@` - --> $DIR/pattern-bindings-after-at.rs:8:31 - | -LL | ref mut z @ &mut Some(ref a) => { - | ^^^^^ not allowed after `@` - -error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable - --> $DIR/pattern-bindings-after-at.rs:8:31 - | -LL | ref mut z @ &mut Some(ref a) => { - | ----------------------^^^^^- - | | | - | | immutable borrow occurs here - | mutable borrow occurs here -... -LL | **z = None; - | ---------- mutable borrow later used here - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0303, E0502. -For more information about an error, try `rustc --explain E0303`. diff --git a/src/test/ui/pattern/pattern-bindings-after-at.rs b/src/test/ui/pattern/pattern-bindings-after-at.rs index 20a1d017cdd18..aff7264752de2 100644 --- a/src/test/ui/pattern/pattern-bindings-after-at.rs +++ b/src/test/ui/pattern/pattern-bindings-after-at.rs @@ -7,9 +7,7 @@ fn main() { match &mut Some(1) { ref mut z @ &mut Some(ref a) => { //~^ ERROR pattern bindings are not allowed after an `@` - //~| WARN cannot borrow `_` as immutable because it is also borrowed as mutable - //~| WARN this error has been downgraded to a warning for backwards compatibility - //~| WARN this represents potential undefined behavior in your code and this warning will + //~| ERROR cannot borrow `_` as immutable because it is also borrowed as mutable **z = None; println!("{}", *a); } diff --git a/src/test/ui/pattern/pattern-bindings-after-at.stderr b/src/test/ui/pattern/pattern-bindings-after-at.stderr index 70452a930ee70..35ee7877f2f78 100644 --- a/src/test/ui/pattern/pattern-bindings-after-at.stderr +++ b/src/test/ui/pattern/pattern-bindings-after-at.stderr @@ -4,7 +4,7 @@ error[E0303]: pattern bindings are not allowed after an `@` LL | ref mut z @ &mut Some(ref a) => { | ^^^^^ not allowed after `@` -warning[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable +error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable --> $DIR/pattern-bindings-after-at.rs:8:31 | LL | ref mut z @ &mut Some(ref a) => { @@ -15,12 +15,8 @@ LL | ref mut z @ &mut Some(ref a) => { ... LL | **z = None; | ---------- mutable borrow later used here - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` -error: aborting due to previous error +error: aborting due to 2 previous errors Some errors have detailed explanations: E0303, E0502. For more information about an error, try `rustc --explain E0303`. diff --git a/src/test/ui/thread-local-in-ctfe.nll.stderr b/src/test/ui/thread-local-in-ctfe.nll.stderr deleted file mode 100644 index 18d01b1879018..0000000000000 --- a/src/test/ui/thread-local-in-ctfe.nll.stderr +++ /dev/null @@ -1,49 +0,0 @@ -error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:6:17 - | -LL | static B: u32 = A; - | ^ - -error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:9:18 - | -LL | static C: &u32 = &A; - | ^^ - -error[E0712]: thread-local variable borrowed past end of function - --> $DIR/thread-local-in-ctfe.rs:9:18 - | -LL | static C: &u32 = &A; - | ^^- end of enclosing function is here - | | - | thread-local variables cannot be borrowed beyond the end of the function - -error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:15:16 - | -LL | const D: u32 = A; - | ^ - -error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:18:17 - | -LL | const E: &u32 = &A; - | ^^ - -error[E0712]: thread-local variable borrowed past end of function - --> $DIR/thread-local-in-ctfe.rs:18:17 - | -LL | const E: &u32 = &A; - | ^^- end of enclosing function is here - | | - | thread-local variables cannot be borrowed beyond the end of the function - -error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:25:5 - | -LL | A - | ^ - -error: aborting due to 7 previous errors - -For more information about this error, try `rustc --explain E0712`. diff --git a/src/test/ui/thread-local-in-ctfe.rs b/src/test/ui/thread-local-in-ctfe.rs index 7ca1a2e7e90c2..722c3883fdda4 100644 --- a/src/test/ui/thread-local-in-ctfe.rs +++ b/src/test/ui/thread-local-in-ctfe.rs @@ -8,18 +8,14 @@ static B: u32 = A; static C: &u32 = &A; //~^ ERROR thread-local statics cannot be accessed at compile-time -//~| WARNING thread-local variable borrowed past end of function -//~| WARNING this error has been downgraded to a warning -//~| WARNING this warning will become a hard error in the future +//~| ERROR thread-local variable borrowed past end of function const D: u32 = A; //~^ ERROR thread-local statics cannot be accessed at compile-time const E: &u32 = &A; //~^ ERROR thread-local statics cannot be accessed at compile-time -//~| WARNING thread-local variable borrowed past end of function -//~| WARNING this error has been downgraded to a warning -//~| WARNING this warning will become a hard error in the future +//~| ERROR thread-local variable borrowed past end of function const fn f() -> u32 { A diff --git a/src/test/ui/thread-local-in-ctfe.stderr b/src/test/ui/thread-local-in-ctfe.stderr index 6869109e67fc0..2983ac3f60cf2 100644 --- a/src/test/ui/thread-local-in-ctfe.stderr +++ b/src/test/ui/thread-local-in-ctfe.stderr @@ -10,48 +10,40 @@ error[E0625]: thread-local statics cannot be accessed at compile-time LL | static C: &u32 = &A; | ^^ -warning[E0712]: thread-local variable borrowed past end of function +error[E0712]: thread-local variable borrowed past end of function --> $DIR/thread-local-in-ctfe.rs:9:18 | LL | static C: &u32 = &A; | ^^- end of enclosing function is here | | | thread-local variables cannot be borrowed beyond the end of the function - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:15:16 + --> $DIR/thread-local-in-ctfe.rs:13:16 | LL | const D: u32 = A; | ^ error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:18:17 + --> $DIR/thread-local-in-ctfe.rs:16:17 | LL | const E: &u32 = &A; | ^^ -warning[E0712]: thread-local variable borrowed past end of function - --> $DIR/thread-local-in-ctfe.rs:18:17 +error[E0712]: thread-local variable borrowed past end of function + --> $DIR/thread-local-in-ctfe.rs:16:17 | LL | const E: &u32 = &A; | ^^- end of enclosing function is here | | | thread-local variables cannot be borrowed beyond the end of the function - | - = warning: this error has been downgraded to a warning for backwards compatibility with previous releases - = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future - = note: for more information, try `rustc --explain E0729` error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-in-ctfe.rs:25:5 + --> $DIR/thread-local-in-ctfe.rs:21:5 | LL | A | ^ -error: aborting due to 5 previous errors +error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0712`. From 487f8ab732beebb44c1d6d3530d49a9af1c31c4b Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 15:52:48 +0200 Subject: [PATCH 08/18] add test for #53432. --- ...3432-nested-closure-outlives-borrowed-value.rs | 7 +++++++ ...-nested-closure-outlives-borrowed-value.stderr | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.rs create mode 100644 src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr diff --git a/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.rs b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.rs new file mode 100644 index 0000000000000..f1fd1b507c71e --- /dev/null +++ b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.rs @@ -0,0 +1,7 @@ +fn main() { + let f = move || {}; + let _action = move || { + || f() // The `nested` closure + //~^ ERROR lifetime may not live long enough + }; +} diff --git a/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr new file mode 100644 index 0000000000000..3781691ff41dc --- /dev/null +++ b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr @@ -0,0 +1,15 @@ +error: lifetime may not live long enough + --> $DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9 + | +LL | let _action = move || { + | ------- + | | | + | | return type of closure is [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:4:9: 4:15 f:&'2 [closure@$DIR/issue-53432-nested-closure-outlives-borrowed-value.rs:2:13: 2:23]] + | lifetime `'1` represents this closure's body +LL | || f() // The `nested` closure + | ^^^^^^ returning this value requires that `'1` must outlive `'2` + | + = note: closure implements `Fn`, so references to captured variables can't escape the closure + +error: aborting due to previous error + From 2fb0bba5b5152489b0ce93d52572634a3a4d7ac0 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 15:58:39 +0200 Subject: [PATCH 09/18] remove feature(nll) from #45157 test. --- src/test/ui/issues/issue-40510-1.nll.stderr | 13 ------------- src/test/ui/issues/issue-40510-3.nll.stderr | 15 --------------- src/test/ui/issues/issue-45157.rs | 1 - src/test/ui/issues/issue-45157.stderr | 2 +- 4 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 src/test/ui/issues/issue-40510-1.nll.stderr delete mode 100644 src/test/ui/issues/issue-40510-3.nll.stderr diff --git a/src/test/ui/issues/issue-40510-1.nll.stderr b/src/test/ui/issues/issue-40510-1.nll.stderr deleted file mode 100644 index f4fda0abc2049..0000000000000 --- a/src/test/ui/issues/issue-40510-1.nll.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-40510-1.rs:7:9 - | -LL | || { - | - inferred to be a `FnMut` closure -LL | &mut x - | ^^^^^^ returns a reference to a captured variable which escapes the closure body - | - = note: `FnMut` closures only have access to their captured variables while they are executing... - = note: ...therefore, they cannot allow references to captured variables to escape - -error: aborting due to previous error - diff --git a/src/test/ui/issues/issue-40510-3.nll.stderr b/src/test/ui/issues/issue-40510-3.nll.stderr deleted file mode 100644 index 4bc7d0f5deac5..0000000000000 --- a/src/test/ui/issues/issue-40510-3.nll.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-40510-3.rs:7:9 - | -LL | || { - | - inferred to be a `FnMut` closure -LL | / || { -LL | | x.push(()) -LL | | } - | |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body - | - = note: `FnMut` closures only have access to their captured variables while they are executing... - = note: ...therefore, they cannot allow references to captured variables to escape - -error: aborting due to previous error - diff --git a/src/test/ui/issues/issue-45157.rs b/src/test/ui/issues/issue-45157.rs index 22ea254a769e8..bd18784289fe2 100644 --- a/src/test/ui/issues/issue-45157.rs +++ b/src/test/ui/issues/issue-45157.rs @@ -1,5 +1,4 @@ #![allow(unused)] -#![feature(nll)] // ignore-tidy-linelength diff --git a/src/test/ui/issues/issue-45157.stderr b/src/test/ui/issues/issue-45157.stderr index fbfa1d199566e..1b879e0b48c87 100644 --- a/src/test/ui/issues/issue-45157.stderr +++ b/src/test/ui/issues/issue-45157.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `u` (via `u.z.c`) as immutable because it is also borrowed as mutable (via `u.s.a`) - --> $DIR/issue-45157.rs:29:20 + --> $DIR/issue-45157.rs:28:20 | LL | let mref = &mut u.s.a; | ---------- mutable borrow occurs here (via `u.s.a`) From 1256613ac7ad60e4bde735b740fe546d6dc3a784 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 16:02:04 +0200 Subject: [PATCH 10/18] remove feature(nll) from #31567 test. --- src/test/ui/nll/issue-31567.rs | 2 -- src/test/ui/nll/issue-31567.stderr | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/ui/nll/issue-31567.rs b/src/test/ui/nll/issue-31567.rs index c57a07a54d58a..623954e6d5b94 100644 --- a/src/test/ui/nll/issue-31567.rs +++ b/src/test/ui/nll/issue-31567.rs @@ -2,8 +2,6 @@ // causing region relations not to be enforced at all the places where // they have to be enforced. -#![feature(nll)] - struct VecWrapper<'a>(&'a mut S); struct S(Box); diff --git a/src/test/ui/nll/issue-31567.stderr b/src/test/ui/nll/issue-31567.stderr index d098ff82d34f0..7d43383e89fd7 100644 --- a/src/test/ui/nll/issue-31567.stderr +++ b/src/test/ui/nll/issue-31567.stderr @@ -1,5 +1,5 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-31567.rs:12:26 + --> $DIR/issue-31567.rs:10:26 | LL | fn get_dangling<'a>(v: VecWrapper<'a>) -> &'a u32 { | -- lifetime `'a` defined here From b638aa1f5b8043a16af67ca52e0645c2c1352ee3 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 16:04:26 +0200 Subject: [PATCH 11/18] remove feature(nll) from #27868 test. --- src/test/ui/nll/issue-27868.rs | 2 -- src/test/ui/nll/issue-27868.stderr | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/ui/nll/issue-27868.rs b/src/test/ui/nll/issue-27868.rs index b5cf20bc9f965..e436b22dbaad4 100644 --- a/src/test/ui/nll/issue-27868.rs +++ b/src/test/ui/nll/issue-27868.rs @@ -1,7 +1,5 @@ // Regression test for issue #27868 -#![feature(nll)] - use std::ops::AddAssign; struct MyVec(Vec); diff --git a/src/test/ui/nll/issue-27868.stderr b/src/test/ui/nll/issue-27868.stderr index c83cb0b300b25..e0b3b5494d0a5 100644 --- a/src/test/ui/nll/issue-27868.stderr +++ b/src/test/ui/nll/issue-27868.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `vecvec` because it is borrowed - --> $DIR/issue-27868.rs:26:9 + --> $DIR/issue-27868.rs:24:9 | LL | vecvec[0] += { | ------ From 2b80ed99db8097d3d0e45d03561b81ede6b443b2 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 6 Sep 2019 16:23:00 +0200 Subject: [PATCH 12/18] remove feature(nll) in more cases. --- ...issue-27282-move-match-input-into-guard.rs | 2 - ...e-27282-move-match-input-into-guard.stderr | 2 +- .../issue-27282-move-ref-mut-into-guard.rs | 5 -- ...issue-27282-move-ref-mut-into-guard.stderr | 2 +- ...sue-27282-mutate-before-diverging-arm-1.rs | 2 - ...27282-mutate-before-diverging-arm-1.stderr | 2 +- ...sue-27282-mutate-before-diverging-arm-2.rs | 2 - ...27282-mutate-before-diverging-arm-2.stderr | 2 +- ...sue-27282-mutate-before-diverging-arm-3.rs | 2 +- src/test/ui/issues/issue-29723.rs | 2 - src/test/ui/issues/issue-29723.stderr | 2 +- src/test/ui/nll/borrowed-match-issue-45045.rs | 2 - .../ui/nll/borrowed-match-issue-45045.stderr | 2 +- .../do-not-ignore-lifetime-bounds-in-copy.rs | 2 - ...-not-ignore-lifetime-bounds-in-copy.stderr | 2 +- src/test/ui/nll/enum-drop-access.rs | 2 - src/test/ui/nll/enum-drop-access.stderr | 4 +- .../nll/issue-21232-partial-init-and-use.rs | 2 - .../issue-21232-partial-init-and-use.stderr | 46 +++++++++---------- src/test/ui/nll/issue-48238.rs | 2 - src/test/ui/nll/issue-48238.stderr | 2 +- ...59-report-when-borrow-and-drop-conflict.rs | 2 - ...eport-when-borrow-and-drop-conflict.stderr | 8 ++-- src/test/ui/nll/issue-53040.rs | 2 - src/test/ui/nll/issue-53040.stderr | 2 +- src/test/ui/nll/issue-53773.rs | 2 - src/test/ui/nll/issue-53773.stderr | 2 +- src/test/ui/nll/issue-57100.rs | 1 - src/test/ui/nll/issue-57100.stderr | 4 +- src/test/ui/nll/match-guards-always-borrow.rs | 2 - .../ui/nll/match-guards-always-borrow.stderr | 2 +- src/test/ui/nll/match-on-borrowed.rs | 2 - src/test/ui/nll/match-on-borrowed.stderr | 8 ++-- 33 files changed, 47 insertions(+), 81 deletions(-) diff --git a/src/test/ui/issues/issue-27282-move-match-input-into-guard.rs b/src/test/ui/issues/issue-27282-move-match-input-into-guard.rs index 0721b051bcbd8..71f1f15654b55 100644 --- a/src/test/ui/issues/issue-27282-move-match-input-into-guard.rs +++ b/src/test/ui/issues/issue-27282-move-match-input-into-guard.rs @@ -7,8 +7,6 @@ // reaches the panic code when executed, despite the compiler warning // about that match arm being unreachable. -#![feature(nll)] - fn main() { let b = &mut true; match b { diff --git a/src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr b/src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr index 6993419326c8e..51f9b464d7660 100644 --- a/src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr +++ b/src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `b` - --> $DIR/issue-27282-move-match-input-into-guard.rs:18:14 + --> $DIR/issue-27282-move-match-input-into-guard.rs:16:14 | LL | let b = &mut true; | - move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait diff --git a/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.rs b/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.rs index e570b04a2bead..afa0ba780de46 100644 --- a/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.rs +++ b/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.rs @@ -1,11 +1,6 @@ // Issue 27282: Example 1: This sidesteps the AST checks disallowing // mutable borrows in match guards by hiding the mutable borrow in a // guard behind a move (of the ref mut pattern id) within a closure. -// -// This example is not rejected by AST borrowck (and then reliably -// segfaults when executed). - -#![feature(nll)] fn main() { match Some(&4) { diff --git a/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.stderr b/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.stderr index c5a9dd98a1596..30cf0d66afaff 100644 --- a/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.stderr +++ b/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `foo` in pattern guard - --> $DIR/issue-27282-move-ref-mut-into-guard.rs:14:19 + --> $DIR/issue-27282-move-ref-mut-into-guard.rs:9:19 | LL | if { (|| { let bar = foo; bar.take() })(); false } => {}, | ^^ --- diff --git a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.rs b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.rs index 3fb13d66ccb32..d17d6f07f6870 100644 --- a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.rs +++ b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.rs @@ -9,8 +9,6 @@ // diverges, and therefore a single final fake-read at the very end // after the final match arm would not suffice. -#![feature(nll)] - struct ForceFnOnce; fn main() { diff --git a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr index 199407ad77463..188f0b25c3084 100644 --- a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr +++ b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr @@ -1,5 +1,5 @@ error[E0510]: cannot mutably borrow `x` in match guard - --> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:23:14 + --> $DIR/issue-27282-mutate-before-diverging-arm-1.rs:21:14 | LL | match x { | - value is immutable in match guard diff --git a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.rs b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.rs index f5eaae925db01..9c3e7e9978ec7 100644 --- a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.rs +++ b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.rs @@ -13,8 +13,6 @@ // occurs in the pattern-match itself, and not in the guard // expression. -#![feature(nll)] - struct ForceFnOnce; fn main() { diff --git a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.stderr b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.stderr index 3c72cb02015a0..f0a3151f4e12f 100644 --- a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.stderr +++ b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.stderr @@ -1,5 +1,5 @@ error[E0510]: cannot mutably borrow `x` in match guard - --> $DIR/issue-27282-mutate-before-diverging-arm-2.rs:28:18 + --> $DIR/issue-27282-mutate-before-diverging-arm-2.rs:26:18 | LL | match x { | - value is immutable in match guard diff --git a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-3.rs b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-3.rs index 4cf5bcd6b4f68..cff9e963e2725 100644 --- a/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-3.rs +++ b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-3.rs @@ -8,7 +8,7 @@ // This case is interesting because a borrow of **x is untracked, because **x is // immutable. However, for matches we care that **x refers to the same value // until we have chosen a match arm. -#![feature(nll)] + struct ForceFnOnce; fn main() { let mut x = &mut &Some(&2); diff --git a/src/test/ui/issues/issue-29723.rs b/src/test/ui/issues/issue-29723.rs index 41db52a1fadac..ce91022f093d4 100644 --- a/src/test/ui/issues/issue-29723.rs +++ b/src/test/ui/issues/issue-29723.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // test for https://github.com/rust-lang/rust/issues/29723 fn main() { diff --git a/src/test/ui/issues/issue-29723.stderr b/src/test/ui/issues/issue-29723.stderr index 7928af5d5a5cd..04915ab5f9510 100644 --- a/src/test/ui/issues/issue-29723.stderr +++ b/src/test/ui/issues/issue-29723.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `s` - --> $DIR/issue-29723.rs:12:13 + --> $DIR/issue-29723.rs:10:13 | LL | let s = String::new(); | - move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait diff --git a/src/test/ui/nll/borrowed-match-issue-45045.rs b/src/test/ui/nll/borrowed-match-issue-45045.rs index 59516d8b444d1..0cd8e956d309f 100644 --- a/src/test/ui/nll/borrowed-match-issue-45045.rs +++ b/src/test/ui/nll/borrowed-match-issue-45045.rs @@ -1,7 +1,5 @@ // Regression test for issue #45045 -#![feature(nll)] - enum Xyz { A, B, diff --git a/src/test/ui/nll/borrowed-match-issue-45045.stderr b/src/test/ui/nll/borrowed-match-issue-45045.stderr index f8d4d56621deb..1607304e6716b 100644 --- a/src/test/ui/nll/borrowed-match-issue-45045.stderr +++ b/src/test/ui/nll/borrowed-match-issue-45045.stderr @@ -1,5 +1,5 @@ error[E0503]: cannot use `e` because it was mutably borrowed - --> $DIR/borrowed-match-issue-45045.rs:15:9 + --> $DIR/borrowed-match-issue-45045.rs:13:9 | LL | let f = &mut e; | ------ borrow of `e` occurs here diff --git a/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs b/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs index 2a1321c25510f..99922cc51b0d1 100644 --- a/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs +++ b/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs @@ -1,7 +1,5 @@ // Test that the 'static bound from the Copy impl is respected. Regression test for #29149. -#![feature(nll)] - #[derive(Clone)] struct Foo<'a>(&'a u32); impl Copy for Foo<'static> {} diff --git a/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr b/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr index bf5c571b455b3..b811ba4fd0cd2 100644 --- a/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr +++ b/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr @@ -1,5 +1,5 @@ error[E0597]: `s` does not live long enough - --> $DIR/do-not-ignore-lifetime-bounds-in-copy.rs:10:17 + --> $DIR/do-not-ignore-lifetime-bounds-in-copy.rs:8:17 | LL | let a = Foo(&s); | ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/enum-drop-access.rs b/src/test/ui/nll/enum-drop-access.rs index dc436d20fd857..5ef0c3fe73dbf 100644 --- a/src/test/ui/nll/enum-drop-access.rs +++ b/src/test/ui/nll/enum-drop-access.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - enum DropOption { Some(T), None, diff --git a/src/test/ui/nll/enum-drop-access.stderr b/src/test/ui/nll/enum-drop-access.stderr index 699179fd52fd4..a532ae121a6ef 100644 --- a/src/test/ui/nll/enum-drop-access.stderr +++ b/src/test/ui/nll/enum-drop-access.stderr @@ -1,5 +1,5 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/enum-drop-access.rs:15:31 + --> $DIR/enum-drop-access.rs:13:31 | LL | fn drop_enum(opt: DropOption<&mut i32>) -> Option<&mut i32> { | - let's call the lifetime of this reference `'1` @@ -13,7 +13,7 @@ LL | } | - here, drop of `opt` needs exclusive access to `*opt.0`, because the type `DropOption<&mut i32>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/enum-drop-access.rs:24:36 + --> $DIR/enum-drop-access.rs:22:36 | LL | fn optional_drop_enum(opt: Option>) -> Option<&mut i32> { | - let's call the lifetime of this reference `'1` diff --git a/src/test/ui/nll/issue-21232-partial-init-and-use.rs b/src/test/ui/nll/issue-21232-partial-init-and-use.rs index 7da47c85f5450..1836f766cc7ef 100644 --- a/src/test/ui/nll/issue-21232-partial-init-and-use.rs +++ b/src/test/ui/nll/issue-21232-partial-init-and-use.rs @@ -12,8 +12,6 @@ // tests that are meant to continue failing to compile once // rust-lang/rust#54987 is implemented. -#![feature(nll)] - struct S { x: u32, diff --git a/src/test/ui/nll/issue-21232-partial-init-and-use.stderr b/src/test/ui/nll/issue-21232-partial-init-and-use.stderr index 32147898320c0..9e69262b38900 100644 --- a/src/test/ui/nll/issue-21232-partial-init-and-use.stderr +++ b/src/test/ui/nll/issue-21232-partial-init-and-use.stderr @@ -1,17 +1,17 @@ error[E0381]: assign to part of possibly-uninitialized variable: `s` - --> $DIR/issue-21232-partial-init-and-use.rs:99:5 + --> $DIR/issue-21232-partial-init-and-use.rs:97:5 | LL | s.x = 10; s.y = Box::new(20); | ^^^^^^^^ use of possibly-uninitialized `s` error[E0381]: assign to part of possibly-uninitialized variable: `t` - --> $DIR/issue-21232-partial-init-and-use.rs:106:5 + --> $DIR/issue-21232-partial-init-and-use.rs:104:5 | LL | t.0 = 10; t.1 = Box::new(20); | ^^^^^^^^ use of possibly-uninitialized `t` error[E0382]: assign to part of moved value: `s` - --> $DIR/issue-21232-partial-init-and-use.rs:113:5 + --> $DIR/issue-21232-partial-init-and-use.rs:111:5 | LL | let mut s: S = S::new(); drop(s); | ----- - value moved here @@ -21,7 +21,7 @@ LL | s.x = 10; s.y = Box::new(20); | ^^^^^^^^ value partially assigned here after move error[E0382]: assign to part of moved value: `t` - --> $DIR/issue-21232-partial-init-and-use.rs:120:5 + --> $DIR/issue-21232-partial-init-and-use.rs:118:5 | LL | let mut t: T = (0, Box::new(0)); drop(t); | ----- - value moved here @@ -31,19 +31,19 @@ LL | t.0 = 10; t.1 = Box::new(20); | ^^^^^^^^ value partially assigned here after move error[E0381]: assign to part of possibly-uninitialized variable: `s` - --> $DIR/issue-21232-partial-init-and-use.rs:127:5 + --> $DIR/issue-21232-partial-init-and-use.rs:125:5 | LL | s.x = 10; | ^^^^^^^^ use of possibly-uninitialized `s` error[E0381]: assign to part of possibly-uninitialized variable: `t` - --> $DIR/issue-21232-partial-init-and-use.rs:134:5 + --> $DIR/issue-21232-partial-init-and-use.rs:132:5 | LL | t.0 = 10; | ^^^^^^^^ use of possibly-uninitialized `t` error[E0382]: assign to part of moved value: `s` - --> $DIR/issue-21232-partial-init-and-use.rs:141:5 + --> $DIR/issue-21232-partial-init-and-use.rs:139:5 | LL | let mut s: S = S::new(); drop(s); | ----- - value moved here @@ -53,7 +53,7 @@ LL | s.x = 10; | ^^^^^^^^ value partially assigned here after move error[E0382]: assign to part of moved value: `t` - --> $DIR/issue-21232-partial-init-and-use.rs:148:5 + --> $DIR/issue-21232-partial-init-and-use.rs:146:5 | LL | let mut t: T = (0, Box::new(0)); drop(t); | ----- - value moved here @@ -63,31 +63,31 @@ LL | t.0 = 10; | ^^^^^^^^ value partially assigned here after move error[E0381]: assign to part of possibly-uninitialized variable: `s` - --> $DIR/issue-21232-partial-init-and-use.rs:155:5 + --> $DIR/issue-21232-partial-init-and-use.rs:153:5 | LL | s.x = 10; | ^^^^^^^^ use of possibly-uninitialized `s` error[E0381]: assign to part of possibly-uninitialized variable: `t` - --> $DIR/issue-21232-partial-init-and-use.rs:162:5 + --> $DIR/issue-21232-partial-init-and-use.rs:160:5 | LL | t.0 = 10; | ^^^^^^^^ use of possibly-uninitialized `t` error[E0381]: assign to part of possibly-uninitialized variable: `q` - --> $DIR/issue-21232-partial-init-and-use.rs:178:5 + --> $DIR/issue-21232-partial-init-and-use.rs:176:5 | LL | q.r.f.x = 10; q.r.f.y = Box::new(20); | ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f` error[E0381]: assign to part of possibly-uninitialized variable: `q` - --> $DIR/issue-21232-partial-init-and-use.rs:185:5 + --> $DIR/issue-21232-partial-init-and-use.rs:183:5 | LL | q.r.f.0 = 10; q.r.f.1 = Box::new(20); | ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f` error[E0382]: assign to part of moved value: `q.r` - --> $DIR/issue-21232-partial-init-and-use.rs:192:5 + --> $DIR/issue-21232-partial-init-and-use.rs:190:5 | LL | let mut q: Q> = Q::new(S::new()); drop(q.r); | --- value moved here @@ -97,7 +97,7 @@ LL | q.r.f.x = 10; q.r.f.y = Box::new(20); = note: move occurs because `q.r` has type `R>>`, which does not implement the `Copy` trait error[E0382]: assign to part of moved value: `q.r` - --> $DIR/issue-21232-partial-init-and-use.rs:199:5 + --> $DIR/issue-21232-partial-init-and-use.rs:197:5 | LL | let mut q: Q = Q::new((0, Box::new(0))); drop(q.r); | --- value moved here @@ -107,19 +107,19 @@ LL | q.r.f.0 = 10; q.r.f.1 = Box::new(20); = note: move occurs because `q.r` has type `R<(u32, std::boxed::Box)>`, which does not implement the `Copy` trait error[E0381]: assign to part of possibly-uninitialized variable: `q` - --> $DIR/issue-21232-partial-init-and-use.rs:206:5 + --> $DIR/issue-21232-partial-init-and-use.rs:204:5 | LL | q.r.f.x = 10; | ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f` error[E0381]: assign to part of possibly-uninitialized variable: `q` - --> $DIR/issue-21232-partial-init-and-use.rs:213:5 + --> $DIR/issue-21232-partial-init-and-use.rs:211:5 | LL | q.r.f.0 = 10; | ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f` error[E0382]: assign to part of moved value: `q.r` - --> $DIR/issue-21232-partial-init-and-use.rs:220:5 + --> $DIR/issue-21232-partial-init-and-use.rs:218:5 | LL | let mut q: Q> = Q::new(S::new()); drop(q.r); | --- value moved here @@ -129,7 +129,7 @@ LL | q.r.f.x = 10; = note: move occurs because `q.r` has type `R>>`, which does not implement the `Copy` trait error[E0382]: assign to part of moved value: `q.r` - --> $DIR/issue-21232-partial-init-and-use.rs:227:5 + --> $DIR/issue-21232-partial-init-and-use.rs:225:5 | LL | let mut q: Q = Q::new((0, Box::new(0))); drop(q.r); | --- value moved here @@ -139,19 +139,19 @@ LL | q.r.f.0 = 10; = note: move occurs because `q.r` has type `R<(u32, std::boxed::Box)>`, which does not implement the `Copy` trait error[E0381]: assign to part of possibly-uninitialized variable: `q` - --> $DIR/issue-21232-partial-init-and-use.rs:234:5 + --> $DIR/issue-21232-partial-init-and-use.rs:232:5 | LL | q.r.f.x = 10; | ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f` error[E0381]: assign to part of possibly-uninitialized variable: `q` - --> $DIR/issue-21232-partial-init-and-use.rs:241:5 + --> $DIR/issue-21232-partial-init-and-use.rs:239:5 | LL | q.r.f.0 = 10; | ^^^^^^^^^^^^ use of possibly-uninitialized `q.r.f` error[E0382]: assign to part of moved value: `c` - --> $DIR/issue-21232-partial-init-and-use.rs:259:13 + --> $DIR/issue-21232-partial-init-and-use.rs:257:13 | LL | let mut c = (1, "".to_owned()); | ----- move occurs because `c` has type `(i32, std::string::String)`, which does not implement the `Copy` trait @@ -162,7 +162,7 @@ LL | c.0 = 2; | ^^^^^^^ value partially assigned here after move error[E0382]: assign to part of moved value: `c` - --> $DIR/issue-21232-partial-init-and-use.rs:269:13 + --> $DIR/issue-21232-partial-init-and-use.rs:267:13 | LL | let mut c = (1, (1, "".to_owned())); | ----- move occurs because `c` has type `(i32, (i32, std::string::String))`, which does not implement the `Copy` trait @@ -173,7 +173,7 @@ LL | (c.1).0 = 2; | ^^^^^^^^^^^ value partially assigned here after move error[E0382]: assign to part of moved value: `c.1` - --> $DIR/issue-21232-partial-init-and-use.rs:277:13 + --> $DIR/issue-21232-partial-init-and-use.rs:275:13 | LL | c2 => { | -- value moved here diff --git a/src/test/ui/nll/issue-48238.rs b/src/test/ui/nll/issue-48238.rs index 2e64ea72db28b..d2e9285fa4137 100644 --- a/src/test/ui/nll/issue-48238.rs +++ b/src/test/ui/nll/issue-48238.rs @@ -1,7 +1,5 @@ // Regression test for issue #48238 -#![feature(nll)] - fn use_val<'a>(val: &'a u8) -> &'a u8 { val } diff --git a/src/test/ui/nll/issue-48238.stderr b/src/test/ui/nll/issue-48238.stderr index 05a90eec05c3f..0aa1eedad9fd9 100644 --- a/src/test/ui/nll/issue-48238.stderr +++ b/src/test/ui/nll/issue-48238.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-48238.rs:11:13 + --> $DIR/issue-48238.rs:9:13 | LL | move || use_val(&orig); | ------- ^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2` diff --git a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs index 58416c31edde7..7ea1c445d143e 100644 --- a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs +++ b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs @@ -3,8 +3,6 @@ // one of its fields, it is useful to be reminded of the significance // of the fact that the type implements Drop. -#![feature(nll)] - pub struct S<'a> { url: &'a mut String } impl<'a> Drop for S<'a> { fn drop(&mut self) { } } diff --git a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr index ce48457abe7ec..1a1250ff9353f 100644 --- a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr +++ b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr @@ -1,5 +1,5 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:13:5 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:11:5 | LL | fn finish_1(s: S) -> &mut String { | - has type `S<'1>` @@ -9,7 +9,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:18:13 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:16:13 | LL | fn finish_2(s: S) -> &mut String { | - has type `S<'1>` @@ -19,7 +19,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:23:21 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:21:21 | LL | fn finish_3(s: S) -> &mut String { | - has type `S<'1>` @@ -29,7 +29,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait error[E0509]: cannot move out of type `S<'_>`, which implements the `Drop` trait - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:28:13 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:26:13 | LL | let p = s.url; p | ^^^^^ diff --git a/src/test/ui/nll/issue-53040.rs b/src/test/ui/nll/issue-53040.rs index 8ce24c8ede9ac..e4ee6e913f683 100644 --- a/src/test/ui/nll/issue-53040.rs +++ b/src/test/ui/nll/issue-53040.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn main() { let mut v: Vec<()> = Vec::new(); || &mut v; diff --git a/src/test/ui/nll/issue-53040.stderr b/src/test/ui/nll/issue-53040.stderr index 9e7e63af87db1..7cba32c67432c 100644 --- a/src/test/ui/nll/issue-53040.stderr +++ b/src/test/ui/nll/issue-53040.stderr @@ -1,5 +1,5 @@ error: captured variable cannot escape `FnMut` closure body - --> $DIR/issue-53040.rs:5:8 + --> $DIR/issue-53040.rs:3:8 | LL | || &mut v; | - ^^^^^^ returns a reference to a captured variable which escapes the closure body diff --git a/src/test/ui/nll/issue-53773.rs b/src/test/ui/nll/issue-53773.rs index 62e1631dcf36f..ed971b6ce0e1b 100644 --- a/src/test/ui/nll/issue-53773.rs +++ b/src/test/ui/nll/issue-53773.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Archive; struct ArchiveIterator<'a> { x: &'a Archive, diff --git a/src/test/ui/nll/issue-53773.stderr b/src/test/ui/nll/issue-53773.stderr index 1933ef7a2dbc7..45831460e5238 100644 --- a/src/test/ui/nll/issue-53773.stderr +++ b/src/test/ui/nll/issue-53773.stderr @@ -1,5 +1,5 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-53773.rs:43:22 + --> $DIR/issue-53773.rs:41:22 | LL | members.push(child.raw); | ^^^^^^^^^ diff --git a/src/test/ui/nll/issue-57100.rs b/src/test/ui/nll/issue-57100.rs index f669fe00956ef..c7f3e9d730367 100644 --- a/src/test/ui/nll/issue-57100.rs +++ b/src/test/ui/nll/issue-57100.rs @@ -1,5 +1,4 @@ #![allow(unused)] -#![feature(nll)] // ignore-tidy-linelength diff --git a/src/test/ui/nll/issue-57100.stderr b/src/test/ui/nll/issue-57100.stderr index 5d5c86c34875c..5f733c14036b0 100644 --- a/src/test/ui/nll/issue-57100.stderr +++ b/src/test/ui/nll/issue-57100.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `r.r2_union.f3_union` (via `r.r2_union.f3_union.s2_leaf.l1_u8`) as immutable because it is also borrowed as mutable (via `r.r2_union.f3_union.s1_leaf.l1_u8`) - --> $DIR/issue-57100.rs:44:20 + --> $DIR/issue-57100.rs:43:20 | LL | let mref = &mut r.r2_union.f3_union.s1_leaf.l1_u8; | -------------------------------------- mutable borrow occurs here (via `r.r2_union.f3_union.s1_leaf.l1_u8`) @@ -13,7 +13,7 @@ LL | println!("{} {}", mref, nref) = note: `r.r2_union.f3_union.s2_leaf.l1_u8` is a field of the union `Second`, so it overlaps the field `r.r2_union.f3_union.s1_leaf.l1_u8` error[E0502]: cannot borrow `r.r2_union` (via `r.r2_union.f1_leaf.l1_u8`) as immutable because it is also borrowed as mutable (via `r.r2_union.f2_leaf.l1_u8`) - --> $DIR/issue-57100.rs:62:20 + --> $DIR/issue-57100.rs:61:20 | LL | let mref = &mut r.r2_union.f2_leaf.l1_u8; | ----------------------------- mutable borrow occurs here (via `r.r2_union.f2_leaf.l1_u8`) diff --git a/src/test/ui/nll/match-guards-always-borrow.rs b/src/test/ui/nll/match-guards-always-borrow.rs index d423730bdbc35..87dba187ba2c2 100644 --- a/src/test/ui/nll/match-guards-always-borrow.rs +++ b/src/test/ui/nll/match-guards-always-borrow.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Here is arielb1's basic example from rust-lang/rust#27282 // that AST borrowck is flummoxed by: diff --git a/src/test/ui/nll/match-guards-always-borrow.stderr b/src/test/ui/nll/match-guards-always-borrow.stderr index 5b49db45a52ec..15f94043b430f 100644 --- a/src/test/ui/nll/match-guards-always-borrow.stderr +++ b/src/test/ui/nll/match-guards-always-borrow.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of `foo` in pattern guard - --> $DIR/match-guards-always-borrow.rs:10:14 + --> $DIR/match-guards-always-borrow.rs:8:14 | LL | (|| { let bar = foo; bar.take() })(); | ^^ --- diff --git a/src/test/ui/nll/match-on-borrowed.rs b/src/test/ui/nll/match-on-borrowed.rs index edce2b185df34..aba0a7f71f5c1 100644 --- a/src/test/ui/nll/match-on-borrowed.rs +++ b/src/test/ui/nll/match-on-borrowed.rs @@ -5,8 +5,6 @@ // Test that we don't allow mutating the value being matched on in a way that // changes which patterns it matches, until we have chosen an arm. -#![feature(nll)] - struct A(i32, i32); fn struct_example(mut a: A) { diff --git a/src/test/ui/nll/match-on-borrowed.stderr b/src/test/ui/nll/match-on-borrowed.stderr index 284a910a01b8a..f9c9a84632212 100644 --- a/src/test/ui/nll/match-on-borrowed.stderr +++ b/src/test/ui/nll/match-on-borrowed.stderr @@ -1,5 +1,5 @@ error[E0503]: cannot use `e` because it was mutably borrowed - --> $DIR/match-on-borrowed.rs:51:9 + --> $DIR/match-on-borrowed.rs:49:9 | LL | E::V(ref mut x, _) => x, | --------- borrow of `e.0` occurs here @@ -11,7 +11,7 @@ LL | x; | - borrow later used here error[E0503]: cannot use `*f` because it was mutably borrowed - --> $DIR/match-on-borrowed.rs:64:9 + --> $DIR/match-on-borrowed.rs:62:9 | LL | E::V(ref mut x, _) => x, | --------- borrow of `f.0` occurs here @@ -23,7 +23,7 @@ LL | x; | - borrow later used here error[E0503]: cannot use `t` because it was mutably borrowed - --> $DIR/match-on-borrowed.rs:82:9 + --> $DIR/match-on-borrowed.rs:80:9 | LL | let x = &mut t; | ------ borrow of `t` occurs here @@ -35,7 +35,7 @@ LL | x; | - borrow later used here error[E0381]: use of possibly-uninitialized variable: `n` - --> $DIR/match-on-borrowed.rs:92:11 + --> $DIR/match-on-borrowed.rs:90:11 | LL | match n {} | ^ use of possibly-uninitialized `n` From dfdd4d79d4ae0055ef6ef4a35a3d1413ea503057 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Wed, 25 Sep 2019 22:08:10 +0200 Subject: [PATCH 13/18] rm "src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr" --- ...96-scribble-on-boxed-borrow.migrate.stderr | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr deleted file mode 100644 index 45b22511d27d6..0000000000000 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:52:5 - | -LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { - | -- lifetime `'a` defined here -LL | &mut *s.0 - | ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` -... -LL | } - | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait - -error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5 - | -LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { - | -- lifetime `'a` defined here -LL | &mut *(*s).0 - | ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` -... -LL | } - | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait - -error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:74:5 - | -LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { - | -- lifetime `'a` defined here -LL | &mut *(**s).0 - | ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` -... -LL | } - | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0713`. From ce8c5d2749e68b2bade9df0133c1c3d9ee390d4b Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Wed, 25 Sep 2019 22:09:09 +0200 Subject: [PATCH 14/18] issue-#45696-scribble...: remove outdated comment. --- src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs | 2 -- .../ui/issues/issue-45696-scribble-on-boxed-borrow.stderr | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs index b73637efe6e99..e9daf39262c2b 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs @@ -1,8 +1,6 @@ // rust-lang/rust#45696: This test is checking that we *cannot* return // mutable borrows that would be scribbled over by destructors before // the return occurs. -// -// We will explicitly test NLL; thus we will also skip the automated compare-mode=nll. // ignore-compare-mode-nll // ignore-compare-mode-polonius diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr index d1fdc289cd68e..18aa38899cb8e 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr @@ -1,5 +1,5 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:37:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:35:5 | LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { | -- lifetime `'a` defined here @@ -9,7 +9,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:42:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:40:5 | LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { | -- lifetime `'a` defined here @@ -19,7 +19,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:47:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:45:5 | LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { | -- lifetime `'a` defined here From f8af7666bdaeefce8692a962ee93b94040e37c0d Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 26 Sep 2019 06:44:50 +0200 Subject: [PATCH 15/18] cargotest: bump webrender --- src/tools/cargotest/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs index 1a42e0cac3ccc..30dee9bebc004 100644 --- a/src/tools/cargotest/main.rs +++ b/src/tools/cargotest/main.rs @@ -61,7 +61,7 @@ const TEST_REPOS: &'static [Test] = &[ Test { name: "webrender", repo: "https://github.com/servo/webrender", - sha: "cdadd068f4c7218bd983d856981d561e605270ab", + sha: "a3d6e6894c5a601fa547c6273eb963ca1321c2bb", lock: None, packages: &[], }, From 9a2cc54e11e919acf83827609ed0fb0d07bf0778 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 26 Sep 2019 07:50:39 +0200 Subject: [PATCH 16/18] cargotest: bump iron --- src/tools/cargotest/lockfiles/iron-Cargo.lock | 457 ------------------ src/tools/cargotest/main.rs | 4 +- 2 files changed, 2 insertions(+), 459 deletions(-) delete mode 100644 src/tools/cargotest/lockfiles/iron-Cargo.lock diff --git a/src/tools/cargotest/lockfiles/iron-Cargo.lock b/src/tools/cargotest/lockfiles/iron-Cargo.lock deleted file mode 100644 index 3aa3883b701d1..0000000000000 --- a/src/tools/cargotest/lockfiles/iron-Cargo.lock +++ /dev/null @@ -1,457 +0,0 @@ -[root] -name = "iron" -version = "0.5.1" -dependencies = [ - "conduit-mime-types 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "advapi32-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "antidote" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "bitflags" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "conduit-mime-types" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "core-foundation" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "core-foundation-sys" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crypt32-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "foreign-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "gcc" -version = "0.3.45" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "gdi32-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "httparse" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hyper" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hyper-native-tls" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "idna" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazy_static" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "log" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "matches" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "mime" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "modifier" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "native-tls" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", - "schannel 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num_cpus" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "openssl" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "openssl-sys" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pkg-config" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "plugin" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rand" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "redox_syscall" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc-serialize" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc_version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "schannel" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "crypt32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "secur32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "secur32-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "security-framework" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "security-framework-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "security-framework-sys" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "tempdir" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "time" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "typemap" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unsafe-any 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicase" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-bidi" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unsafe-any" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "url" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "user32-sys" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[metadata] -"checksum advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e06588080cb19d0acb6739808aafa5f26bfb2ca015b2b6370028b44cf7cb8a9a" -"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" -"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum conduit-mime-types 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "95ca30253581af809925ef68c2641cc140d6183f43e12e0af4992d53768bd7b8" -"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" -"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" -"checksum crypt32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e34988f7e069e0b2f3bfc064295161e489b2d4e04a2e4248fb94360cdf00b4ec" -"checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" -"checksum gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "40899336fb50db0c78710f53e87afc54d8c7266fb76262fecc78ca1a7f09deae" -"checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" -"checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d" -"checksum hyper 0.10.5 (registry+https://github.com/rust-lang/crates.io-index)" = "43a15e3273b2133aaac0150478ab443fb89f15c3de41d8d93d8f3bb14bf560f6" -"checksum hyper-native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "afe68f772f0497a7205e751626bb8e1718568b58534b6108c73a74ef80483409" -"checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4732c563b9a21a406565c4747daa7b46742f082911ae4753f390dc9ec7ee1a97" -"checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135" -"checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad" -"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" -"checksum mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5514f038123342d01ee5f95129e4ef1e0470c93bc29edf058a46f9ee3ba6737e" -"checksum modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" -"checksum native-tls 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b805ee0e8fa268f67a4e5c7f4f80adb8af1fc4428ea0ce5b0ecab1430ef17ec0" -"checksum num_cpus 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a18c392466409c50b87369414a2680c93e739aedeb498eb2bff7d7eb569744e2" -"checksum openssl 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8aa0eb7aad44f0da6f7dda13ddb4559d91a0f40cfab150b1f76ad5b39ec523f" -"checksum openssl-sys 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "14f5bfd12054d764510b887152d564ba11d99ae24ea7d740781778f646620576" -"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" -"checksum plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" -"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" -"checksum redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "29dbdfd4b9df8ab31dec47c6087b7b13cbf4a776f335e4de8efba8288dda075b" -"checksum rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "684ce48436d6465300c9ea783b6b14c4361d6b8dcbb1375b486a69cc19e2dfb0" -"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" -"checksum schannel 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c8b291854e37196c2b67249e09d6bdeff410b19e1acf05558168e9c4413b4e95" -"checksum secur32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3f412dfa83308d893101dd59c10d6fda8283465976c28c287c5c855bf8d216bc" -"checksum security-framework 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2a8396fe671bb1f80fa3f4ff2aae0e968de16ef18d37a4e5e514771a1f07726e" -"checksum security-framework-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "573b031c5f672b298cca566fac71aceea00e41bc925e75b5ec7b44dc7237180a" -"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" -"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" -"checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" -"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" -"checksum unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764" -"checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" -"checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" -"checksum unsafe-any 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b351086021ebc264aea3ab4f94d61d889d98e5e9ec2d985d993f50133537fd3a" -"checksum url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ba8a749fb4479b043733416c244fa9d1d3af3d7c23804944651c8a448cb87e" -"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/src/tools/cargotest/main.rs b/src/tools/cargotest/main.rs index 30dee9bebc004..bdbc544d4fc3b 100644 --- a/src/tools/cargotest/main.rs +++ b/src/tools/cargotest/main.rs @@ -17,8 +17,8 @@ const TEST_REPOS: &'static [Test] = &[ Test { name: "iron", repo: "https://github.com/iron/iron", - sha: "21c7dae29c3c214c08533c2a55ac649b418f2fe3", - lock: Some(include_str!("lockfiles/iron-Cargo.lock")), + sha: "cf056ea5e8052c1feea6141e40ab0306715a2c33", + lock: None, packages: &[], }, Test { From 8220252f8e9ed73f57aa4d14bca1a0d4fe589072 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 26 Sep 2019 13:24:41 +0200 Subject: [PATCH 17/18] Add test for E0543 --- .../stability-attribute-sanity.rs | 4 ++++ .../stability-attribute-sanity.stderr | 22 ++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.rs b/src/test/ui/stability-attribute/stability-attribute-sanity.rs index aebdb3bdbf571..38421e2e6ef50 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.rs +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.rs @@ -39,6 +39,10 @@ mod missing_version { #[stable(feature = "a", since = "b")] #[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542] fn f2() { } + + #[stable(feature = "a", since = "b")] + #[rustc_deprecated(since = "a")] //~ ERROR missing 'reason' [E0543] + fn f3() { } } #[unstable(feature = "b", issue = "0")] diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr index d9a5448bdd8af..4b7ec821f458b 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr @@ -58,48 +58,54 @@ error[E0542]: missing 'since' LL | #[rustc_deprecated(reason = "a")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error[E0543]: missing 'reason' + --> $DIR/stability-attribute-sanity.rs:44:5 + | +LL | #[rustc_deprecated(since = "a")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:45:1 + --> $DIR/stability-attribute-sanity.rs:49:1 | LL | #[stable(feature = "a", since = "b")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:49:1 + --> $DIR/stability-attribute-sanity.rs:53:1 | LL | #[unstable(feature = "b", issue = "0")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels - --> $DIR/stability-attribute-sanity.rs:53:1 + --> $DIR/stability-attribute-sanity.rs:57:1 | LL | #[stable(feature = "a", since = "b")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0540]: multiple rustc_deprecated attributes - --> $DIR/stability-attribute-sanity.rs:61:1 + --> $DIR/stability-attribute-sanity.rs:65:1 | LL | pub const fn multiple4() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0553]: multiple rustc_const_unstable attributes - --> $DIR/stability-attribute-sanity.rs:61:1 + --> $DIR/stability-attribute-sanity.rs:65:1 | LL | pub const fn multiple4() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: Invalid stability or deprecation version found - --> $DIR/stability-attribute-sanity.rs:61:1 + --> $DIR/stability-attribute-sanity.rs:65:1 | LL | pub const fn multiple4() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0549]: rustc_deprecated attribute must be paired with either stable or unstable attribute - --> $DIR/stability-attribute-sanity.rs:66:1 + --> $DIR/stability-attribute-sanity.rs:70:1 | LL | fn deprecated_without_unstable_or_stable() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 17 previous errors +error: aborting due to 18 previous errors For more information about this error, try `rustc --explain E0541`. From 5a0e4613ce62f1e46f974af4065e5ccb3f56a1af Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 26 Sep 2019 17:19:03 +0200 Subject: [PATCH 18/18] issue-#45696: remove ignore-compare-mode-nll --- .../issue-45696-scribble-on-boxed-borrow.nll.stderr | 9 +++------ .../ui/issues/issue-45696-scribble-on-boxed-borrow.rs | 1 - .../issues/issue-45696-scribble-on-boxed-borrow.stderr | 6 +++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr index 45b22511d27d6..db0a1719922c8 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr @@ -1,33 +1,30 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:52:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:34:5 | LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { | -- lifetime `'a` defined here LL | &mut *s.0 | ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` -... LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:63:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:39:5 | LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { | -- lifetime `'a` defined here LL | &mut *(*s).0 | ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` -... LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:74:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:44:5 | LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { | -- lifetime `'a` defined here LL | &mut *(**s).0 | ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` -... LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs index e9daf39262c2b..637cf278f8408 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs @@ -2,7 +2,6 @@ // mutable borrows that would be scribbled over by destructors before // the return occurs. -// ignore-compare-mode-nll // ignore-compare-mode-polonius struct Scribble<'a>(&'a mut u32); diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr index 18aa38899cb8e..db0a1719922c8 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.stderr @@ -1,5 +1,5 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:35:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:34:5 | LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { | -- lifetime `'a` defined here @@ -9,7 +9,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:40:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:39:5 | LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { | -- lifetime `'a` defined here @@ -19,7 +19,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:45:5 + --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:44:5 | LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { | -- lifetime `'a` defined here