about summary refs log tree commit diff
path: root/tests/ui/consts/miri_unleashed
AgeCommit message (Collapse)AuthorLines
2023-12-07also print 'immutable' flagRalf Jung-8/+8
2023-11-24Show number in error message even for one errorNilstrieb-11/+11
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-27Auto merge of #103208 - cjgillot:match-fake-read, r=oli-obk,RalfJungbors-0/+10
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-26Remove unused feature from a miri testMaybe Waffle-4/+3
2023-10-25Stabilize `[const_]pointer_byte_offsets`Maybe Waffle-1/+1
2023-10-24Use `PlaceMention` for match scrutinees.Camille GILLOT-0/+10
2023-10-16Stop trying to preserve pretty-printing.Camille GILLOT-14/+14
2023-10-16Rebless.Camille GILLOT-2/+2
2023-10-16Normalize alloc-id in tests.Camille GILLOT-14/+14
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+4
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-4/+4
also share the code that emits the actual error
2023-08-02const validation: point at where we found a pointer but expected an integerRalf Jung-3/+3
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-3/+5
2023-04-15Only enable ConstProp at mir-opt-level >= 2.Camille GILLOT-12/+0
2023-04-06Auto merge of #108504 - cjgillot:thir-pattern, r=compiler-errors,Nilstriebbors-60/+8
Check pattern refutability on THIR The current `check_match` query is based on HIR, but partially re-lowers HIR into THIR. This PR proposed to use the results of the `thir_body` query to check matches, instead of re-building THIR. Most of the diagnostic changes are spans getting shorter, or commas/semicolons not getting removed. This PR degrades the diagnostic for confusing constants in patterns (`let A = foo()` where `A` resolves to a `const A` somewhere): it does not point ot the definition of `const A` any more.
2023-04-05Bless testsThom Chiovoloni-2/+2
2023-04-03Perform match checking on THIR.Camille GILLOT-60/+8
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-20/+14
2023-01-11Move /src/test to /testsAlbert Larsan-0/+1284