diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-05-29 20:21:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-29 20:21:22 +0200 |
| commit | ed80e8e3e0d042dbcb5c24ef3593acab55d862e2 (patch) | |
| tree | 2475c33ad1ea62c5d77862ba466ac05d27e8e9d6 /src/librustc_mir | |
| parent | 89cb4d75a104d772e8f40e43eabb0122e71eacb1 (diff) | |
| parent | c3dc8c455cee65db8928913da029725046c14a1b (diff) | |
| download | rust-ed80e8e3e0d042dbcb5c24ef3593acab55d862e2.tar.gz rust-ed80e8e3e0d042dbcb5c24ef3593acab55d862e2.zip | |
Rollup merge of #72591 - sexxi-goose:rename_upvar_list-to-closure_captures, r=matthewjasper
librustc_middle: Rename upvar_list to closure_captures As part of supporting RFC 2229, we will be capturing all the places that are mentioned in a closure. Currently the `upvar_list` field gives access to a `FxIndexMap<HirId, Upvar>` map. Eventually this will change, with the `upvar_list` having a more general structure that expresses captured paths, not just the mentioned `upvars`. We will make those changes in subsequent PRs. This commit modifies the name of the `upvar_list` map to `closure_captures` in `TypeckTables`. r? @matthewjasper
Diffstat (limited to 'src/librustc_mir')
| -rw-r--r-- | src/librustc_mir/borrow_check/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/validity.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs index a0c1d96bb47..65e62dbd9dd 100644 --- a/src/librustc_mir/borrow_check/mod.rs +++ b/src/librustc_mir/borrow_check/mod.rs @@ -142,7 +142,7 @@ fn do_mir_borrowck<'a, 'tcx>( infcx.set_tainted_by_errors(); } let upvars: Vec<_> = tables - .upvar_list + .closure_captures .get(&def_id.to_def_id()) .into_iter() .flat_map(|v| v.values()) diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs index c83555d65fa..e962dfb2b3e 100644 --- a/src/librustc_mir/interpret/validity.rs +++ b/src/librustc_mir/interpret/validity.rs @@ -227,7 +227,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, ' let mut name = None; if let Some(def_id) = def_id.as_local() { let tables = self.ecx.tcx.typeck_tables_of(def_id); - if let Some(upvars) = tables.upvar_list.get(&def_id.to_def_id()) { + if let Some(upvars) = tables.closure_captures.get(&def_id.to_def_id()) { // Sometimes the index is beyond the number of upvars (seen // for a generator). if let Some((&var_hir_id, _)) = upvars.get_index(field) { |
