diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-04-17 17:16:49 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-04-17 18:00:27 +0000 |
| commit | 9534541dd48ec52bcd9a60094155dffaa8f0a87f (patch) | |
| tree | c29312654e3f9e9a11201fcf82f5f3a884566c35 /compiler/rustc_ast_lowering/src | |
| parent | e49122fb1ca87a6c3e3c22abb315fc75cfe8daed (diff) | |
| download | rust-9534541dd48ec52bcd9a60094155dffaa8f0a87f.tar.gz rust-9534541dd48ec52bcd9a60094155dffaa8f0a87f.zip | |
Use `Item::expect_*` and `ImplItem::expect_*` more
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index f89e254a2f5..7b94f6edf70 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -138,12 +138,10 @@ impl<'a, 'hir> ItemLowerer<'a, 'hir> { // Evaluate with the lifetimes in `params` in-scope. // This is used to track which lifetimes have already been defined, // and which need to be replicated when lowering an async fn. - match parent_hir.node().expect_item().kind { - hir::ItemKind::Impl(hir::Impl { of_trait, .. }) => { - lctx.is_in_trait_impl = of_trait.is_some(); - } - _ => {} - }; + + if let hir::ItemKind::Impl(impl_) = parent_hir.node().expect_item().kind { + lctx.is_in_trait_impl = impl_.of_trait.is_some(); + } match ctxt { AssocCtxt::Trait => hir::OwnerNode::TraitItem(lctx.lower_trait_item(item)), |
