From 6c8265dc56d221dce7f3535ecf8cdee6b9d2d618 Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 2 May 2022 09:31:56 +0200 Subject: only_local: always check for misuse --- compiler/rustc_interface/src/queries.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'compiler/rustc_interface/src') diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 22ab62ac372..136f0443fa0 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -258,10 +258,7 @@ impl<'tcx> Queries<'tcx> { /// an error. fn check_for_rustc_errors_attr(tcx: TyCtxt<'_>) { let Some((def_id, _)) = tcx.entry_fn(()) else { return }; - - let attrs = &*tcx.get_attrs(def_id); - let attrs = attrs.iter().filter(|attr| attr.has_name(sym::rustc_error)); - for attr in attrs { + for attr in tcx.get_attrs(def_id, sym::rustc_error) { match attr.meta_item_list() { // Check if there is a `#[rustc_error(delay_span_bug_from_inside_query)]`. Some(list) -- cgit 1.4.1-3-g733a5