about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2023-11-04Auto merge of #3145 - RalfJung:data-race-error, r=RalfJungbors-166/+233
give some more help for the unusual data races Fixes https://github.com/rust-lang/miri/issues/3142
2023-11-04fmtThe Miri Conjob Bot-7/+3
2023-11-04Merge from rustcThe Miri Conjob Bot-2/+2
2023-11-04Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-2/+2
Most notably, this commit changes the `pub use crate::*;` in that file to `use crate::*;`. This requires a lot of `use` items in other crates to be adjusted, because everything defined within `rustc_span::*` was also available via `rustc_span::source_map::*`, which is bizarre. The commit also removes `SourceMap::span_to_relative_line_string`, which is unused.
2023-11-02Merge from rustcThe Miri Conjob Bot-231/+11
2023-11-02Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-11-01Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomccMatthias Krüger-2/+2
Clean up unchecked_math, separate out unchecked_shifts Tracking issue: #85122 Changes: 1. Remove `const_inherent_unchecked_arith` flag and make const-stability flags the same as the method feature flags. Given the number of other unsafe const fns already stabilised, it makes sense to just stabilise these in const context when they're stabilised. 2. Move `unchecked_shl` and `unchecked_shr` into a separate `unchecked_shifts` flag, since the semantics for them are unclear and they'll likely be stabilised separately as a result. 3. Add an `unchecked_neg` method exclusively to signed integers, under the `unchecked_neg` flag. This is because it's a new API and probably needs some time to marinate before it's stabilised, and while it *would* make sense to have a similar version for unsigned integers since `checked_neg` also exists for those there is absolutely no case where that would be a good idea, IMQHO. The longer-term goal here is to prepare the `unchecked_math` methods for an FCP and stabilisation since they've existed for a while, their semantics are clear, and people seem in favour of stabilising them.
2023-10-30make sure we catch UB with _ pattern in various syntactic positionsRalf Jung-16/+87
2023-10-29Auto merge of #116270 - cjgillot:gvn-aggregate, r=oli-obk,RalfJungbors-3/+2
See through aggregates in GVN This PR is extracted from https://github.com/rust-lang/rust/pull/111344 The first 2 commit are cleanups to avoid repeated work. I propose to stop removing useless assignments as part of this pass, and let a later `SimplifyLocals` do it. This makes tests easier to read (among others). The next 3 commits add a constant folding mechanism to the GVN pass, presented in https://github.com/rust-lang/rust/pull/116012. ~This pass is designed to only use global allocations, to avoid any risk of accidental modification of the stored state.~ The following commits implement opportunistic simplifications, in particular: - projections of aggregates: `MyStruct { x: a }.x` gets replaced by `a`, works with enums too; - projections of arrays: `[a, b][0]` becomes `a`; - projections of repeat expressions: `[a; N][x]` becomes `a`; - transform arrays of equal operands into a repeat rvalue. Fixes https://github.com/rust-lang/miri/issues/3090 r? `@oli-obk`
2023-10-28Auto merge of #116609 - eduardosm:bump-stdarch, r=workingjubileebors-226/+7
Bump stdarch submodule and remove special handling for LLVM intrinsics that are no longer needed Bumps stdarch to pull https://github.com/rust-lang/stdarch/pull/1477, which reimplemented some functions with portable SIMD intrinsics instead of arch specific LLVM intrinsics. Handling of those LLVM intrinsics is removed from cranelift codegen and miri. cc `@RalfJung` `@bjorn3`
2023-10-28Auto merge of #3149 - RalfJung:atomic-readonly-loads, r=RalfJungbors-62/+135
accept some atomic loads from read-only memory matches https://github.com/rust-lang/rust/pull/115577
2023-10-28accept some atomic loads from read-only memoryRalf Jung-48/+121
2023-10-28add some tests specifically for validity checks arising from match bindersRalf Jung-0/+59
2023-10-28consolidate and extend testing for _ patterns discarding the placeRalf Jung-31/+76
2023-10-28atomic_op → atomic_rmw_opRalf Jung-14/+14
2023-10-28fmtThe Miri Conjob Bot-6/+13
2023-10-28Merge from rustcThe Miri Conjob Bot-9/+96
2023-10-28Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-10-27Auto merge of #103208 - cjgillot:match-fake-read, r=oli-obk,RalfJungbors-0/+89
Allow partially moved values in match This PR attempts to unify the behaviour between `let _ = PLACE`, `let _: TY = PLACE;` and `match PLACE { _ => {} }`. The logical conclusion is that the `match` version should not check for uninitialised places nor check that borrows are still live. The `match PLACE {}` case is handled by keeping a `FakeRead` in the unreachable fallback case to verify that `PLACE` has a legal value. Schematically, `match PLACE { arms }` in surface rust becomes in MIR: ```rust PlaceMention(PLACE) match PLACE { // Decision tree for the explicit arms arms, // An extra fallback arm _ => { FakeRead(ForMatchedPlace, PLACE); unreachable } } ``` `match *borrow { _ => {} }` continues to check that `*borrow` is live, but does not read the value. `match *borrow {}` both checks that `*borrow` is live, and fake-reads the value. Continuation of ~https://github.com/rust-lang/rust/pull/102256~ ~https://github.com/rust-lang/rust/pull/104844~ Fixes https://github.com/rust-lang/rust/issues/99180 https://github.com/rust-lang/rust/issues/53114
2023-10-27give some more help for the unusual data racesRalf Jung-29/+54
2023-10-27data-race: preserve structured access information longer, and don't ↵Ralf Jung-154/+196
upper-case access types
2023-10-27add aarch64-apple-darwin to list of supported targetsRalf Jung-2/+3
2023-10-27Auto merge of #116205 - WaffleLapkin:stabilize_pointer_byte_offsets, r=dtolnaybors-5/+0
Stabilize `[const_]pointer_byte_offsets` Closes #96283 Awaiting FCP completion: https://github.com/rust-lang/rust/issues/96283#issuecomment-1735835331 r? libs-api
2023-10-26Auto merge of #116818 - Nilstrieb:stop-submitting-bug-reports, r=wesleywiserbors-4/+7
Stop telling people to submit bugs for internal feature ICEs This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. I thought about several ways to do this but now used the explicit threading of an `Arc<AtomicBool>` through `Session`. This is not exactly incremental-safe, but this is fine, as this is set during macro expansion, which is pre-incremental, and also only affects the output of ICEs, at which point incremental correctness doesn't matter much anyways. See [MCP 620.](https://github.com/rust-lang/compiler-team/issues/596) ![image](https://github.com/rust-lang/rust/assets/48135649/be661f05-b78a-40a9-b01d-81ad2dbdb690)
2023-10-25Stabilize `[const_]pointer_byte_offsets`Maybe Waffle-5/+0
2023-10-25Stop telling people to submit bugs for internal feature ICEsNilstrieb-4/+7
This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. See MCP 620.
2023-10-25Typo.Camille GILLOT-1/+1
2023-10-25Auto merge of #3141 - rust-lang:rustup-2023-10-25, r=RalfJungbors-10/+18
Automatic Rustup
2023-10-25CLOCK_UPTIME_RAW exists on all macos targets, not just the ARM onesRalf Jung-9/+5
2023-10-25Do not merge fn pointer casts.Camille GILLOT-3/+2
2023-10-25Merge from rustcThe Miri Conjob Bot-0/+12
2023-10-25Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-10-25add some more gamma function testsRalf Jung-3/+2
2023-10-24Test match underscore on void from union.Camille GILLOT-0/+18
2023-10-24Add miri test matching on `!`.Camille GILLOT-0/+25
2023-10-24Add miri tests.Camille GILLOT-0/+46
2023-10-24Auto merge of #116461 - ChrisDenton:sleep, r=thomccbors-0/+12
Windows: Support sub-millisecond sleep Use `CreateWaitableTimerExW` with `CREATE_WAITABLE_TIMER_HIGH_RESOLUTION`. Does not work before Windows 10, version 1803 so in that case we fallback to using `Sleep`. I've created a `WaitableTimer` type so it can one day be adapted to also support waiting to an absolute time (which has been talked about). Note though that it currently returns `Err(())` because we can't do anything with the errors other than fallback to the old `Sleep`. Feel free to tell me to do errors properly. It just didn't seem worth constructing an `io::Error` if we're never going to surface it to the user. And it *should* all be infallible anyway unless the OS is too old to support it. Closes #43376
2023-10-24Auto merge of #3137 - RalfJung:data-race, r=oli-obkbors-225/+416
Detect mixed-size and mixed-atomicity non-synchronized accesses Fixes https://github.com/rust-lang/miri/issues/2303
2023-10-24we don't support thread::scope on freebsdRalf Jung-1/+1
2023-10-24futex text: avoid spurious non-atomic readsRalf Jung-13/+13
2023-10-24fix error read-read reporting when there's also an unsynchronized non-atomic ↵Ralf Jung-22/+45
read (which is fine)
2023-10-24Merge from rustcThe Miri Conjob Bot-0/+1
2023-10-24Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-10-23Auto merge of #116033 - bvanjoi:fix-116032, r=petrochenkovbors-0/+1
report `unused_import` for empty reexports even it is pub Fixes #116032 An easy fix. r? `@petrochenkov` (Discovered this issue while reviewing #115993.)
2023-10-23don't talk about 'Data race' when both accesses are atomicRalf Jung-14/+22
2023-10-23clean up imperfect overlap detection in weak-mem emulationRalf Jung-90/+28
2023-10-23detect mixed-size atomic accessesRalf Jung-72/+196
2023-10-23data_race: detect races between atomic and non-atomic accesses, even if both ↵Ralf Jung-2/+95
are reads
2023-10-23data_race: clarify and slightly refactor non-atomic handlingRalf Jung-45/+50