make unused flags work like they used to

This commit is contained in:
Ralf Jung 2022-07-16 23:44:37 -04:00
parent 9782b7b039
commit e8ab64e424
3 changed files with 5 additions and 13 deletions

View File

@ -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())?;
}

View File

@ -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())?;
}

View File

@ -19,9 +19,10 @@ fn run_tests(mode: Mode, path: &str, target: Option<String>) -> 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());