Skip to content

Commit 1d79b60

Browse files
committed
make strict-provenance imply check-number-validity
1 parent 732461b commit 1d79b60

File tree

10 files changed

+11
-9
lines changed

10 files changed

+11
-9
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ environment variable:
297297
* `-Zmiri-strict-provenance` enables [strict
298298
provenance](https://github.com/rust-lang/rust/issues/95228) checking in Miri. This means that
299299
casting an integer to a pointer yields a result with 'invalid' provenance, i.e., with provenance
300-
that cannot be used for any memory access. Also implies `-Zmiri-tag-raw-pointers`.
300+
that cannot be used for any memory access. Also implies `-Zmiri-tag-raw-pointers` and
301+
`-Zmiri-check-number-validity`.
301302
* `-Zmiri-symbolic-alignment-check` makes the alignment check more strict. By
302303
default, alignment is checked by casting the pointer to an integer, and making
303304
sure that is a multiple of the alignment. This can lead to cases where a

src/bin/miri.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ fn main() {
366366
"-Zmiri-strict-provenance" => {
367367
miri_config.strict_provenance = true;
368368
miri_config.tag_raw = true;
369+
miri_config.check_number_validity = true;
369370
}
370371
"-Zmiri-track-raw-pointers" => {
371372
eprintln!(

tests/run-pass/btreemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmiri-strict-provenance -Zmiri-check-number-validity
1+
// compile-flags: -Zmiri-strict-provenance
22
#![feature(btree_drain_filter)]
33
use std::collections::{BTreeMap, BTreeSet};
44
use std::mem;

tests/run-pass/concurrency/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
2-
// compile-flags: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-check-number-validity
2+
// compile-flags: -Zmiri-disable-isolation -Zmiri-strict-provenance
33

44
use std::sync::{Arc, Barrier, Condvar, Mutex, Once, RwLock};
55
use std::thread;

tests/run-pass/concurrency/thread_locals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ignore-windows: Concurrency on Windows is not supported yet.
2-
// compile-flags: -Zmiri-strict-provenance -Zmiri-check-number-validity
2+
// compile-flags: -Zmiri-strict-provenance
33

44
//! The main purpose of this test is to check that if we take a pointer to
55
//! thread's `t1` thread-local `A` and send it to another thread `t2`,

tests/run-pass/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmiri-strict-provenance -Zmiri-check-number-validity
1+
// compile-flags: -Zmiri-strict-provenance
22
#![feature(new_uninit)]
33
#![feature(get_mut_unchecked)]
44

tests/run-pass/slices.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmiri-strict-provenance -Zmiri-check-number-validity
1+
// compile-flags: -Zmiri-strict-provenance
22
#![feature(new_uninit)]
33
#![feature(slice_as_chunks)]
44
#![feature(slice_partition_dedup)]

tests/run-pass/strings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmiri-strict-provenance -Zmiri-check-number-validity
1+
// compile-flags: -Zmiri-strict-provenance
22

33
fn empty() -> &'static str {
44
""

tests/run-pass/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmiri-strict-provenance -Zmiri-check-number-validity
1+
// compile-flags: -Zmiri-strict-provenance
22
// Gather all references from a mutable iterator and make sure Miri notices if
33
// using them is dangerous.
44
fn test_all_refs<'a, T: 'a>(dummy: &mut T, iter: impl Iterator<Item = &'a mut T>) {

tests/run-pass/vecdeque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Zmiri-strict-provenance -Zmiri-check-number-validity
1+
// compile-flags: -Zmiri-strict-provenance
22
use std::collections::VecDeque;
33

44
fn test_all_refs<'a, T: 'a>(dummy: &mut T, iter: impl Iterator<Item = &'a mut T>) {

0 commit comments

Comments
 (0)