about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2023-07-31Rollup merge of #113717 - cuishuang:master, r=NilstriebMatthias Krüger-1/+1
remove repetitive words
2023-07-31fix alignment handling for Repeat expressionsRalf Jung-0/+24
2023-07-31Auto merge of #3002 - RalfJung:miri-script, r=RalfJungbors-1/+1
fix oversight from new miri-script
2023-07-31fix oversight from new miri-scriptRalf Jung-1/+1
2023-07-31add some interesting tests for alignment corner casesRalf Jung-18/+67
2023-07-31remove repetitive wordscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-07-31Auto merge of #2909 - osiewicz:rewrite-miri-script-in-rust-2883, r=RalfJungbors-361/+1016
Rewrite miri script in rust This is a sketch of a rewrite of miri script in Rust. It does not include changes made in https://github.com/rust-lang/miri/pull/2908 yet. Environment variables are not properly propagated yet, which is something I plan to address. This PR is mostly a heads-up about the ongoing effort and it's state. It's definitely not the cleanest code I've seen in my life, but my first goal was feature/interface parity. I will iterate on it a bit before marking it as ready. I wonder though how this should be integrated/tested. Are you aware of anyone using `./miri` in their scripts? I guess we should keep existing `miri` script in place and let it run miri-script package directly? CI should probably `cargo check` this package as well. Fixes #2883
2023-07-31port to hand-rolled parser, since clap doesn't behave just the right wayRalf Jung-354/+150
2023-07-31miri-script refactorRalf Jung-614/+553
2023-07-30rewrite miri script in RustPiotr Osiewicz-357/+1277
2023-07-30Auto merge of #2997 - RalfJung:test-utils, r=RalfJungbors-112/+77
refactor tests/utils a bit, and move some FS functions there
2023-07-30refactor tests/utils a bit, and move some FS functions thereRalf Jung-112/+77
2023-07-30fmtThe Miri Conjob Bot-1/+1
2023-07-30Merge from rustcThe Miri Conjob Bot-8/+10
2023-07-30Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-07-29Auto merge of #114211 - RalfJung:miri, r=RalfJungbors-233/+336
update Miri r? `@ghost`
2023-07-29Auto merge of #2993 - Vanille-N:tb-protector, r=RalfJungbors-151/+264
TB: Redefine trigger condition for protectors The Coq formalization revealed that as currently implemented, read accesses did not always commute. Indeed starting from a lazily initialized `Active` protected tag, applying a foreign read then a child read produces `Frozen`, but child read then foreign read triggers UB (because the child read initializes _before_ the `Active -> Frozen`). This reformulation of when protectors trigger fixes that issue: - instead of `Active + foreign read -> Frozen` and `Active -> Frozen` when protected is UB - we do `Active + foreign read -> if protected { Disabled } else { Frozen }` There is already precedent for transitions being dependent on the presence of a protector (`Reserved + foreign read -> if protected { Frozen } else { Reserved }`), and this has the nice side-effect of simplifying the protector trigger condition to just an equality check against `Disabled` since now there is protector UB iff a protected tag becomes `Disabled`. In order not to introduce an extra `if`, it was decided that `Disabled -> Disabled` would be UB when protected, which was not the case previously. This is merely a theoretical for now because a protected `Disabled` is unreachable in the first place. The extra test is not directly related to this modification, but also checks things related to protectors and lazy initialization.
2023-07-29doc comment suggestionsNeven Villani-25/+57
2023-07-29Adjust some tests for invalid_reference_casting improvementsUrgau-0/+4
2023-07-29Fix test output.Mara Bos-2/+4
2023-07-29Change default panic handler message format.Mara Bos-47/+94
2023-07-29Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstriebbors-2/+2
Rename and allow `cast_ref_to_mut` lint This PR is a small subset of https://github.com/rust-lang/rust/pull/112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`). BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until https://github.com/rust-lang/rust/pull/112431 is merged. r? `@Nilstrieb`
2023-07-28exract a perform_access, check read-read commutation exhaustivelyNeven Villani-100/+193
2023-07-27Auto merge of #113298 - tgross35:update-bless-envs, r=oli-obkbors-6/+8
Unite bless environment variables under `RUST_BLESS` Currently, Clippy and Miri both use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Rename the variable `MIRI_BLESS` (as used in the Miri subtree) to `RUST_BLESS` - Rename the variable `BLESS` (as used in the Clippy subtree) to `RUST_BLESS` - Move emitting `RUST_BLESS` into `prepare_cargo_test` so it is always available (I need this for a WIP PR) --- I prefer something like `RUST_BLESS` to `BLESS` just for a lower chance of conflict (not super common but other tools [do use `BLESS`](https://grep.app/search?q=%22BLESS%22&case=true&words=true&filter[lang][0]=Text&filter[lang][1]=Rust&filter[lang][2]=Python&filter[lang][3]=C%2B%2B&filter[lang][4]=Markdown&filter[lang][5]=C&filter[lang][6]=JSON)), but I can change it to whatever is preferred. Original discussion: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/BLESS.20env.20var.3A.20rename.20to.20CLIPPY_BLESS r? `@oli-obk` cc `@flip1995`
2023-07-27fmtRalf Jung-20/+11
2023-07-27Merge from rustcRalf Jung-136/+125
2023-07-27Preparing for merge from rustcRalf Jung-1/+1
2023-07-26Auto merge of #113843 - wesleywiser:replace_rustc_apfloat, r=pnkfelixbors-10/+0
Replace in-tree `rustc_apfloat` with the new version of the crate Replace the in-tree version of `rustc_apfloat` with the new version of the crate which has been correctly licensed. The new crate incorporates upstream changes from LLVM since the original port was done including many correctness fixes and has been extensively fuzz tested to validate correctness. Fixes #100233 Fixes #102403 Fixes #113407 Fixes #113409 Fixes #55993 Fixes #93224 Closes #93225 Closes #109573
2023-07-26Unite bless environment variables under `RUSTC_BLESS`Trevor Gross-6/+8
Currently, Clippy, Miri, Rustfmt, and rustc all use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Emit `RUSTC_BLESS` within `prepare_cargo_test` so it is always available - Change usage of `MIRI_BLESS` in the Miri subtree to use `RUSTC_BLESS` - Change usage of `BLESS` in the Clippy subtree to `RUSTC_BLESS` - Change usage of `BLESS` in the Rustfmt subtree to `RUSTC_BLESS` - Adjust the blessable test in `rustc_errors` to use this same convention - Update documentation where applicable Any tools that uses `RUSTC_BLESS` should check that it is set to any value other than `"0"`.
2023-07-26Fix miriWesley Wiser-10/+0
2023-07-26we correctly check that the perm is not lazy when triggering protectorsNeven Villani-0/+16
2023-07-26fix protectors so that all reads actually commuteNeven Villani-87/+59
2023-07-26Auto merge of #2991 - rust-lang:rustup-2023-07-26, r=RalfJungbors-159/+151
Automatic sync from rustc
2023-07-26normalize tree borrow diagnostics across targetsRalf Jung-52/+54
2023-07-26move CI var uses after their declarationRalf Jung-4/+4
2023-07-26sparse registry has been stable for a bit nowRalf Jung-3/+0
2023-07-26move nightly cron job a little earlierRalf Jung-1/+1
2023-07-26fmtThe Miri Conjob Bot-2/+3
2023-07-26Merge from rustcThe Miri Conjob Bot-106/+95
2023-07-26Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-07-25make MPlaceTy non-CopyRalf Jung-12/+12
2023-07-25interpret: make read functions generic over operand typeRalf Jung-45/+45
2023-07-25interpret: make write functions generic over the place typeRalf Jung-71/+71
2023-07-25Auto merge of #114011 - RalfJung:place-projection, r=oli-obkbors-106/+95
interpret: Unify projections for MPlaceTy, PlaceTy, OpTy For ~forever, we didn't really have proper shared code for handling projections into those three types. This is mostly because `PlaceTy` projections require `&mut self`: they might have to `force_allocate` to be able to represent a project part-way into a local. This PR finally fixes that, by enhancing `Place::Local` with an `offset` so that such an optimized place can point into a part of a place without having requiring an in-memory representation. If we later write to that place, we will still do `force_allocate` -- for now we don't have an optimized path in `write_immediate` that would avoid allocation for partial overwrites of immediately stored locals. But in `write_immediate` we have `&mut self` so at least this no longer pollutes all our type signatures. (Ironically, I seem to distantly remember that many years ago, `Place::Local` *did* have an `offset`, and I removed it to simplify things. I guess I didn't realize why it was so useful... I am also not sure if this was actually used to achieve place projection on `&self` back then.) The `offset` had type `Option<Size>`, where `None` represent "no projection was applied". This is needed because locals *can* be unsized (when they are arguments) but `Place::Local` cannot store metadata: if the offset is `None`, this refers to the entire local, so we can use the metadata of the local itself (which must be indirect); if a projection gets applied, since the local is indirect, it will turn into a `Place::Ptr`. (Note that even for indirect locals we can have `Place::Local`: when the local appears in MIR, we always start with `Place::Local`, and only check `frame.locals` later. We could eagerly normalize to `Place::Ptr` but I don't think that would actually simplify things much.) Having done all that, we can finally properly abstract projections: we have a new `Projectable` trait that has the basic methods required for projecting, and then all projection methods are implemented for anything that implements that trait. We can even implement it for `ImmTy`! (Not that we need that, but it seems neat.) The visitor can be greatly simplified; it doesn't need its own trait any more but it can use the `Projectable` trait. We also don't need the separate `Mut` visitor any more; that was required only to reflect that projections on `PlaceTy` needed `&mut self`. It is possible that there are some more `&mut self` that can now become `&self`... I guess we'll notice that over time. r? `@oli-obk`
2023-07-25interpret: refactor projection code to work on a common trait, and use that ↵Ralf Jung-103/+92
for visitors
2023-07-24interpret: support projecting into Place::Local without force_allocationRalf Jung-3/+3
2023-07-23Merge from rustcRalf Jung-12/+9
2023-07-23Preparing for merge from rustcRalf Jung-1/+1
2023-07-22fmtThe Miri Conjob Bot-2/+2
2023-07-22Merge from rustcThe Miri Conjob Bot-9/+12