about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
AgeCommit message (Collapse)AuthorLines
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-85/+149
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-28Rollup merge of #115164 - RalfJung:no-in-place-packed, r=b-naberMatthias Krüger-3/+29
MIR validation: reject in-place argument/return for packed fields As discussed [here](https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Packed.20fields.20and.20in-place.20function.20argument.2Freturn.20passing).
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-25Auto merge of #115138 - cjgillot:dse-move-packed, r=compiler-errorsbors-2/+2
Do not convert copies of packed projections to moves. This code path was introduced in https://github.com/rust-lang/rust/pull/113758 After seeing https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Packed.20fields.20and.20in-place.20function.20argument.2Freturn.20passing, this may be UB, so should be disallowed. This should not appear in normally-built MIR, which introduces temporary copies for packed projections.
2023-08-24miri ABI compatibility check: accept u32 and i32Ralf Jung-15/+29
2023-08-24Only check packed ADT.Camille GILLOT-2/+2
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-13/+30
2023-08-24MIR validation: reject in-place argument/return for packed fieldsRalf Jung-5/+31
2023-08-20avoid return in tail positionRalf Jung-1/+1
Co-authored-by: fee1-dead <ent3rm4n@gmail.com>
2023-08-20interpret: have assert_* intrinsics call the panic machinery instead of a ↵Ralf Jung-21/+16
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-13/+13
2023-08-20Auto merge of #113124 - nbdd0121:eh_frame, r=cjgillotbors-8/+42
Add MIR validation for unwind out from nounwind functions + fixes to make validation pass `@Nilstrieb` This is the MIR validation you asked in https://github.com/rust-lang/rust/pull/112403#discussion_r1222739722. Two passes need to be fixed to get the validation to pass: * `RemoveNoopLandingPads` currently unconditionally introduce a resume block (even there is none to begin with!), changed to not do that * Generator state transform introduces a `assert` which may unwind, and its drop elaboration also introduces many new `UnwindAction`s, so in this case run the AbortUnwindingCalls after the transformation. I believe this PR should also fix Rust-for-Linux/linux#1016, cc `@ojeda` r? `@Nilstrieb`
2023-08-19const-eval: ensure we never const-execute a function marked ↵Ralf Jung-32/+21
rustc_do_not_const_check
2023-08-18Add missing instantiation of generator ty in validatorGary Guo-1/+1
2023-08-18Add MIR validation for unwind out from nounwind functionsGary Guo-7/+41
2023-08-17Revert "Implement references VarDebugInfo."Camille GILLOT-6/+0
This reverts commit 2ec007191348ef7cc13eb55e44e007b02cf75cf3.
2023-08-16Make TerminatorEdge plural.Camille GILLOT-2/+2
2023-08-16Allow apply_terminator_effect to customize edges.Camille GILLOT-5/+8
2023-08-14Remove constness from `ImplSource::Param`Deadbeef-3/+2
2023-08-08Auto merge of #114637 - matthiaskrgr:rollup-544y8p5, r=matthiaskrgrbors-9/+2
Rollup of 11 pull requests Successful merges: - #106425 (Make ExitStatus implement Default) - #113480 (add aarch64-unknown-teeos target) - #113586 (Mention style for new syntax in tracking issue template) - #113593 (CFI: Fix error compiling core with LLVM CFI enabled) - #114612 (update llvm-wrapper include to silence deprecation warning) - #114613 (Prevent constant rebuilds of `rustc-main` (and thus everything else)) - #114615 (interpret: remove incomplete protection against invalid where clauses) - #114628 (Allowing re-implementation of mir_drops_elaborated query) - #114629 (tests: Uncomment now valid GAT code behind FIXME) - #114630 (Migrate GUI colors test to original CSS color format) - #114631 (add provisional cache test for new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-08Rollup merge of #114615 - RalfJung:interpret-invalid-where, r=lcnrMatthias Krüger-9/+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-08Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obkbors-12/+8
correctly lower `impl const` to bind to host effect param r? `@oli-obk`
2023-08-08interpret: remove incomplete protection against invalid where clausesRalf Jung-9/+2
2023-08-08Auto merge of #114520 - RalfJung:unsized-valtrees, r=oli-obkbors-121/+45
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
2023-08-06simplify handling of valtrees for unsized typesRalf Jung-82/+43
2023-08-06remove an unnecessary special case in valtree_into_mplaceRalf Jung-40/+3
2023-08-06Rollup merge of #114505 - ouz-a:cleanup_mir, r=RalfJungMatthias Krüger-1/+1
Add documentation to has_deref Documentation of `has_deref` needed some polish to be more clear about where it should be used and what's it's purpose. cc https://github.com/rust-lang/rust/issues/114401 r? `@RalfJung`
2023-08-06cleanup misinformation regarding has_derefouz-a-1/+1
2023-08-06lower impl const to bind to host effect paramDeadbeef-12/+8
2023-08-06interpret: use ConstPropNonsense for more const-prop induced issuesRalf Jung-4/+5
2023-08-04interpret: add mplace_to_ref helper methodRalf Jung-6/+14
2023-08-03Rollup merge of #114372 - RalfJung:const-pointer-as-int, r=oli-obkMatthias Krüger-111/+145
const validation: point at where we found a pointer but expected an integer Instead of validation just printing "unable to turn pointer into bytes", make this a regular validation error that says where in the value the bad pointer was found. Also distinguish "expected integer, got pointer" from "expected pointer, got partial pointer or mix of pointers". To avoid duplicating things too much I refactored the diagnostics for validity a bit, so that "got uninit, expected X" and "got pointer, expected X" can share the "X" part. Also all the errors emitted for validation are now grouped under `const_eval_validation` so that they are in a single group in the ftl file. r? `@oli-obk`
2023-08-03Rollup merge of #114363 - RalfJung:interpret-not-miri, r=jackh726Matthias Krüger-2/+2
avoid 'miri' when refering to the shared interpreter This is basically the rustc source code version of https://github.com/rust-lang/rustc-dev-guide/pull/1471.
2023-08-02const validation: point at where we found a pointer but expected an integerRalf Jung-111/+145
2023-08-02Remove constness from `TraitPredicate`Deadbeef-3/+3
2023-08-02avoid 'miri' when refering to the shared interpreterRalf Jung-2/+2
2023-08-02Rollup merge of #114079 - compiler-errors:closure-upvars, r=oli-obkNilstrieb-2/+3
Use `upvar_tys` in more places, make it return a list Just a cleanup that fell out of a PR that I was gonna write, but that PR kinda got stuck.