address review

This commit is contained in:
b-naber 2021-12-01 00:20:57 +01:00
parent 84bcd40927
commit 4d9a0bf21b
3 changed files with 10 additions and 1 deletions

View file

@ -240,6 +240,10 @@ fn layout_of<'tcx>(
let param_env = param_env.with_reveal_all_normalized(tcx);
let unnormalized_ty = ty;
// FIXME: We might want to have two different versions of `layout_of`:
// One that can be called after typecheck has completed and can use
// `normalize_erasing_regions` here and another one that can be called
// before typecheck has completed and uses `try_normalize_erasing_regions`.
let ty = match tcx.try_normalize_erasing_regions(param_env, ty) {
Ok(t) => t,
Err(normalization_error) => {