about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass/both_borrows
AgeCommit message (Collapse)AuthorLines
2025-09-28Rollup merge of #141469 - Kivooeo:remove-usnsafegate, r=compiler-errorsMatthias Krüger-1/+1
Allow `&raw [mut | const]` for union field in safe code fixes rust-lang/rust#141264 r? ``@Veykril`` Unresolved questions: - [x] Any edge cases? - [x] How this works with rust-analyzer (because all I've did is prevent compiler from emitting error in `&raw` context) (rust-lang/rust-analyzer#19867) - [x] Should we allow `addr_of!` and `addr_of_mut!` as well? In current version they both (`&raw` and `addr_of!`) are allowed (They are the same) - [x] Is chain of union fields is a safe? (Yes)
2025-09-11move zero-sized protector dealloc testJohannes Hostert-15/+10
2025-09-11Fix miri issue 4579 by checking if the strong protector is actually "active".Johannes Hostert-0/+15
Where "active" means that the accessed bit is set. This also reverts miri PR 3831.
2025-08-31allow taking address to union fieldKivooeo-1/+1
2025-08-22add some ZST reborrow testsRalf Jung-1/+21
2025-06-10add SmallVec testRalf Jung-0/+99
2025-06-05Rollup merge of #140638 - RalfJung:unsafe-pinned-shared-aliased, ↵Matthias Krüger-0/+16
r=workingjubilee UnsafePinned: also include the effects of UnsafeCell This tackles https://github.com/rust-lang/rust/issues/137750 by including an `UnsafeCell` in `UnsafePinned`, thus imbuing it with all the usual properties of interior mutability (no `noalias` nor `dereferenceable` on shared refs, special treatment by Miri's aliasing model). The soundness issue is not fixed yet because coroutine lowering does not use `UnsafePinned`. The RFC said that `UnsafePinned` would not permit mutability on shared references, but since then, https://github.com/rust-lang/rust/issues/137750 has demonstrated that this is not tenable. In the face of those examples, I propose that we do the "obvious" thing and permit shared mutable state inside `UnsafePinned`. This seems loosely consistent with the fact that we allow going from `Pin<&mut T>` to `&T` (where the former can be aliased with other pointers that perform mutation, and hence the same goes for the latter) -- but the `as_ref` example shows that we in fact would need to add this `UnsafeCell` even if we didn't have a safe conversion to `&T`, since for the compiler and Miri, `&T` and `Pin<&T>` are basically the same type. To make this possible, I had to remove the `Copy` and `Clone` impls for `UnsafePinned`. Tracking issue: https://github.com/rust-lang/rust/issues/125735 Cc ``@rust-lang/lang`` ``@rust-lang/opsem`` ``@Sky9x`` I don't think this needs FCP since the type is still unstable -- we'll finally decide whether we like this approach when `UnsafePinned` is moved towards stabilization (IOW, this PR is reversible). However, I'd still like to make sure that the lang team is okay with the direction I am proposing here.
2025-05-30Merge pull request #4314 from yoctocell/fine-grained-trackingRalf Jung-1/+19
TB: Track permissions on the byte-level
2025-05-30Track permissions on the byte-levelXinglu Chen-1/+19
Co-authored-by: Ralf Jung <post@ralfj.de> Co-authored-by: Johannes Hostert <jhostert@ethz.ch>
2025-05-28add Miri testsRalf Jung-0/+16
2025-05-08remove commented-out test leftoverRalf Jung-1/+0
2025-05-05consistent folder naming: stacked-borrows -> stacked_borrowsRalf Jung-4/+1
2025-05-05move tests that are identical between SB and TB to shared filesRalf Jung-0/+555