about summary refs log tree commit diff
path: root/src/tools/miri/tests/pass
AgeCommit message (Collapse)AuthorLines
2025-10-02Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, ↵Matthias Krüger-0/+73
r=Mark-Simulacrum Support `#[rustc_align_static]` inside `thread_local!` Tracking issue: rust-lang/rust#146177 ```rust thread_local! { #[rustc_align_static(64)] static SO_ALIGNED: u64 = const { 0 }; } ``` This increases the amount of recursion the macro performs (once per attribute in addition to the previous once per item), making it easier to hit the recursion limit. I’ve added workarounds to limit the impact in the case of long doc comments, but this still needs a crater run just in case. r? libs ``@rustbot`` label A-attributes A-macros A-thread-locals F-static_align T-libs
2025-10-01Fix memory leak in `os` implJules Bertholet-0/+13
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-26Support `#[rustc_align_static]` inside `thread_local!`Jules Bertholet-0/+60
2025-09-25Rollup merge of #141032 - petrosagg:extract-if-ub, r=joboetMatthias Krüger-0/+10
avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if` The implementation of the `Vec::extract_if` iterator violates the safety contract adverized by `slice::from_raw_parts` by always constructing a mutable slice for the entire length of the vector even though that span of memory can contain holes from items already drained. The safety contract of `slice::from_raw_parts` requires that all elements must be properly initialized. As an example we can look at the following code: ```rust let mut v = vec![Box::new(0u64), Box::new(1u64)]; for item in v.extract_if(.., |x| **x == 0) { drop(item); } ``` In the second iteration a `&mut [Box<u64>]` slice of length 2 will be constructed. The first slot of the slice contains the bitpattern of an already deallocated box, which is invalid. This fixes the issue by only creating references to valid items and using pointer manipulation for the rest. I have also taken the liberty to remove the big `unsafe` blocks in place of targetted ones with a SAFETY comment. The approach closely mirrors the implementation of `Vec::retain_mut`. **Note to reviewers:** The diff is easier to follow with whitespace hidden.
2025-09-23Merge ref 'f6092f224d2b' from rust-lang/rustRalf Jung-4/+4
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: f6092f224d2b1774b31033f12d0bee626943b02f Filtered ref: f843cd4f29bdcd8d474dbb9e5e4365eb7f263ec6 This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-22Auto merge of #146683 - clarfonthey:safe-intrinsics, r=RalfJung,Amanieubors-4/+4
Mark float intrinsics with no preconditions as safe Note: for ease of reviewing, the list of safe intrinsics is sorted in the first commit, and then safe intrinsics are added in the second commit. All *recently added* float intrinsics have been correctly marked as safe to call due to the fact that they have no preconditions. This adds the remaining float intrinsics which are safe to call to the safe intrinsic list, and removes the unsafe blocks around their calls. --- Side note: this may want a try run before being added to the queue, since I'm not sure if there's any tier-2 code that uses these intrinsics that might not be tested on the usual PR flow. We've already uncovered a few places in subtrees that do this, and it's worth double-checking before clogging up the queue.
2025-09-22share the check_nondet helper as wellRalf Jung-174/+123
2025-09-22share check_all_outcomes impl, and increase max iteration countsRalf Jung-60/+10
2025-09-22TB: rename Active → Unique to match paperRalf Jung-5/+5
2025-09-22avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if`Petros Angelatos-0/+10
The implementation of the `Vec::extract_if` iterator violates the safety contract adverized by `slice::from_raw_parts` by always constructing a mutable slice for the entire length of the vector even though that span of memory can contain holes from items already drained. The safety contract of `slice::from_raw_parts` requires that all elements must be properly initialized. As an example we can look at the following code: ```rust let mut v = vec![Box::new(0u64), Box::new(1u64)]; for item in v.extract_if(.., |x| **x == 0) { drop(item); } ``` In the second iteration a `&mut [Box<u64>]` slice of length 2 will be constructed. The first slot of the slice contains the bitpattern of an already deallocated box, which is invalid. This fixes the issue by only creating references to valid items and using pointer manipulation for the rest. I have also taken the liberty to remove the big `unsafe` blocks in place of targetted ones with a SAFETY comment. The approach closely mirrors the implementation of `Vec::retain_mut`. Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2025-09-21Mark float intrinsics with no preconditions as safeltdk-4/+4
2025-09-18implement sqrt for f16 and f128Ralf Jung-15/+29
2025-09-17Merge pull request #4589 from LorrensP-2158466/freebsd-readdirRalf Jung-2/+1
support `readdir` on FreeBSD
2025-09-17readdir for freebsdLorrensP-2158466-2/+1
2025-09-17Merge ref '3f1552a273e4' from rust-lang/rustThe Miri Cronjob Bot-0/+19
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 3f1552a273e43e15f6ed240d00e1efdd6a53e65e Filtered ref: fbfa7b30a3ad5abd6a5db7e3ef15adc8da1ecc37 Upstream diff: https://github.com/rust-lang/rust/compare/9d82de19dfae60e55c291f5f28e28cfc2c1b9630...3f1552a273e43e15f6ed240d00e1efdd6a53e65e This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-16rustupRalf Jung-1/+2
2025-09-16Rollup merge of #146402 - RalfJung:aggregate-init, r=saethlinStuart Cook-0/+19
interpret: fix overlapping aggregate initialization This fixes the problem pointed out by ````@saethlin```` in https://github.com/rust-lang/rust/issues/146383#issuecomment-3273224645. Also clarify when exactly current de-facto MIR semantics allow overlap of the LHS and RHS in an assignment.
2025-09-14Merge ref 'a015919e54c6' from rust-lang/rustThe Miri Cronjob Bot-1/+0
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: a015919e54c60b1b2bec7a98dec478cfc4a48f4e Filtered ref: 1867c5844dba22ac4d77d1ceb7d1624c14139c16 Upstream diff: https://github.com/rust-lang/rust/compare/4ba1cf9ade4c8e2fa10676a50ee34594eb161837...a015919e54c60b1b2bec7a98dec478cfc4a48f4e This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-13Rollup merge of #145471 - rs-sac:extr, r=the8472Jacob Pratt-1/+0
Stabilize BTree{Map,Set}::extract_if Tracking issue: rust-lang/rust#70530 FCP completed: https://github.com/rust-lang/rust/issues/70530#issuecomment-3191454465 Closes: rust-lang/rust#70530
2025-09-11Merge pull request #4580 from JoJoDeveloping/fix-4579-protector-0sizedRalf Jung-0/+10
Fix #4579 by checking if the strong protector is actually "active".
2025-09-11move zero-sized protector dealloc testJohannes Hostert-15/+10
2025-09-11Merge pull request #4577 from RalfJung/release-seqRalf Jung-1/+56
Fix release/scquire synchonization for loads from the store buffer
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-09-11weak_memory: fix sync clock handling when loading from old store elementsRalf Jung-11/+33
2025-09-11add release sequence testRalf Jung-0/+33
2025-09-11Merge ref 'f4665ab8368a' from rust-lang/rustThe Miri Cronjob Bot-0/+14
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: f4665ab8368ad2e8a86d4390ae35c28bdd9561bb Filtered ref: d2e3c00d12fb613c03777e620c50528112247ad2 Upstream diff: https://github.com/rust-lang/rust/compare/a09fbe2c8372643a27a8082236120f95ed4e6bba...f4665ab8368ad2e8a86d4390ae35c28bdd9561bb This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-10add release sequence testRalf Jung-3/+39
2025-09-10this apparently needs more test roundsRalf Jung-3/+11
2025-09-10move all weak memory tests into their folderRalf Jung-2/+2
2025-09-10also use nicer check_all_outcomes in float_nanRalf Jung-177/+142
2025-09-10refactor weak-mem test to list all expected executionsRalf Jung-103/+114
2025-09-10ensure we do not see the inconsistent execution from Figure 8Ralf Jung-1/+10
2025-09-10weak memory tests: add more info on where they come fromRalf Jung-11/+14
2025-09-10interpret: fix overlapping aggregate initializationRalf Jung-0/+19
2025-09-10Rollup merge of #146178 - folkertdev:static-align, ↵Matthias Krüger-0/+14
r=jdonszelmann,ralfjung,traviscross Implement `#[rustc_align_static(N)]` on `static`s Tracking issue: https://github.com/rust-lang/rust/issues/146177 ```rust #![feature(static_align)] #[rustc_align_static(64)] static SO_ALIGNED: u64 = 0; ``` We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`. r? `@traviscross`
2025-09-09allow `#[rustc_align_static(N)]` on `static`sFolkert de Vries-0/+14
We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`.
2025-09-06Change stdlib float tests to account for miri nondet floats.LorrensP-2158466-4/+3
2025-09-06Implement nondet behaviour and change/add tests.LorrensP-2158466-44/+110
2025-09-04Rollup merge of #145690 - sayantn:integer-funnel-shift, r=tgross35Jacob Pratt-1/+7
Implement Integer funnel shifts Tracking issue: rust-lang/rust#145686 ACP: https://github.com/rust-lang/libs-team/issues/642 This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else Thanks `@folkertdev` for the fixes and tests cc `@rust-lang/libs-api`
2025-09-03fix applying an error to infinitiesRalf Jung-0/+4
2025-09-03Add `funnel_sh{l,r}` functions and intrinsicssayantn-1/+7
- Add a fallback implementation for the intrinsics - Add LLVM backend support for funnel shifts Co-Authored-By: folkertdev <folkert@folkertdev.nl>
2025-09-03fix mangitude of applied float errorRalf Jung-4/+50
2025-09-02account for aarch64 windows oversleepingRalf Jung-1/+2
2025-09-02add a flag to always apply the maximum float errorRalf Jung-0/+23
2025-08-31allow taking address to union fieldKivooeo-1/+1
2025-08-30Merge ref 'e004014d1bf4' from rust-lang/rustThe Miri Cronjob Bot-1/+0
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: e004014d1bf4c29928a0f0f9f7d0964d43606cbd Filtered ref: d62798e442c1c6ec461725b87dacc87c285259c8 This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-29Rollup merge of #145467 - Kivooeo:stabilize-strict_provenance_atomic_ptr, ↵Trevor Gross-1/+0
r=scottmcm Stabilize `strict_provenance_atomic_ptr` feature This closes [tracking issue](https://github.com/rust-lang/rust/issues/99108) and stabilises `AtomicPtr::{fetch_ptr_add, fetch_ptr_sub, fetch_byte_add, fetch_byte_sub, fetch_or, fetch_and, fetch_xor}` --- EDIT: FCP completed at https://github.com/rust-lang/rust/issues/99108#issuecomment-3168260347
2025-08-29unix read/write: fix zero-size handlingRalf Jung-1/+3
2025-08-27Stabilize BTree{Map,Set}::extract_ifSidney Cammeresi-1/+0