about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2025-06-01Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-05-31Add const support for float rounding methodsRuan Comelli-61/+0
Add const support for the float rounding methods floor, ceil, trunc, fract, round and round_ties_even. This works by moving the calculation logic from src/tools/miri/src/intrinsics/mod.rs into compiler/rustc_const_eval/src/interpret/intrinsics.rs. All relevant method definitions were adjusted to include the `const` keyword for all supported float types: f16, f32, f64 and f128. The constness is hidden behind the feature gate feature(const_float_round_methods) which is tracked in https://github.com/rust-lang/rust/issues/141555 This commit is a squash of the following commits: - test: add tests that we expect to pass when float rounding becomes const - feat: make float rounding methods `const` - fix: replace `rustc_allow_const_fn_unstable(core_intrinsics)` attribute with `#[rustc_const_unstable(feature = "f128", issue = "116909")]` in `library/core/src/num/f128.rs` - revert: undo update to `library/stdarch` - refactor: replace multiple `float_<mode>_intrinsic` rounding methods with a single, parametrized one - fix: add `#[cfg(not(bootstrap))]` to new const method tests - test: add extra sign tests to check `+0.0` and `-0.0` - revert: undo accidental changes to `round` docs - fix: gate `const` float round method behind `const_float_round_methods` - fix: remove unnecessary `#![feature(const_float_methods)]` - fix: remove unnecessary `#![feature(const_float_methods)]` [2] - revert: undo changes to `tests/ui/consts/const-eval/float_methods.rs` - fix: adjust after rebase - test: fix float tests - test: add tests for `fract` - chore: add commented-out `const_float_round_methods` feature gates to `f16` and `f128` - fix: adjust NaN when rounding floats - chore: add FIXME comment for de-duplicating float tests - test: remove unnecessary test file `tests/ui/consts/const-eval/float_methods.rs` - test: fix tests after upstream simplification of how float tests are run
2025-05-31Merge pull request #4361 from nia-e/remove-oopsieRalf Jung-46/+0
Remove useless file
2025-05-31accidentally committed fileNia Espera-46/+0
2025-05-31Merge from rustcThe Miri Cronjob Bot-6/+26
2025-05-31Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-05-30Rollup merge of #140825 - rs-sac:ext, r=workingjubileeJubilee-1/+1
Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if` This new parameter was requested in the btree_extract_if tracking issue: https://github.com/rust-lang/rust/issues/70530#issuecomment-2486566328 I attempted to follow the style used by `Vec::extract_if`. Before: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A> where K: Ord, F: FnMut(&K, &mut V) -> bool; } ``` After: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F, R>(&mut self, range: R, pred: F) -> ExtractIf<'_, K, V, R, F, A> where K: Ord, R: RangeBounds<K>, F: FnMut(&K, &mut V) -> bool; } ``` Related: #70530 — While I believe I have adjusted all of the necessary bits, as this is my first attempt to contribute to Rust, I may have overlooked something out of ignorance, but if you can point out any oversight, I shall attempt to remedy it.
2025-05-30handle cfg bootstrap on compiler and mirionur-ozkan-3/+26
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-30Merge pull request #4359 from RalfJung/cargo-miri-verboseRalf Jung-1/+1
cargo-miri: recognize --verbose alongside -v
2025-05-30cargo-miri: recognize --verbose alongside -vRalf Jung-1/+1
2025-05-30Merge pull request #4314 from yoctocell/fine-grained-trackingRalf Jung-175/+391
TB: Track permissions on the byte-level
2025-05-30Use "accessed" instead of "initialized" in `LocationState`Xinglu Chen-65/+68
2025-05-30Track permissions on the byte-levelXinglu Chen-116/+329
Co-authored-by: Ralf Jung <post@ralfj.de> Co-authored-by: Johannes Hostert <jhostert@ethz.ch>
2025-05-30Change diagnostic wordingtiif-12/+6
2025-05-29some refactoring of the allocatorRalf Jung-67/+74
2025-05-29add separate allocator for MiriMachineNia Espera-22/+519
Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> allow multiple seeds use bitsets fix xcompile listened to reason and made my life so much easier fmt Update src/machine.rs Co-authored-by: Ralf Jung <post@ralfj.de> fixups avoid some clones Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> address review Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> fixup comment Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> address review pt 2 nit rem fn Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> Update src/alloc/isolated_alloc.rs Co-authored-by: Ralf Jung <post@ralfj.de> address review unneeded unsafe
2025-05-29Preparing for merge from rustcRalf Jung-1/+1
2025-05-28atomic_load intrinsic: use const generic parameter for orderingRalf Jung-5/+25
2025-05-28Merge pull request #4354 from RalfJung/before_stack_popRalf Jung-1/+1
fix comment in before_stack_pop
2025-05-28fix comment in before_stack_popRalf Jung-1/+1
2025-05-28Merge pull request #4344 from CraftSpider/windows-file-cloneOli Scherer-1/+97
Implement file cloning on Windows
2025-05-28add Miri testsRalf Jung-0/+131
2025-05-28Merge pull request #4353 from rust-lang/rustup-2025-05-28Ralf Jung-6/+3
Automatic Rustup
2025-05-28Merge pull request #4351 from RalfJung/squash-winRalf Jung-1/+22
attempt to fix squash on Windows
2025-05-28Merge from rustcThe Miri Cronjob Bot-5/+2
2025-05-28Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-05-27Auto merge of #129658 - saethlin:spare-a-crumb, r=jhprattbors-4/+1
Add some track_caller info to precondition panics Currently, when you encounter a precondition check, you'll always get the caller location of the implementation of the precondition checks. But with this PR, you'll be told the location of the invalid call. Which is useful. I thought of this while looking at https://github.com/rust-lang/rust/pull/129642#issuecomment-2311703898. The changes to `tests/ui/const*` happen because the const-eval interpreter skips `#[track_caller]` frames in its backtraces. The perf implications of this are: * Increased debug binary sizes. The caller_location implementation requires that the additional data we want to display here be stored in const allocations, which are deduplicated but not across crates. There is no impact on optimized build sizes. The panic path and the caller location data get optimized out. * The compile time hit to opt-incr-patched bitmaps happens because the patch changes the line number of some function calls with precondition checks, causing us to go from 0 dirty CGUs to 1 dirty CGU. * The other compile time hits are marginal but real, and due to doing a handful of new queries. Adding more useful data isn't completely free.
2025-05-27Update tests with Range parameter to `BTreeMap::extract_if` etc.Sidney Cammeresi-1/+1
2025-05-27attempt to fix squash on WindowsRalf Jung-1/+22
2025-05-27Rename unpack to kindMichael Goulet-1/+1
2025-05-27Merge pull request #4212 from tiif/setflRalf Jung-8/+262
Support F_GETFL and F_SETFL for fcntl
2025-05-27Support F_GETFL and F_SETFL for fcntltiif-8/+262
2025-05-27pacify clippyRalf Jung-3/+1
2025-05-27fmtThe Miri Cronjob Bot-2/+8
2025-05-27Merge from rustcThe Miri Cronjob Bot-60/+67
2025-05-27Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-05-27Rollup merge of #141513 - nia-e:allocbytes-extend, r=RalfJung许杰友 Jieyou Xu (Joe)-7/+13
interpret: add allocation parameters to `AllocBytes` Necessary for a better implementation of [rust-lang/miri#4343](https://github.com/rust-lang/miri/pull/4343). Also included here is the code from that PR, adapted to this new interface for the sake of example and so that CI can run on them; the Miri changes can be reverted and merged separately, though. r? `@RalfJung`
2025-05-26Auto merge of #141406 - RalfJung:less-force-allocate, r=oli-obkbors-53/+54
interpret: do not force_allocate all return places A while ago I cleaned up our `PlaceTy` a little, but as a side-effect of that, return places had to always be force-allocated. That turns out to cause quite a few extra allocations, and for a project we are doing where we marry Miri with a model checker, that means a lot of extra work -- local variables are just so much easier to reason about than allocations. So, this PR brings back the ability to have the return place be just a local of the caller. To make this work cleanly I had to rework stack pop handling a bit, which also changes the output of Miri in some cases as the span for errors occurring during a particular phase of stack pop changed. With these changes, a no-std binary with a function of functions that just take and return scalar types and that uses no pointers now does not move *any* local variables into memory. :) r? `@oli-obk`
2025-05-26extend allocbytes with associated typeNia Espera-7/+13
2025-05-25fmtThe Miri Cronjob Bot-1/+3
2025-05-25Merge from rustcThe Miri Cronjob Bot-28/+28
2025-05-25Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-05-24Rollup merge of #141511 - Noratrieb:codegen-fn-attrs, r=compiler-errorsGuillaume Gomez-2/+2
Cleanup CodegenFnAttrFlags - Rename `USED` to `USED_COMPILER` to better reflect its behavior. - Reorder some items to group the used and allocator flags together - Renumber them without gaps
2025-05-24Cleanup CodegenFnAttrFlagsNoratrieb-2/+2
- Rename `USED` to `USED_COMPILER` to better reflect its behavior. - Reorder some items to group the used and allocator flags together - Renumber them without gaps
2025-05-24fix zulip topic URLRalf Jung-1/+1
2025-05-24rename internal panicking::try to catch_unwindRalf Jung-23/+23
2025-05-23GetUserProfileDirectoryW is now documented to always store the sizeRalf Jung-3/+3
2025-05-23Rollup merge of #141383 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-199/+734
Miri subtree update r? `@ghost`
2025-05-23test some aarch64 windows targetsRalf Jung-1/+4
2025-05-23many-seeds tests have become a lot faster thanks to multithreadingRalf Jung-7/+5