Make feature suggestion more consistent.

This commit is contained in:
Camille GILLOT
2025-06-18 16:52:38 +00:00
parent c6e77b3ba6
commit 7fa94af556
13 changed files with 40 additions and 87 deletions

View File

@@ -302,9 +302,7 @@ fn default_body_is_unstable(
reason: reason_str,
});
let inject_span = item_did
.as_local()
.and_then(|id| tcx.crate_level_attribute_injection_span(tcx.local_def_id_to_hir_id(id)));
let inject_span = item_did.is_local().then(|| tcx.crate_level_attribute_injection_span());
rustc_session::parse::add_feature_diagnostics_for_issue(
&mut err,
&tcx.sess,