about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2024-12-07Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-12-06Rollup merge of #130254 - GrigorenkoPV:QuotaExceeded, r=dtolnayMatthias Krüger-1/+1
Stabilize `std::io::ErrorKind::QuotaExceeded` Also drop "Filesystem" from its name. See #130190 for more info. FCP in #130190 cc #86442 r? `@dtolnay`
2024-12-06remove a no-longer-needed work-aroundRalf Jung-6/+2
2024-12-06add testRalf Jung-1/+41
2024-12-06Remove all threading through of ErrorGuaranteed from the driverbjorn3-1/+2
It was inconsistently done (sometimes even within a single function) and most of the rest of the compiler uses fatal errors instead, which need to be caught using catch_with_exit_code anyway. Using fatal errors instead of ErrorGuaranteed everywhere in the driver simplifies things a bit.
2024-12-06Auto merge of #133089 - eholk:stabilize-noop-waker, r=dtolnaybors-10/+4
Stabilize noop_waker Tracking Issue: #98286 This is a handy feature that's been used widely in tests and example async code and it'd be nice to make it available to users. cc `@rust-lang/wg-async`
2024-12-06fix SC fence logicRalf Jung-4/+8
2024-12-06Rollup merge of #133211 - Strophox:miri-correct-state-update-ffi, r=RalfJungMatthias Krüger-47/+366
Extend Miri to correctly pass mutable pointers through FFI Based off of https://github.com/rust-lang/rust/pull/129684, this PR further extends Miri to execute native calls that make use of pointers to *mutable* memory. We adapt Miri's bookkeeping of internal state upon any FFI call that gives external code permission to mutate memory. Native code may now possibly write and therefore initialize and change the pointer provenance of bytes it has access to: Such memory is assumed to be *initialized* afterwards and bytes are given *arbitrary (wildcard) provenance*. This enables programs that correctly use mutating FFI calls to run Miri without errors, at the cost of possibly missing Undefined Behaviour caused by incorrect usage of mutating FFI. > <details> > > <summary> Simple example </summary> > > ```rust > extern "C" { > fn init_int(ptr: *mut i32); > } > > fn main() { > let mut x = std::mem::MaybeUninit::<i32>::uninit(); > let x = unsafe { > init_int(x.as_mut_ptr()); > x.assume_init() > }; > > println!("C initialized my memory to: {x}"); > } > ``` > ```c > void init_int(int *ptr) { > *ptr = 42; > } > ``` > should now show `C initialized my memory to: 42`. > > </details> r? ``@RalfJung``
2024-12-06Merge pull request #4057 from RalfJung/scfixRalf Jung-241/+225
Fix weak memory emulation to avoid generating behaviors that are forbidden under C++ 20
2024-12-06Merge from rustcThe Miri Cronjob Bot-0/+4
2024-12-06Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-12-05Stabilize noop_wakerEric Holk-10/+4
Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>
2024-12-05extend Miri to correctly pass mutable pointers through FFIStrophox-47/+366
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-12-05Avoid passing byte slice to anonsocket_readtiif-8/+8
2024-12-05make SC fences stronger, to be correct wrt C++20Ralf Jung-147/+120
2024-12-05move GlobalState definition further up so the types are mor concentrated at ↵Ralf Jung-98/+98
the top of the file
2024-12-05extend some comments regarding weak memory emulationRalf Jung-6/+17
2024-12-05Rollup merge of #118833 - Urgau:lint_function_pointer_comparisons, r=cjgillotLeón Orell Valerian Liehr-0/+4
Add lint against function pointer comparisons This is kind of a follow-up to https://github.com/rust-lang/rust/pull/117758 where we added a lint against wide pointer comparisons for being ambiguous and unreliable; well function pointer comparisons are also unreliable. We should IMO follow a similar logic and warn people about it. ----- ## `unpredictable_function_pointer_comparisons` *warn-by-default* The `unpredictable_function_pointer_comparisons` lint checks comparison of function pointer as the operands. ### Example ```rust fn foo() {} let a = foo as fn(); let _ = a == foo; ``` ### Explanation Function pointers comparisons do not produce meaningful result since they are never guaranteed to be unique and could vary between different code generation units. Furthermore different function could have the same address after being merged together. ---- This PR also uplift the very similar `clippy::fn_address_comparisons` lint, which only linted on if one of the operand was an `ty::FnDef` while this PR lints proposes to lint on all `ty::FnPtr` and `ty::FnDef`. ```@rustbot``` labels +I-lang-nominated ~~Edit: Blocked on https://github.com/rust-lang/libs-team/issues/323 being accepted and it's follow-up pr~~
2024-12-04add test to demonstrate the effect of #4008Johannes Hostert-0/+60
2024-12-04Merge pull request #4006 from JoJoDeveloping/tb-fix-3846-retagRalf Jung-90/+329
Fix #3846 properly, so that subtrees can be skipped again
2024-12-04Properly fix #3846 by resetting parents on lazy node creationJohannes Hostert-90/+306
This commit supplies a real fix, which makes retags more complicated, at the benefit of making accesses more performant. Co-authored-by: Ralf Jung <post@ralfj.de>
2024-12-04implement simd_relaxed_fmaRalf Jung-33/+97
2024-12-04update lockfileRalf Jung-12/+12
2024-12-04fmtThe Miri Cronjob Bot-1/+5
2024-12-04Merge from rustcThe Miri Cronjob Bot-19/+58
2024-12-04Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-12-04Auto merge of #133818 - matthiaskrgr:rollup-iav1wq7, r=matthiaskrgrbors-5/+45
Rollup of 7 pull requests Successful merges: - #132937 (a release operation synchronizes with an acquire operation) - #133681 (improve TagEncoding::Niche docs, sanity check, and UB checks) - #133726 (Add `core::arch::breakpoint` and test) - #133768 (Remove `generic_associated_types_extended` feature gate) - #133811 ([AIX] change AIX default codemodel=large) - #133812 (Update wasm-component-ld to 0.5.11) - #133813 (compiletest: explain that UI tests are expected not to compile by default) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-03Rollup merge of #133726 - joshtriplett:breakpoint, r=oli-obkMatthias Krüger-5/+3
Add `core::arch::breakpoint` and test Approved in [ACP 491](https://github.com/rust-lang/libs-team/issues/491).
2024-12-03Rollup merge of #133681 - RalfJung:niches, r=wesleywiserMatthias Krüger-0/+42
improve TagEncoding::Niche docs, sanity check, and UB checks Turns out the `niche_variants` range can actually contain the `untagged_variant`. We should report this as UB in Miri, so this PR implements that. Also rename `partially_check_layout` to `layout_sanity_check` for better consistency with how similar functions are called in other parts of the compiler. Turns out my adjustments to the transmutation logic also fix https://github.com/rust-lang/rust/issues/126267.
2024-12-03Auto merge of #133803 - matthiaskrgr:rollup-8ag5ncy, r=matthiaskrgrbors-2/+2
Rollup of 9 pull requests Successful merges: - #132612 (Gate async fn trait bound modifier on `async_trait_bounds`) - #133545 (Lint against Symbol::intern on a string literal) - #133558 (Structurally resolve in `probe_adt`) - #133696 (stabilize const_collections_with_hasher and build_hasher_default_const_new) - #133753 (Reduce false positives on some common cases from if-let-rescope lint) - #133762 (stabilize const_{size,align}_of_val) - #133777 (document -Zrandomize-layout in the unstable book) - #133779 (Use correct `hir_id` for array const arg infers) - #133796 (Update the definition of `borrowing_sub`) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-03Rollup merge of #132612 - compiler-errors:async-trait-bounds, r=lcnrMatthias Krüger-2/+2
Gate async fn trait bound modifier on `async_trait_bounds` This PR moves `async Fn()` trait bounds into a new feature gate: `feature(async_trait_bounds)`. The general vibe is that we will most likely stabilize the `feature(async_closure)` *without* the `async Fn()` trait bound modifier, so we need to gate that separately. We're trying to work on the general vision of `async` trait bound modifier general in: https://github.com/rust-lang/rfcs/pull/3710, however that RFC still needs more time for consensus to converge, and we've decided that the value that users get from calling the bound `async Fn()` is *not really* worth blocking landing async closures in general.
2024-12-03switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0Rémy Rakic-2/+4
2024-12-03miri: Adapt for `breakpoint` becoming safeJosh Triplett-5/+3
2024-12-02Use c"lit" for CStrings without unwrapKornel-10/+7
2024-12-02Allow fn pointers comparisons lint in UI testsUrgau-0/+4
2024-12-02Gate async fn trait bound modifier on async_trait_boundsMichael Goulet-2/+2
2024-12-01Make metadata a FileDescription operationRune Tynan-14/+14
2024-12-01Split unix-specific function into UnixFileDescriptionRune Tynan-155/+190
2024-11-30Move FdTable to public location, fix up importsRune Tynan-456/+467
2024-11-30improve TagEncoding::Niche docs and sanity checkRalf Jung-0/+42
2024-11-28remove ctrlc, unusedklensy-30/+0
2024-11-28silence clippyRalf Jung-0/+1
2024-11-28fmtThe Miri Cronjob Bot-1/+2
2024-11-28Merge from rustcThe Miri Cronjob Bot-44/+64
2024-11-28Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-11-27Rollup merge of #132410 - bjorn3:yet_another_driver_refactor_round, r=cjgillotMatthias Krüger-44/+38
Some more refactorings towards removing driver queries Follow up to https://github.com/rust-lang/rust/pull/127184 ## Custom driver breaking change The `after_analysis` callback is changed to accept `TyCtxt` instead of `Queries`. The only safe query in `Queries` to call at this point is `global_ctxt()` which allows you to enter the `TyCtxt` either way. To fix your custom driver, replace the `queries: &'tcx Queries<'tcx>` argument with `tcx: TyCtxt<'tcx>` and remove your `queries.global_ctxt().unwrap().enter(|tcx| { ... })` call and only keep the contents of the closure. ## Custom driver deprecation The `after_crate_root_parsing` callback is now deprecated. Several custom drivers are incorrectly calling `queries.global_ctxt()` from inside of it, which causes some driver code to be skipped. As such I would like to either remove it in the future or if custom drivers still need it, change it to accept an `&rustc_ast::Crate` instead.
2024-11-26Merge pull request #4031 from devnexen/solarish_statRalf Jung-34/+75
filesystem support for solarish: stat
2024-11-26filesystem support for solarish.David Carlier-34/+75
close #3890
2024-11-26Merge pull request #4059 from tiif/fixtestOli Scherer-49/+18
Simplify thread blocking tests
2024-11-26Simplify thread blocking teststiif-49/+18