about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2024-04-15fix error display for './miri run --dep'Ralf Jung-1/+2
2024-04-15Windows: add basic support for FormatMessageWRalf Jung-19/+79
2024-04-14Miri: run .CRT$XLB linker section on thread-endRalf Jung-208/+179
2024-04-14Run static initializersbjorn3-15/+102
2024-04-13Auto merge of #3429 - eduardosm:shift, r=RalfJungbors-159/+97
De-duplicate SSE2 sll/srl/sra code
2024-04-12De-duplicate SSE2 sll/srl/sra codeEduardo Sánchez Muñoz-159/+97
2024-04-08readme updatesRalf Jung-20/+17
2024-04-08set --sysroot outside the driver rather than messing with the arguments ↵Ralf Jung-36/+36
passed to the driver
2024-04-06MIRI_REPLACE_LIBRS_IF_NOT_TEST: also apply to crates.io cratesRalf Jung-7/+2
2024-04-06make 'missing extern static' error consistent with missing shimRalf Jung-15/+11
2024-04-06Merge from rustcRalf Jung-34/+128
2024-04-06Preparing for merge from rustcRalf Jung-1/+1
2024-04-06chore: fix some typosfindseat-7/+7
Signed-off-by: findseat <penglili@outlook.com>
2024-04-05Rollup merge of #123500 - belovdv:remove-miri-jobserver-fixme, ↵Guillaume Gomez-0/+7
r=RalfJung,oli-obk Revert removing miri jobserver workaround Reverts #123469. r? ``@ghost``
2024-04-05Revert "remove miri jobserver workaround"belovdv-0/+7
This reverts commit af81ab762888eb04d01e9ad5269df5202d6a38b8.
2024-04-05Auto merge of #123497 - GuillaumeGomez:rollup-usqb4q9, r=GuillaumeGomezbors-0/+38
Rollup of 8 pull requests Successful merges: - #122334 (Vendor rustc_codegen_gcc) - #122894 (Move check for error in impl header outside of reporting) - #123149 (Port argument-non-c-like-enum to Rust) - #123311 (Match ergonomics: implement "`&`pat everywhere") - #123350 (Actually use the inferred `ClosureKind` from signature inference in coroutine-closures) - #123474 (Port `run-make/issue-7349` to a codegen test) - #123489 (handle rustc args properly in bootstrap) - #123496 (ping on wf changes, remove fixme) r? `@ghost` `@rustbot` modify labels: rollup
2024-04-05Rollup merge of #123350 - compiler-errors:async-closure-by-move, r=oli-obkGuillaume Gomez-0/+38
Actually use the inferred `ClosureKind` from signature inference in coroutine-closures A follow-up to https://github.com/rust-lang/rust/pull/123349, which fixes another subtle bug: We were not taking into account the async closure kind we infer during closure signature inference. When I pass a closure directly to an arg like `fn(x: impl async FnOnce())`, that should have the side-effect of artificially restricting the kind of the async closure to `ClosureKind::FnOnce`. We weren't doing this -- that's a quick fix; however, it uncovers a second, more subtle bug with the way that `move`, async closures, and `FnOnce` interact. Specifically, when we have an async closure like: ``` let x = Struct; let c = infer_as_fnonce(async move || { println!("{x:?}"); } ``` The outer closure captures `x` by move, but the inner coroutine still immutably borrows `x` from the outer closure. Since we've forced the closure to by `async FnOnce()`, we can't actually *do* a self borrow, since the signature of `AsyncFnOnce::call_once` doesn't have a borrowed lifetime. This means that all `async move` closures that are constrained to `FnOnce` will fail borrowck. We can fix that by detecting this case specifically, and making the *inner* async closure `move` as well. This is always beneficial to closure analysis, since if we have an `async FnOnce()` that's `move`, there's no reason to ever borrow anything, so `move` isn't artificially restrictive.
2024-04-05Auto merge of #123317 - RalfJung:test-in-miri, r=m-ou-se,saethlin,onur-ozkanbors-34/+90
Support running library tests in Miri This adds a new bootstrap subcommand `./x.py miri` which can test libraries in Miri. This is in preparation for eventually doing that as part of bors CI, but this PR only adds the infrastructure, and doesn't enable it yet. `@rust-lang/bootstrap` should this be `x.py test --miri library/core` or `x.py miri library/core`? The flag has the advantage that we don't have to copy all the arguments from `Subcommand::Test`. It has the disadvantage that most test steps just ignore `--miri` and still run tests the regular way. For clippy you went the route of making it a separate subcommand. ~~I went with a flag now as that seemed easier, but I can change this.~~ I made it a new subcommand. Note however that the regular cargo invocation would be `cargo miri test ...`, so `x.py` is still going to be different in that the `test` is omitted. That said, we could also make it `./x.py miri-test` to make that difference smaller -- that's in fact more consistent with the internal name of the command when bootstrap invokes cargo. `@rust-lang/libs` ~~unfortunately this PR does some unholy things to the `lib.rs` files of our library crates.~~ `@m-ou-se` found a way that entirely avoids library-level hacks, except for some new small `lib.miri.rs` files that hopefully you will never have to touch. There's a new hack in cargo-miri but there it is in good company...
2024-04-05linux/foreign_items: reorder things to make more sense, remove duplicate ↵Ralf Jung-47/+32
socketpair
2024-04-05miri: go look for the item in all crates of the right nameRalf Jung-17/+34
2024-04-04Force `move` async-closures that are `FnOnce` to make their inner coroutines ↵Michael Goulet-31/+14
also `move`
2024-04-04Actually use the inferred ClosureKind from signature inference in ↵Michael Goulet-10/+65
coroutine-closures
2024-04-04remove miri jobserver workaroundbelovdv-7/+0
2024-04-04adjust frame_in_std to recognize std testsRalf Jung-10/+8
2024-04-04Merge from rustcThe Miri Cronjob Bot-16/+117
2024-04-04Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-04-03add 'x.py miri', and make it work for 'library/{core,alloc,std}'Ralf Jung-7/+48
2024-04-03rename `expose_addr` to `expose_provenance`joboet-16/+16
2024-04-03epoll: note a FIXMERalf Jung-0/+2
2024-04-03eventfd: fix flag check and note a FIXMERalf Jung-7/+10
2024-04-03shims/linux: move epoll and eventfd into their own files, together with ↵Ralf Jung-106/+105
their FD types
2024-04-03Auto merge of #3441 - RalfJung:fds, r=RalfJungbors-633/+663
shims/unix: split general FD management from FS access `fd.rs` was a mix of general file descriptor infrastructure and file system access. Split those things up properly. Also add a `socket.rs` file where support for sockets can go eventually. For now it just contains the socketpair stub.
2024-04-03shims/unix: split general FD management from FS access; make a place for socketsRalf Jung-633/+663
2024-04-02Rollup merge of #123349 - compiler-errors:async-closure-captures, r=oli-obkJubilee-0/+101
Fix capture analysis for by-move closure bodies The check we were doing to figure out if a coroutine was borrowing from its parent coroutine-closure was flat-out wrong -- a misunderstanding of mine of the way that `tcx.closure_captures` represents its captures. Fixes #123251 (the miri/ui test I added should more than cover that issue) r? `@oli-obk` -- I recognize that this PR may be underdocumented, so please ask me what I should explain further.
2024-04-03Merge from rustcThe Miri Cronjob Bot-39/+43
2024-04-03Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-04-02Rollup merge of #122935 - RalfJung:with-exposed-provenance, r=AmanieuJacob Pratt-33/+33
rename ptr::from_exposed_addr -> ptr::with_exposed_provenance As discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/To.20expose.20or.20not.20to.20expose/near/427757066). The old name, `from_exposed_addr`, makes little sense as it's not the address that is exposed, it's the provenance. (`ptr.expose_addr()` stays unchanged as we haven't found a better option yet. The intended interpretation is "expose the provenance and return the address".) The new name nicely matches `ptr::without_provenance`.
2024-04-02Comments, comments, commentsMichael Goulet-0/+2
2024-04-02Fix capture analysis for by-move closure bodiesMichael Goulet-0/+99
2024-04-01Auto merge of #123192 - RalfJung:bootstrap-test-miri, r=onur-ozkanbors-6/+10
Refactor the way bootstrap invokes `cargo miri` Instead of basically doing `cargo run --manifest-path=<cargo-miri's manifest> -- miri`, let's invoke the `cargo-miri` binary directly. That means less indirections, and also makes it easier to e.g. run the libcore test suite in Miri. (But there are still other issues with that.) Also also adjusted Miri's stage numbering so that it is consistent with rustc/rustdoc. This also makes `./x.py test miri` honor `--no-doc`. And this fixes https://github.com/rust-lang/rust/issues/123177 by moving where we handle parallel_compiler.
2024-03-31cargo-miri: better debug output; reorder a comment to make it less confusingRalf Jung-6/+10
2024-03-31update josh version and guidanceRalf Jung-13/+9
2024-03-31reset the cachesRalf Jung-8/+10
looks like the M1 runners don't like it when the cache was created on x86 also reorder the lines to be more semantically grouped
2024-03-31experiment with macOS M1 runnersRalf Jung-4/+5
2024-03-31Auto merge of #3436 - RalfJung:win-ci, r=RalfJungbors-46/+61
speed up Windows CI The many-seeds test is taking 15 minutes. Let's just run that only once instead of many times on Windows. Also refactor the CI script to make the caller control which tests are being run.
2024-03-31move './miri check' for features to the style check jobRalf Jung-8/+7
2024-03-31python: fix regex backslash escapesRalf Jung-2/+2
2024-03-31show the time that the main CI steps takeRalf Jung-6/+6
2024-03-31also control the cargo-miri env var test separatelyRalf Jung-9/+12
2024-03-31windows ci: run many-seeds test less oftenRalf Jung-1/+2