diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2022-08-04 10:05:04 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-08-04 11:27:02 -0300 |
| commit | 9f10f589a78b0ed864884b6ab108fbd081ce2a8d (patch) | |
| tree | a0a9d7447c0352554f0cb441201c6755b53b4526 | |
| parent | 1ece866cf1752aff853bd582a62cf29ab403e2af (diff) | |
| download | rust-9f10f589a78b0ed864884b6ab108fbd081ce2a8d.tar.gz rust-9f10f589a78b0ed864884b6ab108fbd081ce2a8d.zip | |
Move new_remapping inside with_hir_id_owner
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index a0e448506db..4a3e58b2f8e 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1399,7 +1399,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { // Contains the new lifetime definitions created for the TAIT (if any). let mut collected_lifetimes = Vec::new(); - let mut new_remapping = FxHashMap::default(); // If this came from a TAIT (as opposed to a function that returns an RPIT), we only want // to capture the lifetimes that appear in the bounds. So visit the bounds to find out @@ -1415,6 +1414,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { debug!(?lifetimes_to_remap); self.with_hir_id_owner(opaque_ty_node_id, |lctx| { + let mut new_remapping = FxHashMap::default(); + // If this opaque type is only capturing a subset of the lifetimes (those that appear // in bounds), then create the new lifetime parameters required and create a mapping // from the old `'a` (on the function) to the new `'a` (on the opaque type). |
