Move stability lookup after cross-crate check
This commit is contained in:
parent
963e402f43
commit
95bf0fb917
1 changed files with 11 additions and 11 deletions
|
@ -421,6 +421,12 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
return EvalResult::Allow;
|
return EvalResult::Allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only the cross-crate scenario matters when checking unstable APIs
|
||||||
|
let cross_crate = !def_id.is_local();
|
||||||
|
if !cross_crate {
|
||||||
|
return EvalResult::Allow;
|
||||||
|
}
|
||||||
|
|
||||||
let stability = self.lookup_stability(def_id);
|
let stability = self.lookup_stability(def_id);
|
||||||
debug!(
|
debug!(
|
||||||
"stability: \
|
"stability: \
|
||||||
|
@ -428,12 +434,6 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
def_id, span, stability
|
def_id, span, stability
|
||||||
);
|
);
|
||||||
|
|
||||||
// Only the cross-crate scenario matters when checking unstable APIs
|
|
||||||
let cross_crate = !def_id.is_local();
|
|
||||||
if !cross_crate {
|
|
||||||
return EvalResult::Allow;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Issue #38412: private items lack stability markers.
|
// Issue #38412: private items lack stability markers.
|
||||||
if skip_stability_check_due_to_privacy(self, def_id) {
|
if skip_stability_check_due_to_privacy(self, def_id) {
|
||||||
return EvalResult::Allow;
|
return EvalResult::Allow;
|
||||||
|
@ -508,17 +508,17 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
return EvalResult::Allow;
|
return EvalResult::Allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
let stability = self.lookup_default_body_stability(def_id);
|
|
||||||
debug!(
|
|
||||||
"body stability: inspecting def_id={def_id:?} span={span:?} of stability={stability:?}"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Only the cross-crate scenario matters when checking unstable APIs
|
// Only the cross-crate scenario matters when checking unstable APIs
|
||||||
let cross_crate = !def_id.is_local();
|
let cross_crate = !def_id.is_local();
|
||||||
if !cross_crate {
|
if !cross_crate {
|
||||||
return EvalResult::Allow;
|
return EvalResult::Allow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let stability = self.lookup_default_body_stability(def_id);
|
||||||
|
debug!(
|
||||||
|
"body stability: inspecting def_id={def_id:?} span={span:?} of stability={stability:?}"
|
||||||
|
);
|
||||||
|
|
||||||
// Issue #38412: private items lack stability markers.
|
// Issue #38412: private items lack stability markers.
|
||||||
if skip_stability_check_due_to_privacy(self, def_id) {
|
if skip_stability_check_due_to_privacy(self, def_id) {
|
||||||
return EvalResult::Allow;
|
return EvalResult::Allow;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue