1
Fork 0

Rollup merge of #110297 - kylematsuda:earlybinder_tcx_subst, r=BoxyUwU

Make `(try_)subst_and_normalize_erasing_regions` take `EarlyBinder`

Changes `subst_and_normalize_erasing_regions` and `try_subst_and_normalize_erasing_regions` to take  `EarlyBinder<T>` instead of `T`.

(related to #105779)

This was suggested by `@BoxyUwU` in https://github.com/rust-lang/rust/pull/107753#discussion_r1105828139. After changing `type_of` to return `EarlyBinder`, there were several places where the binder was immediately skipped to call `tcx.subst_and_normalize_erasing_regions`, only for the binder to be reconstructed inside of that method.

r? `@BoxyUwU`
This commit is contained in:
Dylan DPC 2023-05-08 11:39:20 +05:30 committed by GitHub
commit 71a1ac2c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 44 additions and 29 deletions

View file

@ -111,7 +111,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
self.instance.subst_mir_and_normalize_erasing_regions(
self.cx.tcx(),
ty::ParamEnv::reveal_all(),
value,
ty::EarlyBinder(value),
)
}
}