@@ -80,8 +80,8 @@ use crate::traits::solve::{
8080use crate :: ty:: predicate:: ExistentialPredicateStableCmpExt as _;
8181use crate :: ty:: {
8282 self , AdtDef , AdtDefData , AdtKind , Binder , Clause , Clauses , Const , GenericArg , GenericArgs ,
83- GenericArgsRef , GenericParamDefKind , List , ListWithCachedTypeInfo , ParamConst , ParamTy ,
84- Pattern , PatternKind , PolyExistentialPredicate , PolyFnSig , Predicate , PredicateKind ,
83+ GenericArgsRef , GenericParamDefKind , Instance , List , ListWithCachedTypeInfo , ParamConst ,
84+ ParamTy , Pattern , PatternKind , PolyExistentialPredicate , PolyFnSig , Predicate , PredicateKind ,
8585 PredicatePolarity , Region , RegionKind , ReprOptions , TraitObjectVisitor , Ty , TyKind , TyVid ,
8686 ValTree , ValTreeKind , Visibility ,
8787} ;
@@ -3552,6 +3552,14 @@ impl<'tcx> TyCtxt<'tcx> {
35523552 self . get_diagnostic_attr ( def_id, sym:: do_not_recommend) . is_some ( )
35533553 }
35543554
3555+ pub fn has_inline_always_override ( self , instance : Instance < ' tcx > ) -> bool {
3556+ let Some ( overrides) = & self . sess . opts . unstable_opts . inline_always_overrides else {
3557+ return false ;
3558+ } ;
3559+ let symbol_name = self . symbol_name ( instance) . name ;
3560+ overrides. iter ( ) . any ( |o| symbol_name. starts_with ( o) )
3561+ }
3562+
35553563 /// Whether this def is one of the special bin crate entrypoint functions that must have a
35563564 /// monomorphization and also not be internalized in the bin crate.
35573565 pub fn is_entrypoint ( self , def_id : DefId ) -> bool {
0 commit comments