about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
AgeCommit message (Collapse)AuthorLines
2022-08-07add -Zextra-const-ub-checks to enable more UB checking in const-evalRalf Jung-0/+14
2022-08-06make NOP dyn casts not require anything about the vtableRalf Jung-1/+6
2022-08-06Auto merge of #99743 - compiler-errors:fulfillment-context-cleanups, r=jackh726bors-10/+2
Some `FulfillmentContext`-related cleanups Use `ObligationCtxt` in some places, remove some `FulfillmentContext`s in others... r? types
2022-08-05add method to get the mutability of an AllocIdRalf Jung-0/+7
2022-08-04Rollup merge of #100095 - jackh726:early-binder, r=lcnrMatthias Krüger-2/+2
More EarlyBinder cleanups Each commit is independent r? types
2022-08-04Add `traits::fully_solve_obligation` that acts like `traits::fully_normalize`Michael Goulet-10/+2
It spawns up a trait engine, registers the single obligation, then fully solves it
2022-08-03Rollup merge of #99746 - compiler-errors:more-trait-engine, r=jackh726Matthias Krüger-2/+2
Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot` Not sure if this change is worthwhile, but couldn't hurt re: chalkification r? types
2022-08-03Auto merge of #100064 - RalfJung:disaligned, r=petrochenkovbors-16/+12
fix is_disaligned logic for nested packed structs https://github.com/rust-lang/rust/pull/83605 broke the `is_disaligned` logic by bailing out of the loop in `is_within_packed` early. This PR fixes that problem and adds suitable tests. Fixes https://github.com/rust-lang/rust/issues/99838
2022-08-03fix is_disaligned logic for nested packed structsRalf Jung-16/+12
2022-08-03Add bound_impl_subject and bound_return_tyJack Huey-2/+2
2022-08-01Remove trait_of_item query.Camille GILLOT-1/+1
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-3/+6
2022-08-01Rollup merge of #100003 - nnethercote:improve-size-assertions, r=lqdMatthias Krüger-27/+23
Improve size assertions. - For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order. r? `@lqd`
2022-08-01Improve size assertions.Nicholas Nethercote-27/+23
- For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order.
2022-07-30interpret: only consider 1-ZST when searching for receiverRalf Jung-1/+3
2022-07-30Use LocalDefId for closures moreCameron Steffen-1/+1
2022-07-27Rollup merge of #99651 - compiler-errors:fn-and-raw-ptr-in-const-generics, ↵Guillaume Gomez-1/+1
r=oli-obk Deeply deny fn and raw ptrs in const generics I think this is right -- just because we wrap a fn ptr in a wrapper type does not mean we should allow it in a const parameter. We now reject both of these in the same way: ``` #![feature(adt_const_params)] #[derive(Eq, PartialEq)] struct Wrapper(); fn foo<const W: Wrapper>() {} fn foo2<const F: fn()>() {} ``` This does regress one test (`src/test/ui/consts/refs_check_const_eq-issue-88384.stderr`), but I'm not sure it should've passed in the first place. cc: ``@b-naber`` who introduced that test^ fixes #99641
2022-07-26ICE on RawPtrComparison checkDeadbeef-4/+4
2022-07-26Rollup merge of #99692 - RalfJung:too-far, r=oli-obkDylan DPC-24/+48
interpret, ptr_offset_from: refactor and test too-far-apart check We didn't have any tests for the "too far apart" message, and indeed that check mostly relied on the in-bounds check and was otherwise probably not entirely correct... so I rewrote that check, and it is before the in-bounds check so we can test it separately.
2022-07-26Use TraitEngine in more places that don't specifically need ↵Michael Goulet-2/+2
FulfillmentCtxt::new_in_snapshot
2022-07-26Rollup merge of #99673 - RalfJung:interpret-invalid-dyn, r=oli-obkYuki Okushi-2/+2
don't ICE on invalid dyn calls Due to https://github.com/rust-lang/rust/issues/50781 this is actually reachable. Fixes https://github.com/rust-lang/miri/issues/2432 r? ``@oli-obk``
2022-07-25Remove non-descriptive boolean from search_for_structural_match_violationMichael Goulet-1/+1
2022-07-25Deeply deny fn and raw ptrs in const genericsMichael Goulet-1/+1
2022-07-24interpret, ptr_offset_from: refactor and test too-far-apart checkRalf Jung-24/+48
2022-07-24don't ICE on invalid dyn callsRalf Jung-2/+2
2022-07-23now we can make scalar_to_ptr a method on ScalarRalf Jung-45/+23
2022-07-23remove some provenance-related machine hooks that Miri no longer needsRalf Jung-46/+17
2022-07-22interpret: fix vtable check debug assertionRalf Jung-2/+1
2022-07-20detect bad vptrs on dyn callsRalf Jung-15/+46
2022-07-20detect bad vtables on an upcastRalf Jung-2/+5
2022-07-20consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)Ralf Jung-12/+12
2022-07-20incorporate some review feedbackRalf Jung-28/+8
2022-07-20add intrinsic to access vtable size and alignRalf Jung-0/+12
2022-07-20make use of symbolic vtables in interpreterRalf Jung-193/+93
2022-07-20rename get_global_alloc to try_get_global_allocRalf Jung-11/+11
2022-07-20add a Vtable kind of symbolic allocationsRalf Jung-1/+17
2022-07-20Auto merge of #99472 - RalfJung:provenance, r=oli-obkbors-478/+481
interpret: rename Tag/PointerTag to Prov/Provenance We were pretty inconsistent with calling this the "tag" vs the "provenance" of the pointer; I think we should consistently call it "provenance". r? `@oli-obk`
2022-07-20Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"Oli Scherer-13/+1
This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.
2022-07-19interpret: rename Tag/PointerTag to Prov/ProvenanceRalf Jung-478/+481
Let's avoid using two different terms for the same thing -- let's just call it "provenance" everywhere. In Miri, provenance consists of an AllocId and an SbTag (Stacked Borrows tag), which made this even more confusing.
2022-07-19Auto merge of #99309 - RalfJung:no-large-copies, r=oli-obkbors-78/+50
interpret: make some large types not Copy Also remove some unused trait impls (mostly HashStable). This didn't find any unnecessary copies that I managed to avoid, but it might still be better to require explicit clone for these types? Not sure. r? `@oli-obk`
2022-07-18interpret: make some large types not CopyRalf Jung-35/+41
2022-07-18interpret: remove some unused trait implsRalf Jung-44/+10
2022-07-18Rollup merge of #99378 - RalfJung:box-early-return, r=oli-obkDylan DPC-0/+3
interpret/visitor: add missing early return I forgot to add this when adding the special `Box` handling branch. r? ```@oli-obk```
2022-07-17Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obkbors-30/+74
Use constant eval to do strict mem::uninit/zeroed validity checks I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case. Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies. I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally. Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay? Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested. Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
2022-07-17interpret/visitor: add missing early returnRalf Jung-0/+3
2022-07-16Stabilize `let_chains`Caio-1/+1
2022-07-16Rollup merge of #99259 - RalfJung:visit-a-place, r=oli-obkMatthias Krüger-50/+272
interpret/visitor: support visiting with a PlaceTy Finally we can visit a `PlaceTy` in a way that will only do `force_allocation` when needed ti visit a field. :) r? `@oli-obk`
2022-07-15interpret/visitor: support visiting with a PlaceTyRalf Jung-48/+268
2022-07-15Introduce opaque type to hidden type projectionOli Scherer-1/+13
2022-07-15Auto merge of #99013 - RalfJung:dont-poison-my-places, r=oli-obkbors-22/+13
interpret: get rid of MemPlaceMeta::Poison This is achieved by refactoring the projection code (`{mplace,place,operand}_{downcast,field,index,...}`) so that we no longer need to call `assert_mem_place` in the operand handling.