about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/lang_items.rs
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2022-01-09 13:41:04 -0800
committerEric Huss <eric@huss.org>2022-01-09 13:41:04 -0800
commit2b7572092c9953cd82d99768732e624bd6da56e9 (patch)
treea8120f7ada64a5221020e595396a8de5c611d73a /compiler/rustc_passes/src/lang_items.rs
parentf7bb8e3677ba4277914e85a3060e5d69151aed44 (diff)
downloadrust-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.rs4
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 => {