Please sign in to comment.
Replace `struct_tail` and `struct_lockstep_tails` with variants handl…
…ing normalization. The old struct tail functions did not deal with `<T as Trait>::A` and `impl Trait`, at least not explicitly. (We didn't notice this bug before because it is only exposed when the tail (post deep normalization) is not `Sized`, so it was a rare case to deal with.) For post type-checking (i.e. during codegen), there is now `struct_tail_erasing_lifetimes` and `struct_lockstep_tails_erasing_lifetimes`, which each take an additional `ParamEnv` argument to drive normalization. For pre type-checking cases where normalization is not needed, there is `struct_tail_without_normalization`. (Currently, the only instance of this is `Expectation::rvalue_hint`.) All of these new entrypoints work by calling out to common helper routines. The helpers are parameterized over a closure that handles the normalization.
- Loading branch information...
Showing with 111 additions and 22 deletions.
- +3 −3 src/librustc/ty/layout.rs
- +89 −8 src/librustc/ty/util.rs
- +2 −1 src/librustc_codegen_ssa/base.rs
- +3 −2 src/librustc_codegen_ssa/traits/type_.rs
- +2 −1 src/librustc_mir/interpret/cast.rs
- +3 −1 src/librustc_mir/interpret/intern.rs
- +2 −1 src/librustc_mir/interpret/validity.rs
- +4 −3 src/librustc_mir/monomorphize/collector.rs
- +1 −1 src/librustc_typeck/check/mod.rs
- +2 −1 src/librustc_typeck/check/wfcheck.rs