about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2025-05-08Update miri, cargo-miri and miri-cript to edition 2024est31-12/+11
Also update the format edition to 2024
2025-05-08remove commented-out test leftoverRalf Jung-1/+0
2025-05-08remove stray stderr fileRalf Jung-22/+0
2025-05-07test suite: use CARGO_TARGET_TMPDIR for temporary build artifactsRalf Jung-3/+2
2025-05-05Merge pull request #4310 from RalfJung/addr-space-conservationRalf Jung-8/+17
alloc_addresses: when we are running out of addresses, start reusing more aggressively
2025-05-05Merge pull request #4309 from RalfJung/both-borrows-testsRalf Jung-532/+94
move tests that are identical between SB and TB to shared files
2025-05-05alloc_addresses: when we are running out of addresses, start reusing more ↵Ralf Jung-8/+17
aggressively
2025-05-05consistent folder naming: stacked-borrows -> stacked_borrowsRalf Jung-6/+6
2025-05-05Merge pull request #4306 from yoctocell/fix-unsafecell-inside-boxRalf Jung-1/+43
Tree Borrows: Correctly handle interior mutable data in `Box`
2025-05-05move tests that are identical between SB and TB to shared filesRalf Jung-764/+326
2025-05-05Merge pull request #4307 from JoJoDeveloping/remove-unique-is-uniqueRalf Jung-451/+12
Remove -Zunique-is-unique
2025-05-04Remove -Zunique-is-uniqueJohannes Hostert-451/+12
2025-05-03Merge from rustcThe Miri Cronjob Bot-148/+120
2025-05-03Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-05-02Construct test so that it would fail for old codeXinglu Chen-5/+22
2025-05-02Rollup merge of #140521 - RalfJung:oob-error, r=saethlinMatthias Krüger-106/+106
interpret: better error message for out-of-bounds pointer arithmetic and accesses Fixes https://github.com/rust-lang/rust/issues/93881 r? `@saethlin`
2025-05-02Correctly handle interior mutable data in `Box`Xinglu Chen-1/+26
Previously, the pointee type would be behind a `*const` pointer, so `ty_is_freeze` would always be `true`, even if there was an `UnsafeCell` in `Box`.
2025-05-02Implement skeleton code for adding GenMC support to Miri (not yet functional).Patrick-6-307/+1254
- Add a cargo feature to enable GenMC support (off by default) - Add support for GenMC datastructures to MiriMachine - Adjust several functions where GenMC needs to be informed about relevant events (e.g., atomic accesses) - Add skeleton code for parsing GenMC command line arguments - Some cleanup - Finish sentences with a `.` - Fix some spelling errors/typos Co-authored-by: Ralf Jung <post@ralfj.de>
2025-05-02Merge pull request #4305 from RalfJung/squashRalf Jung-10/+84
add ./miri squash
2025-05-02add ./miri squashRalf Jung-10/+84
2025-05-01Rollup merge of #140034 - RalfJung:simd_select_bitmask-padding, r=workingjubileeGuillaume Gomez-42/+14
simd_select_bitmask: the 'padding' bits in the mask are just ignored Fixes https://github.com/rust-lang/rust/issues/137942: we documented simd_select_bitmask to require the 'padding' bits in the mask (the mask can sometimes be longer than the vector; I am referring to these extra bits as 'padding' here) to be zero, mostly because nobody felt like doing the research for what should be done when they are non-zero. However, codegen is already perfectly happy just ignoring them, so in practice they can have any value. Some of the intrinsic wrappers in stdarch have trouble ensuring that they are zero. So let's just adjust the docs and Miri to permit non-zero 'padding' bits. Cc ````@Amanieu```` ````@workingjubilee````
2025-05-01Merge pull request #4273 from yoctocell/new-cell-stateRalf Jung-72/+141
TB: add `Cell` state to support more fine-grained tracking of interior mutable data
2025-05-01Add `Cell` state to Tree BorrowsXinglu Chen-72/+141
2025-05-01fmtThe Miri Cronjob Bot-3/+1
2025-05-01Merge from rustcThe Miri Cronjob Bot-84/+98
2025-05-01Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-30interpret: better error message for out-of-bounds pointer arithmetic and ↵Ralf Jung-106/+106
accesses
2025-04-30Rollup merge of #140439 - RalfJung:miri-algebraic-float-nondet, r=oli-obkMatthias Krüger-84/+98
miri: algebraic intrinsics: bring back float non-determinism Fixes https://github.com/rust-lang/miri/issues/4289 Cc ```@bjoernager``` r? ```@oli-obk```
2025-04-29add -Zmiri-deterministic-concurrency flag and use it for concurrency testsRalf Jung-156/+129
2025-04-29Merge pull request #4272 from geetanshjuneja/schedulingRalf Jung-92/+111
Make thread scheduling fully random
2025-04-29fix comment typosRalf Jung-2/+2
2025-04-29move EnvVars::cleanup into the main-thread-exit handlerRalf Jung-10/+11
2025-04-29Added random schedulinggeetanshjuneja-92/+111
2025-04-29miri: algebraic intrinsics: bring back float non-determinismRalf Jung-84/+98
2025-04-29suppress dangerous_implicit_autorefs in TB testRalf Jung-0/+1
2025-04-29fmtThe Miri Cronjob Bot-7/+3
2025-04-29Merge from rustcThe Miri Cronjob Bot-87/+109
2025-04-29Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-28Rollup merge of #139656 - scottmcm:stabilize-slice-as-chunks, r=dtolnayChris Denton-2/+1
Stabilize `slice_as_chunks` library feature ~~Draft as this needs #139163 to land first.~~ FCP: https://github.com/rust-lang/rust/issues/74985#issuecomment-2769963395 Methods being stabilized are: ```rust impl [T] { const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]); const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]); const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]; const fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]); const fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]); const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]]; } ``` ~~(FCP's not done quite yet, but will in another day if I'm counting right.)~~ FCP Complete: https://github.com/rust-lang/rust/issues/74985#issuecomment-2797951535
2025-04-28Auto merge of #123948 - azhogin:azhogin/async-drop, r=oli-obkbors-85/+104
Async drop codegen Async drop implementation using templated coroutine for async drop glue generation. Scopes changes to generate `async_drop_in_place()` awaits, when async droppable objects are out-of-scope in async context. Implementation details: https://github.com/azhogin/posts/blob/main/async-drop-impl.md New fields in Drop terminator (drop & async_fut). Processing in codegen/miri must validate that those fields are empty (in full version async Drop terminator will be expanded at StateTransform pass or reverted to sync version). Changes in terminator visiting to consider possible new successor (drop field). ResumedAfterDrop messages for panic when coroutine is resumed after it is started to be async drop'ed. Lang item for generated coroutine for async function async_drop_in_place. `async fn async_drop_in_place<T>()::{{closure0}}`. Scopes processing for generate async drop preparations. Async drop is a hidden Yield, so potentially async drops require the same dropline preparation as for Yield terminators. Processing in StateTransform: async drops are expanded into yield-point. Generation of async drop of coroutine itself added. Shims for AsyncDropGlueCtorShim, AsyncDropGlue and FutureDropPoll. ```rust #[lang = "async_drop"] pub trait AsyncDrop { #[allow(async_fn_in_trait)] async fn drop(self: Pin<&mut Self>); } impl Drop for Foo { fn drop(&mut self) { println!("Foo::drop({})", self.my_resource_handle); } } impl AsyncDrop for Foo { async fn drop(self: Pin<&mut Self>) { println!("Foo::async drop({})", self.my_resource_handle); } } ``` First async drop glue implementation re-worked to use the same drop elaboration code as for sync drop. `async_drop_in_place` changed to be `async fn`. So both `async_drop_in_place` ctor and produced coroutine have their lang items (`AsyncDropInPlace`/`AsyncDropInPlacePoll`) and shim instances (`AsyncDropGlueCtorShim`/`AsyncDropGlue`). ``` pub async unsafe fn async_drop_in_place<T: ?Sized>(_to_drop: *mut T) { } ``` AsyncDropGlue shim generation uses `elaborate_drops::elaborate_drop` to produce drop ladder (in the similar way as for sync drop glue) and then `coroutine::StateTransform` to convert function into coroutine poll. AsyncDropGlue coroutine's layout can't be calculated for generic T, it requires known final dropee type to be generated (in StateTransform). So, `templated coroutine` was introduced here (`templated_coroutine_layout(...)` etc). Such approach overrides the first implementation using mixing language-level futures in https://github.com/rust-lang/rust/pull/121801.
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-85/+104
async_drop_in_place::{closure}, scoped async drop added.
2025-04-28Auto merge of #123239 - Urgau:dangerous_implicit_autorefs, ↵bors-0/+4
r=jdonszelmann,traviscross Implement a lint for implicit autoref of raw pointer dereference - take 2 *[t-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097)* This PR aims at implementing a lint for implicit autoref of raw pointer dereference, it is based on #103735 with suggestion and improvements from https://github.com/rust-lang/rust/pull/103735#issuecomment-1370420305. The goal is to catch cases like this, where the user probably doesn't realise it just created a reference. ```rust pub struct Test { data: [u8], } pub fn test_len(t: *const Test) -> usize { unsafe { (*t).data.len() } // this calls <[T]>::len(&self) } ``` Since #103735 already went 2 times through T-lang, where they T-lang ended-up asking for a more restricted version (which is what this PR does), I would prefer this PR to be reviewed first before re-nominating it for T-lang. ---- Compared to the PR it is as based on, this PR adds 3 restrictions on the outer most expression, which must either be: 1. A deref followed by any non-deref place projection (that intermediate deref will typically be auto-inserted) 2. A method call annotated with `#[rustc_no_implicit_refs]`. 3. A deref followed by a `addr_of!` or `addr_of_mut!`. See bottom of post for details. There are several points that are not 100% clear to me when implementing the modifications: - ~~"4. Any number of automatically inserted deref/derefmut calls." I as never able to trigger this. Am I missing something?~~ Fixed - Are "index" and "field" enough? ---- cc `@JakobDegen` `@WaffleLapkin` r? `@RalfJung` try-job: dist-various-1 try-job: dist-various-2
2025-04-27Merge pull request #4293 from primoly/unsafe-attributesBen Kimock-4/+4
Mark unsafe attributes as such
2025-04-27`unsafe(no_mangle)` in `miri_start` examplesprimoly-4/+4
2025-04-26Merge from rustcThe Miri Cronjob Bot-6/+6
2025-04-26Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-25avoid an unnecessary transmuteRalf Jung-1/+1
2025-04-25Auto merge of #140273 - matthiaskrgr:rollup-rxmuvkg, r=matthiaskrgrbors-6/+6
Rollup of 8 pull requests Successful merges: - #137096 (Stabilize flags for doctest cross compilation) - #140148 (CI: use aws codebuild for job dist-arm-linux) - #140187 ([AIX] Handle AIX dynamic library extensions within c-link-to-rust-dylib run-make test) - #140196 (Improved diagnostics for non-primitive cast on non-primitive types (`Arc`, `Option`)) - #140210 (Work around cygwin issue on condvar timeout) - #140213 (mention about `x.py setup` in `INSTALL.md`) - #140229 (`DelimArgs` tweaks) - #140248 (Fix impl block items indent) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-25Merge from rustcThe Miri Cronjob Bot-28/+8
2025-04-25Preparing for merge from rustcThe Miri Cronjob Bot-1/+1