@@ -421,19 +421,19 @@ impl<'tcx> TyCtxt<'tcx> {
421
421
return EvalResult :: Allow ;
422
422
}
423
423
424
+ // Only the cross-crate scenario matters when checking unstable APIs
425
+ let cross_crate = !def_id. is_local ( ) ;
426
+ if !cross_crate {
427
+ return EvalResult :: Allow ;
428
+ }
429
+
424
430
let stability = self . lookup_stability ( def_id) ;
425
431
debug ! (
426
432
"stability: \
427
433
inspecting def_id={:?} span={:?} of stability={:?}",
428
434
def_id, span, stability
429
435
) ;
430
436
431
- // Only the cross-crate scenario matters when checking unstable APIs
432
- let cross_crate = !def_id. is_local ( ) ;
433
- if !cross_crate {
434
- return EvalResult :: Allow ;
435
- }
436
-
437
437
// Issue #38412: private items lack stability markers.
438
438
if skip_stability_check_due_to_privacy ( self , def_id) {
439
439
return EvalResult :: Allow ;
@@ -508,17 +508,17 @@ impl<'tcx> TyCtxt<'tcx> {
508
508
return EvalResult :: Allow ;
509
509
}
510
510
511
- let stability = self . lookup_default_body_stability ( def_id) ;
512
- debug ! (
513
- "body stability: inspecting def_id={def_id:?} span={span:?} of stability={stability:?}"
514
- ) ;
515
-
516
511
// Only the cross-crate scenario matters when checking unstable APIs
517
512
let cross_crate = !def_id. is_local ( ) ;
518
513
if !cross_crate {
519
514
return EvalResult :: Allow ;
520
515
}
521
516
517
+ let stability = self . lookup_default_body_stability ( def_id) ;
518
+ debug ! (
519
+ "body stability: inspecting def_id={def_id:?} span={span:?} of stability={stability:?}"
520
+ ) ;
521
+
522
522
// Issue #38412: private items lack stability markers.
523
523
if skip_stability_check_due_to_privacy ( self , def_id) {
524
524
return EvalResult :: Allow ;
0 commit comments