Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,6 @@ impl<'a> AstValidator<'a> {
.for_each(|attr| {
if attr.is_doc_comment() {
self.dcx().emit_err(diagnostics::FnParamDocComment { span: attr.span });
} else {
self.dcx().emit_err(diagnostics::FnParamForbiddenAttr { span: attr.span });
}
});
}
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_ast_passes/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,6 @@ pub(crate) struct FnParamDocComment {
pub span: Span,
}

// FIXME(splat): add splat to the allowed built-in attributes when it is complete/stabilized
#[derive(Diagnostic)]
#[diag(
"allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters"
)]
pub(crate) struct FnParamForbiddenAttr {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("`#[{$eii_name}]` is not allowed to have `#[{$attr_name}]`")]
pub(crate) struct EiiImplAttributeNotSupported<'a> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/cfi_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use super::prelude::*;
pub(crate) struct CfiEncodingParser;
impl SingleAttributeParser for CfiEncodingParser {
const PATH: &[Symbol] = &[sym::cfi_encoding];
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[
Allow(Target::Struct),
Allow(Target::ForeignTy),
Allow(Target::Enum),
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ impl NoArgsAttributeParser for ColdParser {
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::ForeignFn),
Allow(Target::Closure),
Error(Target::Param),
]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::Cold;
Expand Down Expand Up @@ -393,6 +394,7 @@ impl NoArgsAttributeParser for NoMangleParser {
Allow(Target::Method(MethodKind::TraitImpl)),
AllowSilent(Target::Const), // Handled in the `InvalidNoMangleItems` pass
Error(Target::Closure),
Error(Target::Param),
]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoMangle;
Expand Down
18 changes: 9 additions & 9 deletions compiler/rustc_attr_parsing/src/attributes/crate_level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl SingleAttributeParser for CrateNameParser {
const ON_DUPLICATE: OnDuplicate = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name");
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const STABILITY: AttributeStability = AttributeStability::Stable;

fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option<AttributeKind> {
Expand All @@ -37,7 +37,7 @@ impl CombineAttributeParser for CrateTypeParser {
type Item = CrateType;
const CONVERT: ConvertFn<Self::Item> = |items, _| AttributeKind::CrateType(items);
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const TEMPLATE: AttributeTemplate =
template!(NameValueStr: "crate type", "https://doc.rust-lang.org/reference/linkage.html");
const STABILITY: AttributeStability = AttributeStability::Stable;
Expand Down Expand Up @@ -81,7 +81,7 @@ impl SingleAttributeParser for RecursionLimitParser {
const ON_DUPLICATE: OnDuplicate = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "N", "https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute");
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const STABILITY: AttributeStability = AttributeStability::Stable;

fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option<AttributeKind> {
Expand Down Expand Up @@ -113,7 +113,7 @@ impl SingleAttributeParser for TypeLengthLimitParser {
const ON_DUPLICATE: OnDuplicate = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "N");
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const STABILITY: AttributeStability = AttributeStability::Stable;

fn convert(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option<AttributeKind> {
Expand Down Expand Up @@ -156,7 +156,7 @@ impl NoArgsAttributeParser for NoStdParser {
const PATH: &[Symbol] = &[sym::no_std];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::NoStd;
}
Expand All @@ -167,7 +167,7 @@ impl NoArgsAttributeParser for NoMainParser {
const PATH: &[Symbol] = &[sym::no_main];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::NoMain;
}
Expand All @@ -187,7 +187,7 @@ impl SingleAttributeParser for WindowsSubsystemParser {
const PATH: &[Symbol] = &[sym::windows_subsystem];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::WarnButFutureError;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const TEMPLATE: AttributeTemplate = template!(NameValueStr: ["windows", "console"], "https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute");
const STABILITY: AttributeStability = AttributeStability::Stable;

Expand Down Expand Up @@ -243,7 +243,7 @@ impl NoArgsAttributeParser for NoBuiltinsParser {
const PATH: &[Symbol] = &[sym::no_builtins];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::NoBuiltins;
}
Expand Down Expand Up @@ -282,7 +282,7 @@ impl CombineAttributeParser for FeatureParser {
type Item = Ident;
const CONVERT: ConvertFn<Self::Item> = AttributeKind::Feature;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate), Error(Target::Param)]);
const TEMPLATE: AttributeTemplate = template!(List: &["feature1, feature2, ..."]);
const STABILITY: AttributeStability = AttributeStability::Stable;

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/attributes/deprecation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ impl SingleAttributeParser for DeprecatedParser {
Allow(Target::Impl { of_trait: false }),
Allow(Target::Crate),
Error(Target::WherePredicate),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(
Word,
Expand Down
18 changes: 11 additions & 7 deletions compiler/rustc_attr_parsing/src/attributes/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ use super::{AcceptMapping, AttributeParser, template};
use crate::context::{AcceptContext, FinalizeContext};
use crate::diagnostics::{
AttrCrateLevelOnly, DocAliasBadChar, DocAliasDuplicated, DocAliasEmpty, DocAliasMalformed,
DocAliasStartEnd, DocAttrNotCrateLevel, DocAttributeNotAttribute, DocAutoCfgExpectsHideOrShow,
DocAutoCfgHideShowExpectsList, DocAutoCfgHideShowNoIdentBeforeValues,
DocAutoCfgHideShowUnexpectedItem, DocAutoCfgHideShowUnexpectedItemAfterValues,
DocAutoCfgHideShowValuesMix, DocAutoCfgWrongLiteral, DocKeywordNotKeyword, DocTestLiteral,
DocTestTakesList, DocTestUnknown, DocUnknownAny, DocUnknownInclude, DocUnknownPasses,
DocUnknownPlugins, DocUnknownSpotlight, ExpectedNameValue, ExpectedNoArgs,
IllFormedAttributeInput, MalformedDoc, UnusedDuplicate,
DocAliasStartEnd, DocAttrNotCrateLevel, DocAttrNotParameters, DocAttributeNotAttribute,
DocAutoCfgExpectsHideOrShow, DocAutoCfgHideShowExpectsList,
DocAutoCfgHideShowNoIdentBeforeValues, DocAutoCfgHideShowUnexpectedItem,
DocAutoCfgHideShowUnexpectedItemAfterValues, DocAutoCfgHideShowValuesMix,
DocAutoCfgWrongLiteral, DocKeywordNotKeyword, DocTestLiteral, DocTestTakesList, DocTestUnknown,
DocUnknownAny, DocUnknownInclude, DocUnknownPasses, DocUnknownPlugins, DocUnknownSpotlight,
ExpectedNameValue, ExpectedNoArgs, IllFormedAttributeInput, MalformedDoc, UnusedDuplicate,
};
use crate::parser::{
ArgParser, MetaItemListParser, MetaItemOrLitParser, MetaItemParser, OwnedPathParser,
Expand Down Expand Up @@ -60,6 +60,10 @@ fn check_attr_not_crate_level(
cx.emit_err(DocAttrNotCrateLevel { span, attr_name });
return false;
}
if cx.shared.target == Target::Param {
cx.emit_err(DocAttrNotParameters { span, attr_name });
return false;
}
true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ impl SingleAttributeParser for InstructionSetParser {
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::TraitImpl)),
Allow(Target::Method(MethodKind::Trait { body: true })),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(List: &["set"], "https://doc.rust-lang.org/reference/attributes/codegen.html#the-instruction_set-attribute");
const STABILITY: AttributeStability = AttributeStability::Stable;
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ impl SingleAttributeParser for LinkNameParser {
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[
Allow(Target::ForeignFn),
Allow(Target::ForeignStatic),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(
NameValueStr: "name",
Expand Down Expand Up @@ -72,7 +73,7 @@ impl CombineAttributeParser for LinkParser {
r#"name = "...", kind = "dylib|static|...", wasm_import_module = "...", import_name_type = "decorated|noprefix|undecorated""#,
], "https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute");
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::ForeignMod)]);
AllowedTargets::AllowListWarnRest(&[Allow(Target::ForeignMod), Error(Target::Param)]);
const STABILITY: AttributeStability = AttributeStability::Stable;

fn extend(
Expand Down Expand Up @@ -506,6 +507,7 @@ impl SingleAttributeParser for LinkSectionParser {
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::TraitImpl)),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(
NameValueStr: "name",
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl NoArgsAttributeParser for AutomaticallyDerivedParser {
Allow(Target::Impl { of_trait: true }),
Error(Target::Crate),
Error(Target::WherePredicate),
Error(Target::Param),
]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::AutomaticallyDerived;
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const MACRO_USE_ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListW
Allow(Target::Mod),
Allow(Target::ExternCrate),
Error(Target::WherePredicate),
Error(Target::Param),
]);

impl AttributeParser for MacroUseParser {
Expand Down Expand Up @@ -155,6 +156,7 @@ impl SingleAttributeParser for MacroExportParser {
Allow(Target::MacroDef),
Error(Target::WherePredicate),
Error(Target::Crate),
Error(Target::Param),
]);
const STABILITY: AttributeStability = AttributeStability::Stable;

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/attributes/must_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ impl SingleAttributeParser for MustUseParser {
// `#[must_use]`
Allow(Target::Trait),
Error(Target::WherePredicate),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(
Word, NameValueStr: "reason",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ pub(crate) struct NoImplicitPreludeParser;
impl NoArgsAttributeParser for NoImplicitPreludeParser {
const PATH: &[rustc_span::Symbol] = &[sym::no_implicit_prelude];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Mod), Allow(Target::Crate)]);
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[
Allow(Target::Mod),
Allow(Target::Crate),
Error(Target::Param),
]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::NoImplicitPrelude;
}
7 changes: 5 additions & 2 deletions compiler/rustc_attr_parsing/src/attributes/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ pub(crate) struct PathParser;
impl SingleAttributeParser for PathParser {
const PATH: &[Symbol] = &[sym::path];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::WarnButFutureError;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Mod), Error(Target::Crate)]);
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[
Allow(Target::Mod),
Error(Target::Crate),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(
NameValueStr: "file",
"https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute"
Expand Down
14 changes: 10 additions & 4 deletions compiler/rustc_attr_parsing/src/attributes/test_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ pub(crate) struct IgnoreParser;
impl SingleAttributeParser for IgnoreParser {
const PATH: &[Symbol] = &[sym::ignore];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Fn), Error(Target::WherePredicate)]);
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[
Allow(Target::Fn),
Error(Target::WherePredicate),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(
Word, NameValueStr: "reason",
"https://doc.rust-lang.org/reference/attributes/testing.html#the-ignore-attribute"
Expand Down Expand Up @@ -51,8 +54,11 @@ pub(crate) struct ShouldPanicParser;
impl SingleAttributeParser for ShouldPanicParser {
const PATH: &[Symbol] = &[sym::should_panic];
const ON_DUPLICATE: OnDuplicate = OnDuplicate::WarnButFutureError;
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Fn), Error(Target::WherePredicate)]);
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[
Allow(Target::Fn),
Error(Target::WherePredicate),
Error(Target::Param),
]);
const TEMPLATE: AttributeTemplate = template!(
Word, List: &[r#"expected = "reason""#], NameValueStr: "reason",
"https://doc.rust-lang.org/reference/attributes/testing.html#the-should_panic-attribute"
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_attr_parsing/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,14 @@ pub(crate) struct DocAttrNotCrateLevel {
pub attr_name: Symbol,
}

#[derive(Diagnostic)]
#[diag("`#![doc({$attr_name} = \"...\")]` isn't allowed on parameters")]
pub(crate) struct DocAttrNotParameters {
#[primary_span]
pub span: Span,
pub attr_name: Symbol,
}

#[derive(Diagnostic)]
#[diag("nonexistent keyword `{$keyword}` used in `#[doc(keyword = \"...\")]`")]
#[help("only existing keywords are allowed in core/std")]
Expand Down
25 changes: 18 additions & 7 deletions compiler/rustc_attr_parsing/src/target_checking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use crate::diagnostics::{
InvalidAttrAtCrateLevel, InvalidTarget, InvalidTargetHelp, ItemFollowingInnerAttr,
UnsupportedAttributesInWhere,
};
use crate::target_checking::Policy::Allow;
use crate::{AttributeParser, ShouldEmit};

#[derive(Debug)]
Expand All @@ -35,6 +34,19 @@ pub(crate) enum AllowedResult {
}

impl AllowedTargets<'_> {
pub(crate) fn is_only_crate_level_allowed(&self) -> bool {
let (AllowedTargets::AllowList(policies) | AllowedTargets::AllowListWarnRest(policies)) =
self
else {
return false;
};
policies.iter().all(|p| match p {
Policy::Allow(Target::Crate) => true,
Policy::Allow(_) => false,
_ => true,
})
}

pub(crate) fn is_allowed(&self, target: Target) -> AllowedResult {
match self {
AllowedTargets::AllowList(list) => {
Expand Down Expand Up @@ -113,12 +125,11 @@ impl<'sess> AttributeParser<'sess> {

// For crate-level attributes we emit a specific set of lints to warn
// people about accidentally not using them on the crate.
if let &AllowedTargets::AllowList(&[Allow(Target::Crate)]) = allowed_targets {
Self::check_crate_level(cx, false);
return;
}
if let &AllowedTargets::AllowListWarnRest(&[Allow(Target::Crate)]) = allowed_targets {
Self::check_crate_level(cx, true);
if allowed_targets.is_only_crate_level_allowed() {
Self::check_crate_level(
cx,
matches!(allowed_targets, AllowedTargets::AllowListWarnRest(..)),
);
return;
}

Expand Down
1 change: 0 additions & 1 deletion tests/ui/attributes/attrs-on-params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

fn function(#[inline] param: u32) {
//~^ ERROR attribute cannot be used on
//~| ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes
}

fn main() {}
8 changes: 1 addition & 7 deletions tests/ui/attributes/attrs-on-params.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
--> $DIR/attrs-on-params.rs:3:13
|
LL | fn function(#[inline] param: u32) {
| ^^^^^^^^^

error: the `inline` attribute cannot be used on function params
--> $DIR/attrs-on-params.rs:3:15
|
Expand All @@ -12,5 +6,5 @@ LL | fn function(#[inline] param: u32) {
|
= help: the `inline` attribute can only be applied to functions

error: aborting due to 2 previous errors
error: aborting due to 1 previous error

3 changes: 1 addition & 2 deletions tests/ui/force-inlining/invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ impl<T> FooBaz for Bar<T> {
macro_rules! barqux { ($foo:tt) => { $foo }; }

fn barqux(#[rustc_force_inline] _x: u32) {}
//~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
//~^^ ERROR attribute cannot be used on
//~^ ERROR attribute cannot be used on

#[rustc_force_inline]
//~^ ERROR attribute cannot be applied to a `async`, `gen` or `async gen` function
Expand Down
Loading
Loading