@@ -43,10 +43,14 @@ impl<'tcx> AnalysisCtxt<'tcx> {
4343 // This also avoids `TooGeneric` when def_id is an trait method.
4444 v
4545 } else {
46- let callee_instance =
47- ty:: Instance :: try_resolve ( self . tcx , typing_env, def_id, args. no_bound_vars ( ) . unwrap ( ) )
48- . unwrap ( )
49- . ok_or ( Error :: TooGeneric ) ?;
46+ let callee_instance = ty:: Instance :: try_resolve (
47+ self . tcx ,
48+ typing_env,
49+ def_id,
50+ args. no_bound_vars ( ) . unwrap ( ) ,
51+ )
52+ . unwrap ( )
53+ . ok_or ( Error :: TooGeneric ) ?;
5054 self . call_stack . borrow_mut ( ) . push ( UseSite {
5155 instance : typing_env. as_query_input ( instance) ,
5256 kind : UseSiteKind :: Call ( terminator. source_info . span ) ,
@@ -154,10 +158,14 @@ impl<'tcx> AnalysisCtxt<'tcx> {
154158 diag. note ( format ! ( "but the callee expects preemption count {}" , v) ) ;
155159 return Ok ( ( ) ) ;
156160 } else {
157- let callee_instance =
158- ty:: Instance :: try_resolve ( self . tcx , typing_env, def_id, args. no_bound_vars ( ) . unwrap ( ) )
159- . unwrap ( )
160- . ok_or ( Error :: TooGeneric ) ?;
161+ let callee_instance = ty:: Instance :: try_resolve (
162+ self . tcx ,
163+ typing_env,
164+ def_id,
165+ args. no_bound_vars ( ) . unwrap ( ) ,
166+ )
167+ . unwrap ( )
168+ . ok_or ( Error :: TooGeneric ) ?;
161169
162170 if !span. has_primary_spans ( ) {
163171 span = self . def_span ( callee_instance. def_id ( ) ) . into ( ) ;
@@ -267,7 +275,7 @@ impl<'tcx> AnalysisCtxt<'tcx> {
267275 ) -> Result < ( ) , Error > {
268276 match instance. def {
269277 // No Rust built-in intrinsics will mess with preemption count.
270- ty:: InstanceKind :: Intrinsic ( _) => unreachable ! ( ) ,
278+ ty:: InstanceKind :: Intrinsic ( _) | ty :: InstanceKind :: LlvmIntrinsic ( _ ) => unreachable ! ( ) ,
271279 // Empty drop glue, then it definitely won't mess with preemption count.
272280 ty:: InstanceKind :: Shim ( ty:: ShimKind :: DropGlue ( _, None ) ) => unreachable ! ( ) ,
273281 ty:: InstanceKind :: Shim ( ty:: ShimKind :: DropGlue ( _, Some ( ty) ) ) => {
@@ -929,7 +937,9 @@ memoize!(
929937 } = poly_instance;
930938 match instance. def {
931939 // No Rust built-in intrinsics will mess with preemption count.
932- ty:: InstanceKind :: Intrinsic ( _) => return Ok ( ExpectationRange :: top( ) ) ,
940+ ty:: InstanceKind :: Intrinsic ( _) | ty:: InstanceKind :: LlvmIntrinsic ( _) => {
941+ return Ok ( ExpectationRange :: top( ) ) ;
942+ }
933943 // Empty drop glue, then it definitely won't mess with preemption count.
934944 ty:: InstanceKind :: Shim ( ty:: ShimKind :: DropGlue ( _, None ) ) => {
935945 return Ok ( ExpectationRange :: top( ) ) ;
@@ -1098,7 +1108,7 @@ memoize!(
10981108
10991109 match instance. def {
11001110 // No Rust built-in intrinsics will mess with preemption count.
1101- ty:: InstanceKind :: Intrinsic ( _) => return Ok ( ( ) ) ,
1111+ ty:: InstanceKind :: Intrinsic ( _) | ty :: InstanceKind :: LlvmIntrinsic ( _ ) => return Ok ( ( ) ) ,
11021112 // Empty drop glue, then it definitely won't mess with preemption count.
11031113 ty:: InstanceKind :: Shim ( ty:: ShimKind :: DropGlue ( _, None ) ) => return Ok ( ( ) ) ,
11041114 ty:: InstanceKind :: Shim ( ty:: ShimKind :: DropGlue ( _, Some ( ty) ) ) => {
0 commit comments