@@ -38,7 +38,7 @@ use rustc_hir::definitions::{DefPathData, Definitions, DisambiguatorState};
3838use rustc_hir:: intravisit:: VisitorExt ;
3939use rustc_hir:: lang_items:: LangItem ;
4040use rustc_hir:: limit:: Limit ;
41- use rustc_hir:: { self as hir, Attribute , HirId , Node , TraitCandidate , find_attr} ;
41+ use rustc_hir:: { self as hir, HirId , Node , TraitCandidate , find_attr} ;
4242use rustc_index:: IndexVec ;
4343use rustc_query_system:: cache:: WithDepNode ;
4444use rustc_query_system:: dep_graph:: DepNodeIndex ;
@@ -49,7 +49,7 @@ use rustc_session::config::CrateType;
4949use rustc_session:: cstore:: { CrateStoreDyn , Untracked } ;
5050use rustc_session:: lint:: Lint ;
5151use rustc_span:: def_id:: { CRATE_DEF_ID , DefPathHash , StableCrateId } ;
52- use rustc_span:: { DUMMY_SP , Ident , Span , Symbol , kw, sym } ;
52+ use rustc_span:: { DUMMY_SP , Ident , Span , Symbol , kw} ;
5353use rustc_type_ir:: TyKind :: * ;
5454use rustc_type_ir:: lang_items:: { SolverAdtLangItem , SolverLangItem , SolverTraitLangItem } ;
5555pub use rustc_type_ir:: lift:: Lift ;
@@ -3564,7 +3564,7 @@ impl<'tcx> TyCtxt<'tcx> {
35643564
35653565pub fn provide ( providers : & mut Providers ) {
35663566 providers. is_panic_runtime =
3567- |tcx, LocalCrate | contains_name ( tcx. hir_krate_attrs ( ) , sym :: panic_runtime ) ;
3567+ |tcx, LocalCrate | find_attr ! ( tcx. hir_krate_attrs( ) , AttributeKind :: PanicRuntime ) ;
35683568 providers. is_compiler_builtins =
35693569 |tcx, LocalCrate | find_attr ! ( tcx. hir_krate_attrs( ) , AttributeKind :: CompilerBuiltins ) ;
35703570 providers. has_panic_handler = |tcx, LocalCrate | {
@@ -3573,7 +3573,3 @@ pub fn provide(providers: &mut Providers) {
35733573 } ;
35743574 providers. source_span = |tcx, def_id| tcx. untracked . source_span . get ( def_id) . unwrap_or ( DUMMY_SP ) ;
35753575}
3576-
3577- pub fn contains_name ( attrs : & [ Attribute ] , name : Symbol ) -> bool {
3578- attrs. iter ( ) . any ( |x| x. has_name ( name) )
3579- }
0 commit comments