about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2024-03-31bash: use variable expansion that properly distinguishes null vs non-existingRalf Jung-9/+9
2024-03-31ci: separetely control which host-only tests are run whereRalf Jung-21/+33
No functional change in this commit
2024-03-31there is no need for these wildcardsRalf Jung-6/+7
2024-03-31extern-so: give the version script a better name; show errors from failing ↵Ralf Jung-8/+14
to build the C lib
2024-03-31Merge from rustcThe Miri Cronjob Bot-1/+1
2024-03-31Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-03-30Auto merge of #3434 - RalfJung:stacked-borrows-cache-consistency, r=RalfJungbors-10/+18
cotrol stacked borrows consistency check with its own feature flag Fixes https://github.com/rust-lang/miri/issues/3431
2024-03-30cotrol stacked borrows consistency check with its own feature flagRalf Jung-10/+18
2024-03-30move tests away from the slow Windows builderRalf Jung-2/+2
2024-03-30run GC stress test only for host testsRalf Jung-2/+2
2024-03-30Auto merge of #3430 - RalfJung:doc, r=RalfJungbors-5/+5
make some doc comments not doc tests `./miri test --doc` will run doctests even if we have them disabled (that's a cargo quirk: https://github.com/rust-lang/cargo/issues/13668). This fixes that command to not fail.
2024-03-30make some doc comments not doc testsRalf Jung-5/+5
2024-03-30Merge from rustcThe Miri Cronjob Bot-8/+0
2024-03-30Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-03-29stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gateAria Beingessner-1/+1
This is an alternative to #121920
2024-03-29Auto merge of #122520 - scottmcm:stabilize_unchecked_math_basics, r=jhprattbors-8/+0
Stabilize `unchecked_{add,sub,mul}` Tracking issue: #85122 I think we might as well just stabilize these basic three. They're the ones that have `nuw`/`nsw` flags in LLVM. Notably, this doesn't include the potentially-more-complex or -more-situational things like `unchecked_neg` or `unchecked_shr` that are under different feature flags. To quote Ralf https://github.com/rust-lang/rust/issues/85122#issuecomment-1681669646, > Are there any objections to stabilizing at least `unchecked_{add,sub,mul}`? For those there shouldn't be any surprises about what their safety requirements are. *Semantially* these are [already available on stable, even in `const`, via](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=bdb1ff889b61950897f1e9f56d0c9a36) `checked_*`+`unreachable_unchecked`. So IMHO we might as well just let people write them directly, rather than try to go through a `let Some(x) = x.checked_add(y) else { unsafe { hint::unreachable_unchecked() }};` dance. I added additional text to each method to attempt to better describe the behaviour and encourage `wrapping_*` instead. r? rust-lang/libs-api
2024-03-29Merge from rustcThe Miri Cronjob Bot-19/+89
2024-03-29Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-03-29Auto merge of #122671 - Mark-Simulacrum:const-panic-msg, r=Nilstriebbors-2/+10
Codegen const panic messages as function calls This skips emitting extra arguments at every callsite (of which there can be many). For a librustc_driver build with overflow checks enabled, this cuts 0.7MB from the resulting shared library (see [perf]). A sample improvement from nightly: ``` leaq str.0(%rip), %rdi leaq .Lalloc_d6aeb8e2aa19de39a7f0e861c998af13(%rip), %rdx movl $25, %esi callq *_ZN4core9panicking5panic17h17cabb89c5bcc999E@GOTPCREL(%rip) ``` to this PR: ``` leaq .Lalloc_d6aeb8e2aa19de39a7f0e861c998af13(%rip), %rdi callq *_RNvNtNtCsduqIKoij8JB_4core9panicking11panic_const23panic_const_div_by_zero@GOTPCREL(%rip) ``` [perf]: https://perf.rust-lang.org/compare.html?start=a7e4de13c1785819f4d61da41f6704ed69d5f203&end=64fbb4f0b2d621ff46d559d1e9f5ad89a8d7789b&stat=instructions:u
2024-03-26Rollup merge of #123055 - onur-ozkan:miri-rustdoc, r=RalfJungMatthias Krüger-3/+9
enable cargo miri test doctests This was the cleanest solution that came to my mind so far. cc `@RalfJung` Resolves #123028
2024-03-26Auto merge of #3423 - RalfJung:proc-macro-2, r=RalfJungbors-67/+37
test-cargo-miri: add proc-macro2 This is already in the dependency tree of `serde_derive`, but I guess there is is a host dependency, here it is a target dependency. The logic is presumably the same as in anyhow, so we don't need both; let's test the one that is more widely used.
2024-03-26update the remaining test-cargo-miri dependencies as well (while we are at it)Ralf Jung-11/+11
2024-03-26update proc-macro2Ralf Jung-2/+2
2024-03-26rename our proc-macro test crate to a more clear nameRalf Jung-45/+20
and remove serde_derive, since the --extern .so file was really just a consequence of building a proc macro
2024-03-26test-cargo-miri: add proc-macro2 instead of anyhowRalf Jung-11/+6
2024-03-26In ConstructCoroutineInClosureShim, pass receiver by ref, not pointerMichael Goulet-14/+70
2024-03-26avoid mutating the global environmentRalf Jung-11/+6
2024-03-26Auto merge of #3420 - RalfJung:eyre, r=RalfJungbors-0/+25
add eyre to test-cargo-miri Same as anyhow: custom build probe, widely used.
2024-03-26add eyre to test-cargo-miriRalf Jung-0/+25
2024-03-26Auto merge of #3415 - JoJoDeveloping:tree-borrows-initialized-root, r=RalfJungbors-20/+40
Tree Borrows: Make tree root always be initialized This PR fixes a slight annoyance we discovered while formally proving that certain optimizations are sound with Tree Borrows. In particular... (copied from the commit message): There should never be an `Active` but not initialized node in the borrow tree. If such a node exists, and if it has a protector, then on a foreign read, it could become disabled. This leads to some problems when formally proving that read moving optimizations are sound. The root node is the only node for which this can happen, since all other nodes can only become `Active` when actually used. But special-casing the root node here is annoying to reason about, everything becomes much nicer if we can simply say that *all* `Active` nodes must be initialized. This requires making the root node default-initialized. This is also more intuitive, since the root arguably becomes initialized during the allocation, which can be considered a write.
2024-03-26Tree Borrows: Make tree root always be `Active` and initializedJohannes Hostert-20/+40
There should never be an `Active` but not initialized node in the borrow tree. If such a node exists, and if it has a protector, then on a foreign read, it could become disabled. This leads to some problems when formally proving that read-reordering optimizations are sound. The root node is the only node for which this can happen, since all other nodes can only become `Active` when actually used. But special- casing the root node here is annoying to reason about, everything becomes much nicer if we can simply say that *all* `Active` nodes must be initialized. This requires making the root node default- initialized. This is also more intuitive, since the root arguably becomes ini- tialized during the allocation, which can be considered a write.
2024-03-26Auto merge of #3419 - RalfJung:rustup, r=RalfJungbors-15/+8
Rustup https://github.com/rust-lang/rust/pull/123081 landed so hopefully this works now.
2024-03-26fmtRalf Jung-1/+1
2024-03-26Merge from rustcRalf Jung-15/+8
2024-03-26Preparing for merge from rustcRalf Jung-1/+1
2024-03-26cargo-miri: clean up info_query treatment a bit, and update comment about RUSTCRalf Jung-30/+31
2024-03-26run command: simplify flag computationRalf Jung-10/+13
2024-03-26run_dep_mode: treat program.args and program.env consistentlyRalf Jung-29/+28
2024-03-26enable cargo miri test doctestsonur-ozkan-3/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-26we have to ignore RUSTC_WORKSPACE_WRAPPER as wellRalf Jung-0/+7
2024-03-26Auto merge of #111769 - saethlin:ctfe-backtrace-ctrlc, r=RalfJungbors-15/+8
Print a backtrace in const eval if interrupted Demo: ```rust #![feature(const_eval_limit)] #![const_eval_limit = "0"] const OW: u64 = { let mut res: u64 = 0; let mut i = 0; while i < u64::MAX { res = res.wrapping_add(i); i += 1; } res }; fn main() { println!("{}", OW); } ``` ``` ╭ ➜ ben@archlinux:~/rust ╰ ➤ rustc +stage1 spin.rs ^Cerror[E0080]: evaluation of constant value failed --> spin.rs:8:33 | 8 | res = res.wrapping_add(i); | ^ Compilation was interrupted note: erroneous constant used --> spin.rs:15:20 | 15 | println!("{}", OW); | ^^ note: erroneous constant used --> spin.rs:15:20 | 15 | println!("{}", OW); | ^^ | = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. ```
2024-03-25support '--sysroot=' form of setting the sysroot as wellRalf Jung-1/+1
2024-03-25Merge from rustcRalf Jung-4/+4
2024-03-25Preparing for merge from rustcRalf Jung-1/+1
2024-03-25Auto merge of #3413 - RalfJung:cargo-miri-misc, r=RalfJungbors-4/+28
phase_rustdoc: add a heuristic to make us more certain that this is really rustdoc Also add anyhow to test-cargo-miri; it has a custom build probe and is widely used so let's make sure the build script does not fail.
2024-03-25phase_rustdoc: add a heuristic to make us more certain that this is really ↵Ralf Jung-4/+18
rustdoc
2024-03-25test-cargo-miri: test anyhowRalf Jung-0/+10
2024-03-25CONTRIBUTING: vsocde settings: add --all-targetsRalf Jung-0/+2
2024-03-24Auto merge of #3402 - RalfJung:miri-script, r=RalfJungbors-6/+21
miri script: build with stable toolchain `./miri toolchain` sets up a `rustup override miri`. But then if something goes wrong and the `miri` toolchain doesn't work, one can't even run `./miri toolchain` again as building miri-script needs a toolchain... So let's always use stable to build miri-script, making it override-independent. I assume everyone will have that installed.
2024-03-24Auto merge of #3406 - RalfJung:many-seeds, r=RalfJungbors-6/+7
many-seeds: propagate failure properly This may help explain https://github.com/rust-lang/miri/issues/3405.