about summary refs log tree commit diff
path: root/src/test/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-01-02 00:42:31 -0500
committerAaron Hill <aa1ronham@gmail.com>2020-01-05 14:37:59 -0500
commitee922d47f2e6386be4f69346ab554c97db502cc0 (patch)
treec49bfb27290b3031f2e9bbd55b7aea1e321b3ff1 /src/test/debuginfo/enum-thinlto.rs
parentb69f6e65c081f9a628ef5db83ba77e3861e60e60 (diff)
downloadrust-ee922d47f2e6386be4f69346ab554c97db502cc0.tar.gz
rust-ee922d47f2e6386be4f69346ab554c97db502cc0.zip
Fix ICE involving calling `Instance.ty` during const evaluation
Fixes #67639

`Instance.ty` assumes that we are in a fully monomorphic context (e.g.
codegen), and can therefore use an empty `ParamEnv` when performing
normalization. Howver, the MIR constant evaluator code ends up calling
`Instance.ty` as a result of us attemptign to 'speculatively'
const-evaluate generic functions during const propagation.

As a result,
we may end up with projections involving type parameters
(e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize.
Normalization expects us to have proper predicates in the `ParamEnv` for
such projections, and will ICE if we don't.

This commit adds a new method `Instance.ty_env`, which takes a
`ParamEnv` for use during normalization. The MIR const-evaluator code is
changed to use this method, passing in the proper `ParamEnv` for the
context at hand.
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions