From e8ab64e424a377cdb5d6373b10d4d6ed68e38f13 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 16 Jul 2022 23:44:37 -0400 Subject: [PATCH] make unused flags work like they used to --- src/shims/backtrace.rs | 3 +-- src/shims/windows/foreign_items.rs | 12 ++---------- tests/compiletest.rs | 3 ++- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/shims/backtrace.rs b/src/shims/backtrace.rs index 62e5afbca8b..5b39f2a48aa 100644 --- a/src/shims/backtrace.rs +++ b/src/shims/backtrace.rs @@ -104,8 +104,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx for (i, ptr) in ptrs.into_iter().enumerate() { let offset = ptr_layout.size * i.try_into().unwrap(); - let op_place = - buf_place.offset(offset, ptr_layout, this)?; + let op_place = buf_place.offset(offset, ptr_layout, this)?; this.write_pointer(ptr, &op_place.into())?; } diff --git a/src/shims/windows/foreign_items.rs b/src/shims/windows/foreign_items.rs index 689d1873d58..28e60a68048 100644 --- a/src/shims/windows/foreign_items.rs +++ b/src/shims/windows/foreign_items.rs @@ -152,21 +152,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx .collect(); // Set page size. - let page_size = system_info.offset( - field_offsets[2], - dword_layout, - &this.tcx, - )?; + let page_size = system_info.offset(field_offsets[2], dword_layout, &this.tcx)?; this.write_scalar( Scalar::from_int(PAGE_SIZE, dword_layout.size), &page_size.into(), )?; // Set number of processors. - let num_cpus = system_info.offset( - field_offsets[6], - dword_layout, - &this.tcx, - )?; + let num_cpus = system_info.offset(field_offsets[6], dword_layout, &this.tcx)?; this.write_scalar(Scalar::from_int(NUM_CPUS, dword_layout.size), &num_cpus.into())?; } diff --git a/tests/compiletest.rs b/tests/compiletest.rs index c568d1c5043..ec49e80ca96 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -19,9 +19,10 @@ fn run_tests(mode: Mode, path: &str, target: Option) -> Result<()> { // Less aggressive warnings to make the rustc toolstate management less painful. // (We often get warnings when e.g. a feature gets stabilized or some lint gets added/improved.) flags.push("-Astable-features".to_owned()); + flags.push("-Aunused".to_owned()); } else { flags.push("-Dwarnings".to_owned()); - flags.push("-Dunused".to_owned()); // overwrite the -Aunused in compiletest-rs + flags.push("-Dunused".to_owned()); } if let Ok(sysroot) = env::var("MIRI_SYSROOT") { flags.push("--sysroot".to_string());