about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
AgeCommit message (Collapse)AuthorLines
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-12/+2
also share the code that emits the actual error
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-72/+35
2023-09-14make it more clear which functions create fresh AllocIdRalf Jung-10/+7
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-1/+1
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-8/+11
2023-09-13Auto merge of #115820 - matthiaskrgr:rollup-kyglvpu, r=matthiaskrgrbors-32/+7
Rollup of 6 pull requests Successful merges: - #115736 (Remove `verbose_generic_activity_with_arg`) - #115771 (cleanup leftovers of const_err lint) - #115798 (add helper method for finding the one non-1-ZST field) - #115812 (Merge settings.css into rustdoc.css) - #115815 (fix: return early when has tainted in mir pass) - #115816 (Disabled socketpair for Vita) r? `@ghost` `@rustbot` modify labels: rollup
2023-09-12Introduce Machine::POST_MONO_CHECKS.Camille GILLOT-4/+9
2023-09-12add helper method for finding the one non-1-ZST fieldRalf Jung-32/+7
2023-09-12Auto merge of #115705 - cjgillot:const-prop-aggregate, r=oli-obkbors-5/+6
Read from non-scalar constants and statics in dataflow const-prop DataflowConstProp is designed to handle scalar values. When MIR features an assignment from a non-scalar constant, we need to manually decompose it into the custom state space. This PR tweaks interpreter callbacks to allow reusing `eval_mir_constant` without having a stack frame to get a span from. r? `@oli-obk` cc `@jachris`
2023-09-11Use write_immediate.Camille GILLOT-2/+2
2023-09-11Remove cur_span hook.Camille GILLOT-12/+3
2023-09-11Inline callback.Camille GILLOT-0/+1
2023-09-11Return ImmTy in discriminant_for_variant.Camille GILLOT-5/+6
2023-09-11Support non-scalar constants.Camille GILLOT-3/+11
2023-09-09handle/hack for arbitrary-self dyn receiversRalf Jung-32/+44
2023-09-09implement and test ABI compatibility for transparent wrappers around NPO typesRalf Jung-14/+27
2023-09-09implement and test fn ptr ABI compatibility rulesRalf Jung-2/+7
2023-09-09give extra context to ABI mismatch errorsRalf Jung-14/+8
2023-09-09interpret: change ABI-compat test to be type-based, so the test is ↵Ralf Jung-50/+125
consistent across targets
2023-09-08Auto merge of #115372 - RalfJung:abi-assert-eq, r=davidtwcobors-66/+12
add rustc_abi(assert_eq) to test some guaranteed or at least highly expected ABI compatibility guarantees This new repr(transparent) test is super useful, it would have found https://github.com/rust-lang/rust/issues/115336 and found https://github.com/rust-lang/rust/issues/115404, https://github.com/rust-lang/rust/issues/115481, https://github.com/rust-lang/rust/issues/115509.
2023-09-08turns out Layout has some more things to worry about -- move ABI comparison ↵Ralf Jung-6/+2
into helper function like is_bool, and some special magic extra fields
2023-09-08accept some differences for rustc_abi(assert_eq), so that we can test more ↵Ralf Jung-60/+10
things to be compatible
2023-09-06miri: catch function calls where the argument is caller-invalid / the return ↵Ralf Jung-0/+7
value callee-invalid
2023-09-04interpret: make MemPlace, Place, Operand types private to the interpreterRalf Jung-217/+298
2023-08-31miri ABI check: fix handling of 1-ZST; don't accept sign differencesRalf Jung-24/+23
2023-08-30miri function ABI check: specifically look for repr(transparent)Ralf Jung-71/+102
2023-08-30interpret: make sure we accept transparent newtypes as ABI-compatibleRalf Jung-16/+36
also we were missing the case for Vector arguments, so handle those as well
2023-08-30storage_live: avoid computing the layout unless necessaryRalf Jung-14/+65
2023-08-30unify passing of sized and unsized function arguments :-)Ralf Jung-31/+35
2023-08-30a bit of meta-related cleanup on ProjectableRalf Jung-36/+32
2023-08-30move marking-locals-live out of push_stack_frame, so it happens with ↵Ralf Jung-84/+146
argument passing this entirely avoids even creating unsized locals in Immediate::Uninitialized state
2023-08-30interpret: fix projecting into an unsized field of a localRalf Jung-97/+100
new invariant: Place::Local never refers to something unsized
2023-08-30Rollup merge of #115272 - RalfJung:miri-error-print, r=saethlinMatthias Krüger-5/+28
miri/diagnostics: don't forget to print_backtrace when ICEing on unexpected errors This should fix the missing output encountered [here](https://github.com/rust-lang/rust/issues/115145#issuecomment-1694334410). r? `@saethlin`
2023-08-29const_eval and codegen: audit uses of is_zstRalf Jung-12/+17
2023-08-28Auto merge of #115182 - RalfJung:abi-compat-sign, r=b-naberbors-15/+29
miri ABI compatibility check: accept u32 and i32 If only the sign differs, then surely these types are compatible. (We do still check that `arg_ext` is the same, just in case.) Also I made it so that the ABI check must *imply* that size and alignment are the same, but it doesn't actively check that itself. With how crazy ABI constraints get, having equal size and align really shouldn't be used as a signal for anything I think...
2023-08-27miri/diagnostics: don't forget to print_backtrace when ICEing on unexpected ↵Ralf Jung-5/+28
errors then also use the new helper in a few other places
2023-08-25Auto merge of #115184 - saethlin:local-allocated-spans, r=RalfJungbors-5/+18
Record allocation spans inside force_allocation This expands https://github.com/rust-lang/miri/pull/2940 to cover locals r? `@RalfJung`
2023-08-25Add a doc comment for the new hookBen Kimock-0/+3
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-08-25Record allocation spans inside force_allocationBen Kimock-5/+15
2023-08-24miri ABI compatibility check: accept u32 and i32Ralf Jung-15/+29
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-6/+14
2023-08-20interpret: have assert_* intrinsics call the panic machinery instead of a ↵Ralf Jung-14/+8
direct abort
2023-08-20interpret/miri: call panic_cannot_unwind lang item instead of hard-coding ↵Ralf Jung-3/+14
the same message
2023-08-20give some unwind-related terminators a more clear nameRalf Jung-2/+2
2023-08-08Rollup merge of #114615 - RalfJung:interpret-invalid-where, r=lcnrMatthias Krüger-5/+2
interpret: remove incomplete protection against invalid where clauses Cc https://github.com/rust-lang/rust/issues/97477, https://github.com/rust-lang/project-const-generics/issues/37 r? ``@lcnr``
2023-08-08interpret: remove incomplete protection against invalid where clausesRalf Jung-5/+2
2023-08-08Auto merge of #114520 - RalfJung:unsized-valtrees, r=oli-obkbors-11/+15
simplify handling of valtrees for unsized types
2023-08-07Rollup merge of #114382 - scottmcm:compare-bytes-intrinsic, r=cjgillotMatthias Krüger-0/+22
Add a new `compare_bytes` intrinsic instead of calling `memcmp` directly As discussed in #113435, this lets the backends be the place that can have the "don't call the function if n == 0" logic, if it's needed for the target. (I didn't actually *add* those checks, though, since as I understood it we didn't actually need them on known targets?) Doing this also let me make it `const` (unstable), which I don't think `extern "C" fn memcmp` can be. cc `@RalfJung` `@Amanieu`
2023-08-06Add a new `compare_bytes` intrinsic instead of calling `memcmp` directlyScott McMurray-0/+22
2023-08-07Rollup merge of #114542 - RalfJung:const-prop-nonsense, r=compiler-errorsMatthias Krüger-4/+5
interpret: use ConstPropNonsense for more const-prop induced issues