about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
AgeCommit message (Collapse)AuthorLines
2022-05-10fmtRalf Jung-3/+1
2022-05-10update/remove some old commentsRalf Jung-5/+1
2022-05-10even tighter checks for layouts on immediate field projectionsRalf Jung-6/+11
2022-05-10disable one check for now until #96185 is fixedRalf Jung-4/+5
2022-05-10tighten sanity checks around Scalar and ScalarPairRalf Jung-44/+44
2022-05-10only_local: always check for misuselcnr-17/+13
2022-05-09Auto merge of #96815 - SparrowLii:promote_const, r=oli-obkbors-42/+52
optimize `promote_consts` by caching the results of `validate_local` From the FIXME in the impl of `promote_consts`. Early return the `validate_local` should save some compile time. `qualif_local` is similar to this, but requires futher changing because there are different types of qualif checks. If this PR is effective, I will do it as well.
2022-05-09use `Result<(),()>` instead of Validity enumSparrowLii-54/+35
2022-05-07optimize `promote_consts` by cache the validate checkSparrowLii-41/+70
2022-05-06Check that field projections have the correct typeJakob Degen-1/+55
2022-05-06Fix inaccurate function name in `rustc_const_eval` docspierwill-3/+3
2022-05-06Expand validator to be more precise on checked binary opsJakob Degen-3/+41
2022-05-05Rollup merge of #96714 - RalfJung:scalar-pair-debug, r=oli-obkMatthias Krüger-49/+95
interpret/validity: debug-check ScalarPair layout information This would have caught https://github.com/rust-lang/rust/issues/96158. I ran the Miri test suite and it still passes. r? `@oli-obk`
2022-05-05give it a scary nameRalf Jung-10/+13
2022-05-04interpret: debug-check ScalarPair layout informationRalf Jung-43/+86
2022-05-04Stabilize `bool::then_some`Josh Triplett-1/+0
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-4/+4
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-30Auto merge of #96500 - SparrowLii:rpo, r=tmiaskobors-2/+2
Reduce duplication of RPO calculation of mir Computing the RPO of mir is not a low-cost thing, but it is duplicate in many places. In particular the `iterate_to_fixpoint` method which is called multiple times when computing the data flow. This PR reduces the number of times the RPO is recalculated as much as possible, which should save some compile time.
2022-04-30Eliminate duplication of RPO calculation for mirSparrowLii-2/+2
add `postorder_cache` to mir Body add `ReversePostorderCache` struct correct struct name and comments
2022-04-28Auto merge of #95976 - b-naber:valtree-constval-conversion, r=oli-obkbors-146/+511
Implement Valtree to ConstValue conversion Once we start to use `ValTree`s in the type system we will need to be able to convert them into `ConstValue` instances, which we want to continue to use after MIR construction. r? `@oli-obk` cc `@RalfJung`
2022-04-27combine all unsized types and add another recursive call to process nested ↵b-naber-96/+78
unsized types correctly
2022-04-26account for custom DSTs in valtree -> constvalue conversionb-naber-9/+123
2022-04-24include valtree creation and valtree -> constvalue conversion in debug ↵b-naber-31/+30
assertions check
2022-04-22Relax restrictions for copy operandsJakob Degen-1/+2
2022-04-21deduplicate a lot of codeb-naber-242/+121
2022-04-21implement (as of now still unused) query for valtree -> constvalue conversionb-naber-0/+4
2022-04-21implement valtree -> constvalue conversionb-naber-150/+537
2022-04-20Rollup merge of #96160 - RalfJung:interpret-debug, r=oli-obkDylan DPC-6/+23
Miri/interpreter debugging tweaks Some changes I made to make debugging Miri with trace logging less terrible. r? ``@oli-obk``
2022-04-19Rollup merge of #96165 - RalfJung:miri-provenance-cleanup, r=oli-obkDylan DPC-46/+59
Miri provenance cleanup Reviewing https://github.com/rust-lang/rust/pull/95826 by ``@carbotaniuman`` made me realize that we could clean things up a little here. ``@carbotaniuman`` please let me know if you're okay with landing this (it will create a lot of conflicts with your PR), or if you'd prefer incorporating the ideas from this PR into yours. I think we want to end up in a situation where the function you called `ptr_reify_alloc` returns just two things, a concrete tag and an offset. Getting an `AllocId` from a concrete tag should be infallible like now. However a concrete tag and `Tag` don't have to be the same type. r? ``@oli-obk``
2022-04-18remove an unnecessary use of loc_place.ptr.into_pointer_or_addrRalf Jung-1/+1
2022-04-18avoid an unnecessary call to Pointer::into_parts, and caution against ↵Ralf Jung-3/+2
into_pointer_or_addr
2022-04-18add method to get absolute address of a pointer (useful only for Miri)Ralf Jung-6/+4
2022-04-18avoid pairing up AllocId and PointerTag, which is redundantRalf Jung-23/+40
2022-04-17ptr_get_alloc_id: don't return an actual PointerRalf Jung-30/+29
2022-04-17downgrade really verbose logging to traceRalf Jung-2/+2
2022-04-17interpret: more debug logging for read_scalar and write_scalarRalf Jung-4/+21
2022-04-17add caution to some commentsRalf Jung-1/+1
2022-04-17when writing uninit to an allocation, also clear relocations like other ↵Ralf Jung-5/+10
writes do
2022-04-16Rollup merge of #95426 - b-naber:valtrees-slice, r=RalfJung,oli-obkDylan DPC-26/+58
Include Refs in Valtree Creation This adds references to `const_to_valtree`, which isn't used in the compiler yet, but after the previous changes we made to the thir and mir representations and this change we should be able to finally introduce them in the next PR. I wasn't able to properly test this code, except indirectly by including a call of `const_to_valtree` in the code that currently creates constants (`turn_into_const_value`). r? `@lcnr` cc `@oli-obk` `@RalfJung`
2022-04-16Rollup merge of #96050 - oli-obk:deaggregator_cleanup, r=RalfJungDylan DPC-19/+3
Remove some now-dead code that was only relevant before deaggregation. The code was broken anyway, if the deaggregator is disabled, it would have ICEd on any non-enum Adt r? ```@RalfJung```
2022-04-14handle arrays and slices uniformly in valtree creationb-naber-31/+13
2022-04-14Remove some now-dead code that was only relevant before deaggregation.Oli Scherer-19/+3
The code was broken anyway, if the deaggregator is disabled, it would have ICE on any non-enum Adt
2022-04-13Consider lifetimes when comparing types for equality in MIR validatorJakob Degen-4/+3
2022-04-12use len on mplace instead of reading immediate, remove dead codeb-naber-39/+14
2022-04-11Remove rule that place loads may not happen with variant index setJakob Degen-5/+2
2022-04-11Address various comments and change some details around place to value ↵Jakob Degen-1/+1
conversions
2022-04-11Adjust MIR validator to check a few more things for terminatorsJakob Degen-5/+19
2022-04-11Extend the MIR validator to check many more things around rvalues.Jakob Degen-39/+161
2022-04-11Adjust computation of place types to detect more invalid placesJakob Degen-1/+9
2022-04-11Add new `Deinit` statement kindJakob Degen-29/+92