diff options
| author | Eric Huss <eric@huss.org> | 2022-01-09 13:41:04 -0800 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2022-01-09 13:41:04 -0800 |
| commit | 2b7572092c9953cd82d99768732e624bd6da56e9 (patch) | |
| tree | a8120f7ada64a5221020e595396a8de5c611d73a /compiler/rustc_passes/src/lang_items.rs | |
| parent | f7bb8e3677ba4277914e85a3060e5d69151aed44 (diff) | |
| download | rust-2b7572092c9953cd82d99768732e624bd6da56e9.tar.gz rust-2b7572092c9953cd82d99768732e624bd6da56e9.zip | |
Clean up lang_items::extract
Noted in https://github.com/rust-lang/rust/pull/87739#pullrequestreview-740497194, lang_items::extract no longer needs to take a closure.
Diffstat (limited to 'compiler/rustc_passes/src/lang_items.rs')
| -rw-r--r-- | compiler/rustc_passes/src/lang_items.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_passes/src/lang_items.rs b/compiler/rustc_passes/src/lang_items.rs index a808d6c8348..0c934ecc913 100644 --- a/compiler/rustc_passes/src/lang_items.rs +++ b/compiler/rustc_passes/src/lang_items.rs @@ -10,7 +10,6 @@ use crate::check_attr::target_from_impl_item; use crate::weak_lang_items; -use rustc_ast::Attribute; use rustc_errors::{pluralize, struct_span_err}; use rustc_hir as hir; use rustc_hir::def_id::DefId; @@ -57,8 +56,7 @@ impl<'tcx> LanguageItemCollector<'tcx> { fn check_for_lang(&mut self, actual_target: Target, hir_id: HirId) { let attrs = self.tcx.hir().attrs(hir_id); - let check_name = |attr: &Attribute, sym| attr.has_name(sym); - if let Some((value, span)) = extract(check_name, &attrs) { + if let Some((value, span)) = extract(&attrs) { match ITEM_REFS.get(&value).cloned() { // Known lang item with attribute on correct target. Some((item_index, expected_target)) if actual_target == expected_target => { |
