about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-10-25 17:59:18 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-02-26 10:30:27 +0000
commit7dcc74eee5584639c182aecdfe80a7f5369c5b69 (patch)
tree4fecd9e78b8cd8f05ff619bfb68f58d3685742bf /compiler/rustc_borrowck/src
parentd35dbbdc8ec3437807213ec103e42659467d9a77 (diff)
downloadrust-7dcc74eee5584639c182aecdfe80a7f5369c5b69.tar.gz
rust-7dcc74eee5584639c182aecdfe80a7f5369c5b69.zip
Access upvars through a query.
Diffstat (limited to 'compiler/rustc_borrowck/src')
-rw-r--r--compiler/rustc_borrowck/src/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs
index 18d7bde60d7..0f591460e9d 100644
--- a/compiler/rustc_borrowck/src/lib.rs
+++ b/compiler/rustc_borrowck/src/lib.rs
@@ -202,14 +202,14 @@ fn do_mir_borrowck<'tcx>(
     let mut errors = error::BorrowckErrors::new(infcx.tcx);
 
     // Gather the upvars of a closure, if any.
-    let tables = tcx.typeck_opt_const_arg(def);
-    if let Some(e) = tables.tainted_by_errors {
+    if let Some(e) = input_body.tainted_by_errors {
         infcx.set_tainted_by_errors(e);
         errors.set_tainted_by_errors(e);
     }
-    let upvars: Vec<_> = tables
-        .closure_min_captures_flattened(def.did)
-        .map(|captured_place| {
+    let upvars: Vec<_> = tcx
+        .closure_captures(def.did)
+        .iter()
+        .map(|&captured_place| {
             let capture = captured_place.info.capture_kind;
             let by_ref = match capture {
                 ty::UpvarCapture::ByValue => false,