1
Fork 0

Auto merge of #127957 - matthiaskrgr:rollup-1u5ivck, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #127350 (Parser: Suggest Placing the Return Type After Function Parameters)
 - #127621 (Rewrite and rename `issue-22131` and `issue-26006` `run-make` tests to rmake)
 - #127662 (When finding item gated behind a `cfg` flag, point at it)
 - #127903 (`force_collect` improvements)
 - #127932 (rustdoc: fix `current` class on sidebar modnav)
 - #127943 (Don't allow unsafe statics outside of extern blocks)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-07-19 13:39:12 +00:00
commit 3811f40d27
49 changed files with 490 additions and 146 deletions

View file

@ -232,6 +232,8 @@ resolve_is_private =
resolve_item_was_behind_feature =
the item is gated behind the `{$feature}` feature
resolve_item_was_cfg_out = the item is gated here
resolve_items_in_traits_are_not_importable =
items in traits are not importable

View file

@ -2532,7 +2532,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
&& let NestedMetaItem::MetaItem(meta_item) = &nested[0]
&& let MetaItemKind::NameValue(feature_name) = &meta_item.kind
{
let note = errors::ItemWasBehindFeature { feature: feature_name.symbol };
let note = errors::ItemWasBehindFeature {
feature: feature_name.symbol,
span: meta_item.span,
};
err.subdiagnostic(note);
} else {
let note = errors::ItemWasCfgOut { span: cfg.span };
err.subdiagnostic(note);
}
}

View file

@ -1228,6 +1228,15 @@ pub(crate) struct FoundItemConfigureOut {
#[note(resolve_item_was_behind_feature)]
pub(crate) struct ItemWasBehindFeature {
pub(crate) feature: Symbol,
#[primary_span]
pub(crate) span: Span,
}
#[derive(Subdiagnostic)]
#[note(resolve_item_was_cfg_out)]
pub(crate) struct ItemWasCfgOut {
#[primary_span]
pub(crate) span: Span,
}
#[derive(Diagnostic)]