about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
AgeCommit message (Collapse)AuthorLines
2021-10-20Remove `box_alloc` from `Machine` trait.Gary Guo-7/+1
2021-10-20Remove NullOp::BoxGary Guo-5/+0
2021-10-17Auto merge of #89514 - davidtwco:polymorphize-shims-and-predicates, r=lcnrbors-1/+2
polymorphization: shims and predicates Supersedes #75737 and #75414. This pull request includes up some changes to polymorphization which hadn't landed previously and gets stage2 bootstrapping and the test suite passing when polymorphization is enabled. There are still issues with `type_id` and polymorphization to investigate but this should get polymorphization in a reasonable state to work on. - #75737 and #75414 both worked but were blocked on having the rest of the test suite pass (with polymorphization enabled) with and without the PRs. It makes more sense to just land these so that the changes are in. - #75737's changes remove the restriction of `InstanceDef::Item` on polymorphization, so that shims can now be polymorphized. This won't have much of an effect until polymorphization's analysis is more advanced, but it doesn't hurt. - #75414's changes remove all logic which marks parameters as used based on their presence in predicates - given #75675, this will enable more polymorphization and avoid the symbol clashes that predicate logic previously sidestepped. - Polymorphization now explicitly checks (and skips) foreign items, this is necessary for stage2 bootstrapping to work when polymorphization is enabled. - The conditional determining the emission of a note adding context to a post-monomorphization error has been modified. Polymorphization results in `optimized_mir` running for shims during collection where that wouldn't happen previously, some errors are emitted during `optimized_mir` and these were considered post-monomorphization errors with the existing logic (more errors and shims have a `DefId` coming from the std crate, not the local crate), adding a note that resulted in tests failing. It isn't particularly feasible to change where polymorphization runs or prevent it from using `optimized_mir`, so it seemed more reasonable to not change the conditional. - `characteristic_def_id_of_type` was being invoked during partitioning for self types of impl blocks which had projections that depended on the value of unused generic parameters of a function - this caused a ICE in a debuginfo test. If partitioning is enabled and the instance needs substitution then this is skipped. That test still fails for me locally, but not with an ICE, but it fails in a fresh checkout too, so 🤷‍♂️. r? `@lcnr`
2021-10-15Rollup merge of #89859 - RalfJung:write-discriminant, r=oli-obkMatthias KrĂĽger-1/+15
add dedicated error variant for writing the discriminant of an uninhabited enum variant This is conceptually different from hitting an `Unreachable` terminator. Also add some sanity check making sure we don't write discriminants of things that do not have discriminants. r? ``@oli-obk``
2021-10-14add dedicated error variant for writing the discriminant of an uninhabited ↵Ralf Jung-1/+15
enum variant
2021-10-12Add const_eval_select intrinsicDeadbeef-1/+1
2021-10-08Auto merge of #89619 - michaelwoerister:incr-vtables, r=nagisabors-1/+1
Turn vtable_allocation() into a query This PR removes the untracked vtable-const-allocation cache from the `tcx` and turns the `vtable_allocation()` method into a query. The change is pretty straightforward and should be backportable without too much effort. Fixes https://github.com/rust-lang/rust/issues/89598.
2021-10-07Turn tcx.vtable_allocation() into a query.Michael Woerister-1/+1
2021-10-03Remove re-export.Camille GILLOT-1/+1
2021-10-01polymorphize: polymorphize shimsDavid Wood-1/+2
This commit removes the restriction of `InstanceDef::Item` on polymorphization, so that shims can now be polymorphized. Signed-off-by: David Wood <david.wood@huawei.com>
2021-09-29CTFE: extra assertions for Aggregate rvalues; remove unnecessarily eager ↵Ralf Jung-7/+9
special case
2021-09-29remove outdated commentRalf Jung-1/+0
2021-09-25Introduce `Rvalue::ShallowInitBox`Gary Guo-0/+6
2021-09-20Enable 2021 compatibility lints for all in-tree codeMark Rousskov-1/+1
This just applies the suggested fixes from the compatibility warnings, leaving any that are in practice spurious in. This is primarily intended to provide a starting point to identify possible fixes to the migrations (e.g., by avoiding spurious warnings). A secondary commit cleans these up where they are false positives (as is true in many of the cases).
2021-09-14Remove implementation of `min_align_of` intrinsicTomasz MiÄ…sko-7/+2
Since 88839 `min_align_of` is lowered to AlignOf operator.
2021-09-12Auto merge of #88839 - nbdd0121:alignof, r=nagisabors-8/+10
Introduce NullOp::AlignOf This PR introduces `Rvalue::NullaryOp(NullOp::AlignOf, ty)`, which will be lowered from `align_of`, similar to `size_of` lowering to `Rvalue::NullaryOp(NullOp::SizeOf, ty)`. The changes are originally part of #88700 but since it's not dependent on other changes and could have performance impact on its own, it's separated into its own PR.
2021-09-13Introduce NullOp::AlignOfGary Guo-8/+10
2021-09-09Rename `(un)signed` to `(un)signed_int`Andreas Liljeqvist-2/+2
2021-09-09Move `unsigned_max` etc into `Size` againAndreas Liljeqvist-6/+4
2021-09-09Remove cloneAndreas Liljeqvist-1/+1
2021-09-09Make `abi::Abi` `Copy` and remove a *lot* of refsAndreas Liljeqvist-16/+13
fix fix Remove more refs and clones fix more fix
2021-09-09Add methods for checking for full ranges to `Scalar` and `WrappingRange`Andreas Liljeqvist-15/+13
Move *_max methods back to util change to inline instead of inline(always) Remove valid_range_exclusive from scalar Use WrappingRange instead implement always_valid_for in a safer way Fix accidental edit
2021-09-07Rename rustc_mir to rustc_const_eval.Camille GILLOT-0/+9026