about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-01-14 18:29:01 +0000
committerMichael Goulet <michael@errs.io>2024-01-14 19:15:46 +0000
commit6f98a6cc8015cb094dc0c6acb330eb71ef75cb64 (patch)
tree3e68b83463f0caf373f008175f805a226026fe8d /compiler/rustc_borrowck/src
parent5876c8cdfd3df742c334d6447d44d760c77103b6 (diff)
downloadrust-6f98a6cc8015cb094dc0c6acb330eb71ef75cb64.tar.gz
rust-6f98a6cc8015cb094dc0c6acb330eb71ef75cb64.zip
Simplify closure_env_ty and closure_env_param
Diffstat (limited to 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/universal_regions.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs
index addb41ff5fc..ae8a135f090 100644
--- a/compiler/rustc_borrowck/src/universal_regions.rs
+++ b/compiler/rustc_borrowck/src/universal_regions.rs
@@ -668,7 +668,11 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
                     kind: ty::BrEnv,
                 };
                 let env_region = ty::Region::new_bound(tcx, ty::INNERMOST, br);
-                let closure_ty = tcx.closure_env_ty(def_id, args, env_region).unwrap();
+                let closure_ty = tcx.closure_env_ty(
+                    Ty::new_closure(tcx, def_id, args),
+                    args.as_closure().kind(),
+                    env_region,
+                );
 
                 // The "inputs" of the closure in the
                 // signature appear as a tuple. The MIR side