about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2025-03-06Fix tier 2 sysroots jobBen Kimock-0/+1
2025-03-06Rollup merge of #137802 - RalfJung:miri-native-call-exposed, r=oli-obkMichael Goulet-54/+120
miri native-call support: all previously exposed provenance is accessible to the callee When Miri invokes a native C function, the memory C can access needs to be "prepared": to avoid false positives, we need to consider all that memory initialized, and we need to consider it to have arbitrary provenance. So far we did this for all pointers passed to C, but not for pointers that were exposed already before the native call. This PR adjusts the logic so that we now "prepare" all memory that has ever been exposed. This fixes cases such as: - cast a pointer to integer, send that integer to C, and access the memory there (`test_pass_ptr_as_int`) - send a pointer to some memory to C, which stores it somewhere; then in Rust store another pointer in that memory, and access that via C (`test_pass_ptr_via_previously_shared_mem`) r? `````@oli-obk`````
2025-03-06Merge from rustcThe Miri Cronjob Bot-15/+0
2025-03-06Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-03-05Rollup merge of #137728 - Darksonn:no-tuple-unsize, r=oli-obk许杰友 Jieyou Xu (Joe)-15/+0
Remove unsizing coercions for tuples See https://github.com/rust-lang/rust/issues/42877#issuecomment-2686010847 and below comments for justification. Tracking issue: #42877 Fixes: #135217
2025-03-04Use size_of from the prelude instead of importedThalia Archibald-1/+1
It was added to all preludes in Rust 1.80.
2025-03-03Add an anchor to directly link to the -Zmiri-tree-borrows docsJake Goulding-1/+2
2025-03-02clippyRalf Jung-2/+1
2025-03-02Merge from rustcThe Miri Cronjob Bot-1/+1
2025-03-02Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-02-28Shorten span of panic failures in const contextEsteban Küber-1/+1
Previously, we included a redundant prefix on the panic message and a postfix of the location of the panic. The prefix didn't carry any additional information beyond "something failed", and the location of the panic is redundant with the diagnostic's span, which gets printed out even if its code is not shown. ``` error[E0080]: evaluation of constant value failed --> $DIR/assert-type-intrinsics.rs:11:9 | LL | MaybeUninit::<!>::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation panicked: aborted execution: attempted to instantiate uninhabited type `!` ``` ``` error[E0080]: evaluation of `Fail::<i32>::C` failed --> $DIR/collect-in-dead-closure.rs:9:19 | LL | const C: () = panic!(); | ^^^^^^^^ evaluation panicked: explicit panic | = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` ``` error[E0080]: evaluation of constant value failed --> $DIR/uninhabited.rs:41:9 | LL | assert!(false); | ^^^^^^^^^^^^^^ evaluation panicked: assertion failed: false | = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- When the primary span for a const error is the same as the first frame in the const error report, skip it. ``` error[E0080]: evaluation of constant value failed --> $DIR/issue-88434-removal-index-should-be-less.rs:3:24 | LL | const _CONST: &[u8] = &f(&[], |_| {}); | ^^^^^^^^^^^^^^ evaluation panicked: explicit panic | note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>` --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5 | LL | panic!() | ^^^^^^^^ the failure occurred here = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` instead of ``` error[E0080]: evaluation of constant value failed --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5 | LL | panic!() | ^^^^^^^^ explicit panic | note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>` --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5 | LL | panic!() | ^^^^^^^^ note: inside `_CONST` --> $DIR/issue-88434-removal-index-should-be-less.rs:3:24 | LL | const _CONST: &[u8] = &f(&[], |_| {}); | ^^^^^^^^^^^^^^ = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` --- Revert order of constant evaluation errors Point at the code the user wrote first and std functions last. ``` error[E0080]: evaluation of constant value failed --> $DIR/const-errs-dont-conflict-103369.rs:5:25 | LL | impl ConstGenericTrait<{my_fn(1)}> for () {} | ^^^^^^^^ evaluation panicked: Some error occurred | note: called from `my_fn` --> $DIR/const-errs-dont-conflict-103369.rs:10:5 | LL | panic!("Some error occurred"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ``` instead of ``` error[E0080]: evaluation of constant value failed --> $DIR/const-errs-dont-conflict-103369.rs:10:5 | LL | panic!("Some error occurred"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some error occurred | note: called from `<() as ConstGenericTrait<{my_fn(1)}>>::{constant#0}` --> $DIR/const-errs-dont-conflict-103369.rs:5:25 | LL | impl ConstGenericTrait<{my_fn(1)}> for () {} | ^^^^^^^^ = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) ```
2025-02-28use fixed-width integer types in C codeRalf Jung-36/+38
2025-02-28miri native-call support: all previously exposed provenance is accessible to ↵Ralf Jung-23/+87
the callee
2025-02-27Remove unneeded importAlice Ryhl-2/+0
2025-02-27Merge pull request #4215 from RalfJung/before_terminatorRalf Jung-1/+2
before_terminator: add some minor clarifying comments
2025-02-27before_terminator: add some minor clarifying commentsRalf Jung-1/+2
2025-02-27Delete tuple unsizingAlice Ryhl-13/+0
2025-02-26Update ui testOli Scherer-3/+3
2025-02-26Merge pull request #4210 from tiif/small-fix-2Oli Scherer-6/+2
Resolve more FIXMEs
2025-02-26fmtThe Miri Cronjob Bot-1/+0
2025-02-26Merge from rustcThe Miri Cronjob Bot-36/+47
2025-02-26Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-02-26Resolve more FIXMEstiif-6/+2
2025-02-25Auto merge of #137594 - RalfJung:miri-sync, r=RalfJungbors-297/+714
Miri subtree update r? `@ghost` try-job: x86_64-gnu-aux
2025-02-25disable float non-determinism for now to be able to complete the syncRalf Jung-35/+47
2025-02-25Merge from rustcRalf Jung-5/+5
2025-02-25Preparing for merge from rustcRalf Jung-1/+1
2025-02-25Auto merge of #137571 - tgross35:rollup-i1tcnv1, r=tgross35bors-1/+0
Rollup of 8 pull requests Successful merges: - #134655 (Stabilize `hash_extract_if`) - #135933 (Explain how Vec::with_capacity is faithful) - #136668 (Stabilize `core::str::from_utf8_mut` as `const`) - #136775 (Update `String::from_raw_parts` safety requirements) - #137109 (stabilize extract_if) - #137349 (Implement `read_buf` for zkVM stdin) - #137493 (configure.py: don't instruct user to run nonexistent program) - #137516 (remove some unnecessary rustc_const_unstable) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-24Rollup merge of #137109 - bend-n:knife, r=oli-obkTrevor Gross-1/+0
stabilize extract_if Tracking issue: #43244 Closes: #43244 FCP completed: https://github.com/rust-lang/rust/issues/43244#issuecomment-2523595704
2025-02-24rename simd_shuffle_generic → simd_shuffle_const_genericRalf Jung-5/+5
2025-02-24Merge pull request #4193 from bjorn3/arm64_vpmaxq_u8Ralf Jung-13/+124
Implement vpmaxq_u8 on aarch64
2025-02-24slightly extend commentRalf Jung-1/+2
2025-02-24add missing float non-determinism tests and skip some on ↵Ralf Jung-10/+24
i686-pc-windows-msvc that are internally implemented via f64
2025-02-24make sure we install the toolchain for the intended host targetRalf Jung-1/+7
2025-02-24sanity-check for HOST_TARGETRalf Jung-1/+12
2025-02-24Merge from rustcRalf Jung-19/+89
2025-02-24Preparing for merge from rustcRalf Jung-1/+1
2025-02-23Rollup merge of #137483 - bend-n:😅, r=NoratriebTrevor Gross-6/+6
rename sub_ptr to offset_from_unsigned i also made `byte_sub_ptr` `byte_offset_from_unsigned` fixes #137121 tracking issue #95892
2025-02-23Rollup merge of #136543 - RalfJung:round-ties-even, r=tgross35Trevor Gross-8/+8
intrinsics: unify rint, roundeven, nearbyint in a single round_ties_even intrinsic LLVM has three intrinsics here that all do the same thing (when used in the default FP environment). There's no reason Rust needs to copy that historically-grown mess -- let's just have one intrinsic and leave it up to the LLVM backend to decide how to lower that. Suggested by `@hanna-kruppe` in https://github.com/rust-lang/rust/issues/136459; Cc `@tgross35` try-job: test-various
2025-02-23rename sub_ptr 😅bendn-6/+6
2025-02-23stabilize extract_ifbendn-1/+0
2025-02-23Auto merge of #137237 - cuviper:stage0, r=Mark-Simulacrumbors-1/+0
Master bootstrap update https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday r? `@Mark-Simulacrum`
2025-02-23Rollup merge of #137383 - folkertdev:stabilize-unsigned-is-multiple-of, ↵Matthias Krüger-1/+0
r=Noratrieb stabilize `unsigned_is_multiple_of` tracking issue: https://github.com/rust-lang/rust/issues/128101 fcp completed in: https://github.com/rust-lang/rust/issues/128101#issuecomment-2674880635 ### Public API A version of this for all the unsigned types ```rust fn is_multiple_of(lhs: u64, rhs: u64) -> bool { match rhs { // prevent division by zero 0 => lhs == 0, _ => lhs % rhs == 0, } } ```
2025-02-23Rollup merge of #137121 - bend-n:master, r=NoratriebMatthias Krüger-3/+0
stabilize `(const_)ptr_sub_ptr` Tracking issue: #95892 Closes #95892 FCP Completed: https://github.com/rust-lang/rust/issues/95892#issuecomment-2561139730 r? ````@Noratrieb````
2025-02-21stabilize `unsigned_is_multiple_of`Folkert de Vries-1/+0
2025-02-21Add testsbjorn3-0/+40
2025-02-21Fix review commentsbjorn3-7/+7
2025-02-21Implement vpmaxq_u8 on aarch64bjorn3-13/+83
2025-02-21Resolve some FIXME from socketpair testtiif-6/+2
2025-02-20Add explanation commentJakub Beránek-0/+1
Co-authored-by: Ralf Jung <post@ralfj.de>