about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
AgeCommit message (Collapse)AuthorLines
2022-10-06Auto merge of #99324 - reez12g:issue-99144, r=jyn514bors-3/+3
Enable doctests in compiler/ crates Helps with https://github.com/rust-lang/rust/issues/99144
2022-10-02Don't ICE when trying to copy unsized value in const propMichael Goulet-5/+11
2022-09-29Mark ignore(illustrative) on docs in ↵reez12g-3/+3
compiler/rustc_const_eval/src/interpret/validity.rs
2022-09-26remove cfg(bootstrap)Pietro Albini-3/+1
2022-09-21OpTy: fix a method taking self rather than &selfRalf Jung-1/+1
2022-09-20Rollup merge of #102021 - lcnr:tyConst-fun, r=b-naber,BoxyUwUMichael Howell-44/+35
some post-valtree cleanup r? project-const-generics cc ```@b-naber```
2022-09-20Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebankbors-0/+10
Allow patterns to constrain the hidden type of opaque types fixes #96572 reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864) TODO: * check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-19Rollup merge of #101985 - RalfJung:generate_stacktrace, r=oli-obkMatthias Krüger-2/+9
interpret: expose generate_stacktrace without full InterpCx In Miri we sometimes want to emit diagnostics without having a full `&InterpCx` available. To avoid duplicating code, this adds a way to get a stacktrace from an arbitrary slice of interpreter frames, that Miri can use with access to just a thread manager.
2022-09-19ctfe, `const_to_op` only for mir constantslcnr-44/+35
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+0
2022-09-18interpret: expose generate_stacktrace without full InterpCxRalf Jung-2/+9
2022-09-17Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnrbors-1/+13
Use only ty::Unevaluated<'tcx, ()> in type system r? `@lcnr`
2022-09-16Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, ↵Oli Scherer-0/+10
r=estebank"" This reverts commit 4a742a691e7dd2522bad68b86fe2fd5a199d5561.
2022-09-14address review againb-naber-12/+13
2022-09-13Address code review commentsEric Holk-6/+5
2022-09-13rebaseb-naber-1/+1
2022-09-13fixes/working versionb-naber-1/+1
2022-09-13use ty::Unevaluated<'tcx, ()> in type systemb-naber-1/+12
2022-09-12Rename some variantsMichael Goulet-1/+1
2022-09-12Construct dyn* during const interpMichael Goulet-1/+12
2022-09-12dyn* through more typechecking and MIREric Holk-0/+4
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-3/+3
2022-09-08bound variables during ctfe are a buglcnr-3/+3
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-7/+9
Fixes #46213
2022-09-07Change name of "dataful" variant to "untagged"Michael Benfield-5/+5
This is in anticipation of a new enum layout, in which the niche optimization may be applied even when multiple variants have data.
2022-09-06Move CTFE handling of nondiverging intrinsics to intrinsics.rsOli Scherer-19/+29
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-11/+12
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-6/+9
2022-09-03Add a Machine hook for inline assemblyBen Kimock-2/+21
2022-09-03Auto merge of #101154 - RalfJung:validation-perf, r=oli-obkbors-4/+5
interpret: fix unnecessary allocation in validation visitor Should fix the perf regression introduced by https://github.com/rust-lang/rust/pull/100043. r? `@oli-obk`
2022-09-01Directly use the `instrument` macro instead of its full pathOli Scherer-1/+1
2022-09-01Auto merge of #100707 - dzvon:fix-typo, r=davidtwcobors-7/+7
Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31interpret: use new OpTy::len for Len rvalueRalf Jung-2/+2
This avoids a `force_allocation`
2022-08-31Fix a bunch of typoDezhi Wu-7/+7
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-30Rollup merge of #101101 - RalfJung:read-pointer-as-bytes, r=oli-obkDylan DPC-85/+90
interpret: make read-pointer-as-bytes a CTFE-only error with extra information Next step in the reaction to https://github.com/rust-lang/rust/issues/99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes https://github.com/rust-lang/miri/issues/2456. Pointer-to-int transmutation during CTFE now produces a message like this: ``` = help: this code performed an operation that depends on the underlying bytes representing a pointer = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported ``` r? ``@oli-obk``
2022-08-29Auto merge of #101167 - matthiaskrgr:rollup-yt3jdmp, r=matthiaskrgrbors-0/+1
Rollup of 7 pull requests Successful merges: - #100898 (Do not report too many expr field candidates) - #101056 (Add the syntax of references to their documentation summary.) - #101106 (Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items) - #101131 (CTFE: exposing pointers and calling extern fn is just impossible) - #101141 (Simplify `get_trait_ref` fn used for `virtual_function_elimination`) - #101146 (Various changes to logging of borrowck-related code) - #101156 (Remove `Sync` requirement from lint pass objects) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-29Rollup merge of #101131 - RalfJung:ctfe-no-needs-rfc, r=oli-obkMatthias Krüger-0/+1
CTFE: exposing pointers and calling extern fn is just impossible The remaining "needs RFC" errors are just needlessly confusing, I think -- time to get rid of that error variant. They are anyway only reachable with miri-unleashed (if at all). r? `@oli-obk`
2022-08-29interpret: fix unnecessary allocation in validation visitorRalf Jung-4/+5
2022-08-29Rollup merge of #100239 - RalfJung:const-prop-uninit, r=oli-obkDylan DPC-25/+9
remove an ineffective check in const_prop Based on https://github.com/rust-lang/rust/pull/100043, only the last two commits are new. ConstProp has a special check when reading from a local that prevents reading uninit locals. However, if that local flows into `force_allocation`, then no check fires and evaluation proceeds. So this check is not really effective at preventing accesses to uninit locals. With https://github.com/rust-lang/rust/pull/100043, `read_immediate` and friends always fail when reading uninit locals, so I don't see why ConstProp would need a separate check. Thus I propose we remove it. This is needed to be able to do https://github.com/rust-lang/rust/pull/100085.
2022-08-29Rollup merge of #100897 - RalfJung:const-not-to-mutable, r=lcnrMatthias Krüger-27/+45
extra sanity check against consts pointing to mutable memory This should be both unreachable and redundant (since we already ensure that validation only reads from read-only memory, when validating consts), but I feel like we cannot be paranoid enough here, and also if this ever fails it'll be a nicer error than the "cannot read from mutable memory" error.
2022-08-29Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obkMatthias Krüger-3/+3
Replace `Body::basic_blocks()` with field access Since the refactoring in #98930, it is possible to borrow the basic blocks independently from other parts of MIR by accessing the `basic_blocks` field directly. Replace unnecessary `Body::basic_blocks()` method with a direct field access, which has an additional benefit of borrowing the basic blocks only.
2022-08-28CTFE: exposing pointers and calling extern fn doesn't need an RFC, it is ↵Ralf Jung-0/+1
just impossible
2022-08-28validation should only catch UB errorsRalf Jung-17/+20
2022-08-27interpret: make read-pointer-as-bytes *always* work in MiriRalf Jung-44/+46
and show some extra information when it happens in CTFE
2022-08-27interpret: rename relocation → provenanceRalf Jung-25/+25
2022-08-27Auto merge of #100999 - nnethercote:shrink-FnAbi, r=bjorn3bors-6/+4
Shrink `FnAbi` Because they can take up a lot of memory in debug and release builds. r? `@bjorn3`
2022-08-27remove a now-useless machine hookRalf Jung-24/+5
2022-08-27remove an ineffective check in const_propRalf Jung-1/+4
2022-08-26make read_immediate error immediately on uninit, so ImmTy can carry ↵Ralf Jung-247/+166
initialized Scalar
2022-08-26remove some now-unnecessary parameters from check_bytesRalf Jung-12/+3