@@ -3,7 +3,7 @@ use std::ops::{ControlFlow, Deref};
33
44use hir:: intravisit:: { self , Visitor } ;
55use rustc_abi:: ExternAbi ;
6- use rustc_attr_parsing:: { AttributeKind , find_attr} ;
6+ use rustc_attr_parsing:: { AttributeKind , EIIImpl , find_attr} ;
77use rustc_data_structures:: fx:: { FxHashSet , FxIndexMap , FxIndexSet } ;
88use rustc_errors:: codes:: * ;
99use rustc_errors:: { Applicability , ErrorGuaranteed , pluralize, struct_span_code_err} ;
@@ -40,7 +40,7 @@ use rustc_trait_selection::traits::{
4040use tracing:: { debug, instrument} ;
4141use { rustc_ast as ast, rustc_hir as hir} ;
4242
43- use super :: compare_eii:: compare_eii_predicate_entailment;
43+ use super :: compare_eii:: { compare_eii_function_types , compare_eii_predicate_entailment} ;
4444use crate :: autoderef:: Autoderef ;
4545use crate :: collect:: CollectItemTypesVisitor ;
4646use crate :: constrained_generic_params:: { Parameter , identify_constrained_generic_params} ;
@@ -1298,14 +1298,16 @@ fn check_item_fn(
12981298 enter_wf_checking_ctxt ( tcx, span, def_id, |wfcx| {
12991299 // does the function have an EiiImpl attribute? that contains the defid of a *macro*
13001300 // that was used to mark the implementation. This is a two step process.
1301- if let Some ( eii_macro) =
1302- find_attr ! ( tcx. get_all_attrs( def_id) , AttributeKind :: EiiImpl { eii_macro} => * eii_macro)
1301+ for EIIImpl { eii_macro, .. } in
1302+ find_attr ! ( tcx. get_all_attrs( def_id) , AttributeKind :: EiiImpl ( impls) => impls)
1303+ . into_iter ( )
1304+ . flatten ( )
13031305 {
13041306 // we expect this macro to have the `EiiMacroFor` attribute, that points to a function
13051307 // signature that we'd like to compare the function we're currently checking with
1306- if let Some ( eii_extern_item) = find_attr ! ( tcx. get_all_attrs( eii_macro) , AttributeKind :: EiiMacroFor { eii_extern_item} => * eii_extern_item)
1308+ if let Some ( eii_extern_item) = find_attr ! ( tcx. get_all_attrs( * eii_macro) , AttributeKind :: EiiMacroFor { eii_extern_item, .. } => * eii_extern_item)
13071309 {
1308- let _ = compare_eii_predicate_entailment ( tcx, def_id, eii_extern_item) ;
1310+ let _ = compare_eii_function_types ( tcx, def_id, eii_extern_item) ;
13091311 } else {
13101312 panic ! (
13111313 "EII impl macro {eii_macro:?} did not have an eii macro for attribute pointing to a function"
0 commit comments