diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2022-07-26 15:11:44 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2022-08-04 11:26:53 -0300 |
| commit | 5a184acfc6e5fc99993aae74d94e47ca5812dd08 (patch) | |
| tree | fdb061cf13eebd35c12d9bb73c85263e79330546 | |
| parent | 19dcbd151b9c8a061eb96a70c9a39a3f9796a701 (diff) | |
| download | rust-5a184acfc6e5fc99993aae74d94e47ca5812dd08.tar.gz rust-5a184acfc6e5fc99993aae74d94e47ca5812dd08.zip | |
There's no need to check binders_to_ignore using the old code anymore
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index bc4841eb363..340f88e7540 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1471,11 +1471,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { if let Some(mut captured_lifetimes) = self.captured_lifetimes.take() { match res { LifetimeRes::Param { param, binder } => { - if !captured_lifetimes.binders_to_ignore.contains(&binder) - && !binders_to_ignore - .get(&lifetime.id) - .unwrap_or(&Vec::new()) - .contains(&binder) + if !binders_to_ignore + .get(&lifetime.id) + .unwrap_or(&Vec::new()) + .contains(&binder) { match captured_lifetimes.captures.entry(param) { Entry::Occupied(_) => {} @@ -1497,11 +1496,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { LifetimeRes::Fresh { param, binder } => { debug_assert_eq!(ident.name, kw::UnderscoreLifetime); - if !captured_lifetimes.binders_to_ignore.contains(&binder) - && !binders_to_ignore - .get(&lifetime.id) - .unwrap_or(&Vec::new()) - .contains(&binder) + if !binders_to_ignore + .get(&lifetime.id) + .unwrap_or(&Vec::new()) + .contains(&binder) { let param = self.local_def_id(param); match captured_lifetimes.captures.entry(param) { |
