about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2024-04-18add test for Drop terminator on non-drop typeRalf Jung-0/+21
2024-04-17Merge from rustcRalf Jung-1/+1
2024-04-17Rollup merge of #124030 - RalfJung:adjust_alloc_base_pointer, r=oli-obkMatthias Krüger-1/+1
interpret: pass MemoryKind to adjust_alloc_base_pointer Another puzzle piece for https://github.com/rust-lang/miri/pull/3475. The 2nd commit renames base_pointer -> root_pointer; that's how Tree Borrows already calls them and I think the term is more clear than "base pointer". In particular, this distinguishes it from "base address", since a root pointer can point anywhere into an allocation, not just its base address. https://github.com/rust-lang/rust/pull/124018 has been rolled up already so I couldn't add it there any more. r? ```@oli-obk```
2024-04-17Auto merge of #3480 - RalfJung:alloc_error_handler, r=RalfJungbors-120/+171
directly call handle_alloc_error Also test more codepaths. There's like 5 different things that can happen on allocation failure! Between `-Zoom`, `#[alloc_error_handler]`, and `set_alloc_error_hook`, we have 3 layers of behavior overrides. It's all a bit messy. https://github.com/rust-lang/rust/pull/112331 seems intended to clean this up, but has not yet reached consensus.
2024-04-17no need to use miri's native stderr hereRalf Jung-3/+2
2024-04-17tests/utils: add fmt::Write implementations for miri's native stdout/stderrRalf Jung-59/+64
2024-04-17alloc_error_handler tests: directly call handle_alloc_error; test more codepathsRalf Jung-75/+122
2024-04-17interpret: rename base_pointer -> root_pointerRalf Jung-1/+1
also in Miri, "base tag" -> "root tag"
2024-04-17fmtThe Miri Cronjob Bot-10/+12
2024-04-17Merge from rustcThe Miri Cronjob Bot-2/+42
2024-04-17Rollup merge of #124013 - RalfJung:box-to-raw, r=oli-obkGuillaume Gomez-2/+42
Box::into_raw: make Miri understand that this is a box-to-raw cast Turns out https://github.com/rust-lang/rust/pull/122647 went a bit too far in cleaning up `Box`... we still need a hack in `Box::into_raw`. The nicer fix would be to make Stacked Borrows not care about reference-to-raw-pointer casts, but it's unclear whether that will ever be possible without going to full Tree Borrows. Fixes https://github.com/rust-lang/miri/issues/3473.
2024-04-16Auto merge of #3478 - RalfJung:alloc_error_handler, r=RalfJungbors-5/+186
implement support for __rust_alloc_error_handler Fixes https://github.com/rust-lang/miri/issues/3439
2024-04-16implement support for __rust_alloc_error_handlerRalf Jung-5/+186
2024-04-16no_std works on Windows nowRalf Jung-4/+0
2024-04-16Add simple async drop glue generationzetanumbers-0/+235
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2024-04-16deadlock: show backtrace for all threadsRalf Jung-9/+114
2024-04-16Box::into_raw: make Miri understand that this is a box-to-raw castRalf Jung-2/+42
2024-04-16Miri: adopt to new intrinsic typesMaybe Waffle-2/+2
2024-04-15Auto merge of #3466 - RalfJung:GetFullPathNameW, r=RalfJungbors-0/+38
add some basic support for GetFullPathNameW This is the last missing piece to make std `path::` tests work on Windows.
2024-04-15Auto merge of #3411 - RalfJung:sysroot, r=RalfJungbors-0/+7
Handle Miri sysroot entirely outside the Miri driver (Extracted from https://github.com/rust-lang/miri/pull/3409) This entirely moves the responsibility of setting miri-sysroot to whatever *invokes* the Miri driver. cargo-miri knows whether it is inside rustdoc or not and can adjust accordingly. I previously avoided doing that because there are a bunch of places that are invoking the driver (cargo-miri, the ui test suite, `./miri run`, `./x.py run miri`) and they all need to be adjusted now. But it is also somewhat less fragile as we usually have more information there -- and we can just decide that `./miri run file.rs --sysroot path` is not supported. The advantage of this is that the driver is reasonably clean and doesn't need magic environment variables like MIRI_SYSROOT, and we don't have to fight rustc_driver to use a different default sysroot. Everything is done in cargo-miri (and the other much simpler driver wrappers) where it can hopefully be debugged much better.
2024-04-15add some basic support for GetFullPathNameWRalf Jung-0/+38
2024-04-15Auto merge of #3465 - RalfJung:run-dep-error-format, r=RalfJungbors-1/+2
fix error display for './miri run --dep' Fixes https://github.com/rust-lang/miri/issues/3463
2024-04-15fix error display for './miri run --dep'Ralf Jung-1/+2
2024-04-15Windows: add basic support for FormatMessageWRalf Jung-3/+15
2024-04-08set --sysroot outside the driver rather than messing with the arguments ↵Ralf Jung-0/+7
passed to the driver
2024-04-06make 'missing extern static' error consistent with missing shimRalf Jung-9/+9
2024-04-06Merge from rustcRalf Jung-0/+38
2024-04-06chore: fix some typosfindseat-1/+1
Signed-off-by: findseat <penglili@outlook.com>
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-04Merge from rustcThe Miri Cronjob Bot-11/+112
2024-04-03rename `expose_addr` to `expose_provenance`joboet-11/+11
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-22/+22
2024-04-02Rollup merge of #122935 - RalfJung:with-exposed-provenance, r=AmanieuJacob Pratt-22/+22
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-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-30Merge from rustcThe Miri Cronjob Bot-8/+0
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-14/+70
2024-03-26In ConstructCoroutineInClosureShim, pass receiver by ref, not pointerMichael Goulet-14/+70
2024-03-26run_dep_mode: treat program.args and program.env consistentlyRalf Jung-29/+28
2024-03-24Auto merge of #3398 - tiif:add_libc_fs_test, r=RalfJungbors-0/+63
Add libc direct test for shims and update CONTRIBUTING.md Add more ``libc`` direct test for shims as mentioned in #3179. Changes: - Added ``libc`` direct tests for ``rename`` and ``ftruncate64`` - Added the command for running ``pass-dep`` test in ``CONTRIBUTING.md``
2024-03-24Add libc test for rename and ftruncatetiif-0/+63
2024-03-24Merge from rustcRalf Jung-0/+78
2024-03-23Auto merge of #122952 - RalfJung:miri, r=RalfJungbors-16/+97
Miri subtree update r? `@ghost`