about summary refs log tree commit diff
path: root/src/tools/miri
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-28remove explicit deref of AbiAlign for most methodsJubilee Young-1/+1
Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed. For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
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-26Apply cfg(bootstrap) replacementMark Rousskov-6/+0
2025-09-26Support `#[rustc_align_static]` inside `thread_local!`Jules Bertholet-0/+60
2025-09-25Auto merge of #147037 - matthiaskrgr:rollup-xtgqzuu, r=matthiaskrgrbors-0/+10
Rollup of 8 pull requests Successful merges: - rust-lang/rust#116882 (rustdoc: hide `#[repr]` if it isn't part of the public ABI) - rust-lang/rust#135771 ([rustdoc] Add support for associated items in "jump to def" feature) - rust-lang/rust#141032 (avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if`) - rust-lang/rust#142401 (Add proper name mangling for pattern types) - rust-lang/rust#146293 (feat: non-panicking `Vec::try_remove`) - rust-lang/rust#146859 (BTreeMap: Don't leak allocators when initializing nodes) - rust-lang/rust#146924 (Add doc for `NonZero*` const creation) - rust-lang/rust#146933 (Make `render_example_with_highlighting` return an `impl fmt::Display`) r? `@ghost` `@rustbot` modify labels: rollup
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-25Rollup merge of #146735 - Qelxiros:const_mul_add, r=tgross35,RalfJungStuart Cook-41/+5
unstably constify float mul_add methods Tracking issue: rust-lang/rust#146724 r? `@tgross35`
2025-09-24unstably constify float mul_add methodsJeremy Smart-41/+5
Co-authored-by: Ralf Jung <post@ralfj.de>
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-23Prepare for merging from rust-lang/rustRalf Jung-1/+1
This updates the rust-version file to f6092f224d2b1774b31033f12d0bee626943b02f.
2025-09-22fix SIFA logicRalf Jung-12/+23
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/+138
2025-09-22share check_all_outcomes impl, and increase max iteration countsRalf Jung-60/+45
2025-09-22Merge pull request #4595 from RalfJung/tb-termsRalf Jung-197/+128
TB: update terminology to match paper & MiniRust
2025-09-22Tree::new_child: remove SIFA precondition and sync terminologyRalf Jung-70/+34
2025-09-22TB: rename Active → Unique to match paperRalf Jung-128/+95
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-20CI: test bootstrap buildRalf Jung-2/+37
2025-09-20clippyRalf Jung-4/+4
2025-09-20Merge ref 'ec3867107526' from rust-lang/rustThe Miri Cronjob Bot-2/+16
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: ec38671075266e9cee0348701da2e133379e7c6c Filtered ref: ed8e25574abf50600d9d2fd61eda90708ccce6c2 Upstream diff: https://github.com/rust-lang/rust/compare/3f1552a273e43e15f6ed240d00e1efdd6a53e65e...ec38671075266e9cee0348701da2e133379e7c6c This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-20Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to ec38671075266e9cee0348701da2e133379e7c6c.
2025-09-19fix clippy warningRalf Jung-2/+2
2025-09-19fix miri bootstrap buildRalf Jung-2/+16
2025-09-18Merge pull request #4592 from RalfJung/sqrtRalf Jung-38/+54
implement sqrt for f16 and f128
2025-09-18share sqrt implemention across float typesRalf Jung-39/+25
2025-09-18implement sqrt for f16 and f128Ralf Jung-15/+45
2025-09-18Merge pull request #4583 from Patrick-6/miri-genmc-estimationRalf Jung-170/+395
Add GenMC estimation mode.
2025-09-18tweak genmc error report noteRalf Jung-14/+23
2025-09-18Add GenMC estimation mode. Improve error handling and output printing.Patrick-6-170/+386
2025-09-17Merge pull request #4589 from LorrensP-2158466/freebsd-readdirRalf Jung-27/+46
support `readdir` on FreeBSD
2025-09-17readdir for freebsdLorrensP-2158466-27/+46
2025-09-17Merge ref '3f1552a273e4' from rust-lang/rustThe Miri Cronjob Bot-7/+63
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-17Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to 3f1552a273e43e15f6ed240d00e1efdd6a53e65e.
2025-09-16rustupRalf Jung-2/+3
2025-09-16Rollup merge of #146402 - RalfJung:aggregate-init, r=saethlinStuart Cook-7/+63
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-14Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to a015919e54c60b1b2bec7a98dec478cfc4a48f4e.
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-13Merge ref '4ba1cf9ade4c' from rust-lang/rustThe Miri Cronjob Bot-0/+1
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 4ba1cf9ade4c8e2fa10676a50ee34594eb161837 Filtered ref: 84b64d836ed478c54972a1d2639e60fa5f3ce26f Upstream diff: https://github.com/rust-lang/rust/compare/2a9bacf6187685931d52346a0ecff2e52bdc91cc...4ba1cf9ade4c8e2fa10676a50ee34594eb161837 This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-13Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to 4ba1cf9ade4c8e2fa10676a50ee34594eb161837.
2025-09-12Merge pull request #4578 from Patrick-6/miri-genmc-casRalf Jung-54/+850
Add compare_exchange support for GenMC mode
2025-09-12Implement more features for GenMC modePatrick-6-54/+850
- Handling Compare-Exchange operations. - Limitation: Compare-Exchange currently ignores possibility of spurious failures. - Limitation: Compare-Exchange failure memory ordering is ignored. - Upgrade compare-exchange success ordering to avoid reporting non-existent bugs. - Add warnings for GenMC mode for unsupported features. - Add a lot of tests, including translation of GenMC litmus tests and Loom tests. - Cleanup
2025-09-12make a basic hello world work on wasip2Ralf Jung-2/+70
2025-09-12move _Unwind_RaiseException out of the frame_in_std sectionRalf Jung-16/+16
2025-09-12disable broken parts of CI for nowRalf Jung-16/+17
2025-09-12Rollup merge of #145895 - RalfJung:unpark, r=joboetStuart Cook-0/+1
thread parking: fix docs and examples Fixes https://github.com/rust-lang/rust/issues/145816 r? ```@joboet``` Cc ```@m-ou-se``` ```@Amanieu```