avoid embedding StabilityLevel::Unstable reason string into metadata multiple times

This commit is contained in:
klensy
2022-07-01 18:20:46 +03:00
parent 1673f1450e
commit b38c94857d
5 changed files with 46 additions and 9 deletions

View File

@@ -475,7 +475,13 @@ impl<'tcx> TyCtxt<'tcx> {
}
let suggestion = suggestion_for_allocator_api(self, def_id, span, feature);
EvalResult::Deny { feature, reason, issue, suggestion, is_soft }
EvalResult::Deny {
feature,
reason: reason.to_opt_reason(),
issue,
suggestion,
is_soft,
}
}
Some(_) => {
// Stable APIs are always ok to call and deprecated APIs are