about summary refs log tree commit diff
path: root/compiler/rustc_mir_build
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-02-13 13:03:45 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-02-15 09:02:44 +1100
commitcef9004f5a2f8d48f6cae474a0c1e81f485f4df2 (patch)
treedbe42d093401dc6094bdde9f7eecb8abc95920bf /compiler/rustc_mir_build
parent74390283748ca1478bb6958a2a81d9b94dade2b6 (diff)
downloadrust-cef9004f5a2f8d48f6cae474a0c1e81f485f4df2.tar.gz
rust-cef9004f5a2f8d48f6cae474a0c1e81f485f4df2.zip
Add specialized variants of `mk_region`.
Much like there are specialized variants of `mk_ty`. This will enable
some optimization in the next commit.

Also rename the existing `re_error*` functions as `mk_re_error*`, for
consistency.
Diffstat (limited to 'compiler/rustc_mir_build')
-rw-r--r--compiler/rustc_mir_build/src/thir/cx/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_mir_build/src/thir/cx/mod.rs b/compiler/rustc_mir_build/src/thir/cx/mod.rs
index 10df4b22952..c9fa599f52d 100644
--- a/compiler/rustc_mir_build/src/thir/cx/mod.rs
+++ b/compiler/rustc_mir_build/src/thir/cx/mod.rs
@@ -140,7 +140,7 @@ impl<'tcx> Cx<'tcx> {
                     var: ty::BoundVar::from_usize(bound_vars.len() - 1),
                     kind: ty::BrEnv,
                 };
-                let env_region = ty::ReLateBound(ty::INNERMOST, br);
+                let env_region = self.tcx.mk_re_late_bound(ty::INNERMOST, br);
                 let closure_env_ty =
                     self.tcx.closure_env_ty(closure_def_id, closure_substs, env_region).unwrap();
                 let liberated_closure_env_ty = self.tcx.erase_late_bound_regions(