Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ba350ff
fix: re-enable self-assignment
notJoon Aug 10, 2025
de13718
test: Add rustdoc test for enum negative overflow
eval-exec Aug 10, 2025
20a134f
rustdoc: Use `discr`s `Display` impl to render the value with the cor…
eval-exec Aug 10, 2025
cd4676c
Turn _span into _trace as trace span name
Stypox Aug 11, 2025
6603fe1
Port `#[allow_internal_unsafe]` to the new attribute system (attempt 2)
scrabsha Aug 3, 2025
d523b9f
Support using #[unstable_feature_bound] on trait
tiif Aug 11, 2025
9a8facb
Update rustc dev guide
tiif Aug 11, 2025
bcf87e4
Update error message
tiif Aug 11, 2025
0ccbe8f
std: sys: pal: uefi: Overhaul Time
Ayush1325 Apr 14, 2025
35906ea
std: sys: pal: uefi: tests: Add systemtime tests
Ayush1325 May 24, 2025
79a134a
Document compiler and stdlib in stage1 in `pr-check-2` CI job
Kobzol Aug 11, 2025
c022ed9
don't emit rustdoc::broken_intra_doc_links for stuff like [!NOTE]
lolbinarycat Aug 4, 2025
189f264
Allow attr entries to declare list of alternatives for `List` and `Na…
estebank Aug 11, 2025
625143b
Add link to docs on malformed attributes
estebank Aug 11, 2025
6bb29af
Add link to invalid `repr` error
estebank Aug 11, 2025
413ca5d
fix tests
estebank Aug 11, 2025
19df24b
Make explicit guarantees about `Vec`’s allocator
SabrinaJewson Aug 11, 2025
3200d1f
Stabilize `sse4a` and `tbm` target features
sayantn Jul 27, 2025
50d8b80
Update books
rustbot Aug 11, 2025
32ee26c
Add more docs to templates for attrs with incorrect arguments
estebank Aug 11, 2025
adccb8d
Rework `NameValueStr`
estebank Aug 11, 2025
45e2449
Respond to review comments
SabrinaJewson Aug 11, 2025
1dc37df
Simplify `add_apple_sdk`
madsmtm Aug 11, 2025
928dd11
fix clippy test
estebank Aug 11, 2025
1cc44bf
Pass Apple SDK root to compiler driver via SDKROOT env var
madsmtm Aug 11, 2025
f4a9110
Only warn when invoking xcrun
madsmtm Aug 11, 2025
1d13162
Always attempt to invoke xcrun to get the Apple SDK
madsmtm Aug 11, 2025
86853b3
Account for new `assert!` desugaring in `!condition` suggestion
estebank Aug 11, 2025
39c5d6d
Factor out InherentImplCannotUnsafe
camsteffen Jul 30, 2025
fa73390
Move trait impl modifier errors to parsing
camsteffen Jul 30, 2025
3aa0ac0
Tweak trait modifier errors
camsteffen Jul 30, 2025
5bc23ce
Extract ast TraitImplHeader
camsteffen Jul 22, 2025
bf266dc
Propagate TraitImplHeader to hir
camsteffen Jul 24, 2025
7d63af0
Rollup merge of #131477 - madsmtm:sdkroot-via-env-var, r=nnethercote
fmease Aug 12, 2025
6665a8d
Rollup merge of #139806 - Ayush1325:uefi-systemtime, r=joboet
fmease Aug 12, 2025
d8e6b35
Rollup merge of #144386 - camsteffen:imploftrait, r=fmease
fmease Aug 12, 2025
4729abd
Rollup merge of #144542 - sayantn:stabilize-sse4a-tbm, r=Amanieu,trav…
fmease Aug 12, 2025
1b27e95
Rollup merge of #144921 - lolbinarycat:rustdoc-intra-doc-gfm-141866, …
fmease Aug 12, 2025
0b8489f
Rollup merge of #145155 - scrabsha:push-tkvwkolzooyq, r=jdonszelmann
fmease Aug 12, 2025
9f7f2ac
Rollup merge of #145214 - notJoon:fix/enable-self-assignment, r=petro…
fmease Aug 12, 2025
3b1b5c0
Rollup merge of #145216 - eval-exec:fix-145125-enum-rustdoc, r=fmease
fmease Aug 12, 2025
4f2ee51
Rollup merge of #145238 - estebank:attr-overhaul, r=jdonszelmann
fmease Aug 12, 2025
c4ec5a0
Rollup merge of #145249 - Stypox:_span-to-_trace, r=joshtriplett
fmease Aug 12, 2025
b1777e3
Rollup merge of #145251 - tiif:support_trait, r=BoxyUwU
fmease Aug 12, 2025
4c83108
Rollup merge of #145253 - Kobzol:pr-check-2-doc-stage-1, r=jieyouxu
fmease Aug 12, 2025
79b02dc
Rollup merge of #145260 - SabrinaJewson:vec-allocator-docs, r=dtolnay
fmease Aug 12, 2025
0662cf5
Rollup merge of #145263 - rustbot:docs-update, r=ehuss
fmease Aug 12, 2025
e2995e7
Rollup merge of #145273 - estebank:not-not, r=samueltardieu
fmease Aug 12, 2025
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
Prev Previous commit
Next Next commit
Add more docs to templates for attrs with incorrect arguments
  • Loading branch information
estebank committed Aug 11, 2025
commit 32ee26c625e8fbb7a3aa56788cbb352f04491964
5 changes: 4 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ use crate::{
CfgMatchesLintEmitter, fluent_generated, parse_version, session_diagnostics, try_gate_cfg,
};

pub const CFG_TEMPLATE: AttributeTemplate = template!(List: &["predicate"]);
pub const CFG_TEMPLATE: AttributeTemplate = template!(
List: &["predicate"],
"https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute"
);

pub fn parse_cfg_attr<'c, S: Stage>(
cx: &'c mut AcceptContext<'_, '_, S>,
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ impl<S: Stage> SingleAttributeParser<S> for InlineParser {
const PATH: &'static [Symbol] = &[sym::inline];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(Word, List: &["always", "never"]);
const TEMPLATE: AttributeTemplate = template!(
Word,
List: &["always", "never"],
"https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
match args {
Expand Down
15 changes: 12 additions & 3 deletions compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ impl<S: Stage> SingleAttributeParser<S> for LinkNameParser {
const PATH: &[Symbol] = &[sym::link_name];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name");
const TEMPLATE: AttributeTemplate = template!(
NameValueStr: "name",
"https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_name-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
let Some(nv) = args.name_value() else {
Expand All @@ -38,7 +41,10 @@ impl<S: Stage> SingleAttributeParser<S> for LinkSectionParser {
const PATH: &[Symbol] = &[sym::link_section];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name");
const TEMPLATE: AttributeTemplate = template!(
NameValueStr: "name",
"https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
let Some(nv) = args.name_value() else {
Expand Down Expand Up @@ -94,7 +100,10 @@ impl<S: Stage> SingleAttributeParser<S> for LinkOrdinalParser {
const PATH: &[Symbol] = &[sym::link_ordinal];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const TEMPLATE: AttributeTemplate = template!(List: &["ordinal"]);
const TEMPLATE: AttributeTemplate = template!(
List: &["ordinal"],
"https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
let ordinal = parse_single_integer(cx, args)?;
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ pub(crate) struct MacroUseParser {
first_span: Option<Span>,
}

const MACRO_USE_TEMPLATE: AttributeTemplate = template!(Word, List: &["name1, name2, ..."]);
const MACRO_USE_TEMPLATE: AttributeTemplate = template!(
Word, List: &["name1, name2, ..."],
"https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute"
);

impl<S: Stage> AttributeParser<S> for MacroUseParser {
const ATTRIBUTES: AcceptMapping<Self, S> = &[(
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/must_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ impl<S: Stage> SingleAttributeParser<S> for MustUseParser {
const PATH: &[Symbol] = &[sym::must_use];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(Word, NameValueStr: "reason");
const TEMPLATE: AttributeTemplate = template!(
Word, NameValueStr: "reason",
"https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
Some(AttributeKind::MustUse {
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ impl<S: Stage> SingleAttributeParser<S> for PathParser {
const PATH: &[Symbol] = &[sym::path];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "file");
const TEMPLATE: AttributeTemplate = template!(
NameValueStr: "file",
"https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
let Some(nv) = args.name_value() else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ impl<S: Stage> SingleAttributeParser<S> for ProcMacroDeriveParser {
const PATH: &[Symbol] = &[sym::proc_macro_derive];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const TEMPLATE: AttributeTemplate =
template!(List: &["TraitName", "TraitName, attributes(name1, name2, ...)"]);
const TEMPLATE: AttributeTemplate = template!(
List: &["TraitName", "TraitName, attributes(name1, name2, ...)"],
"https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
let (trait_name, helper_attrs) = parse_derive_like(cx, args, true)?;
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ impl<S: Stage> CombineAttributeParser<S> for ReprParser {
const CONVERT: ConvertFn<Self::Item> =
|items, first_span| AttributeKind::Repr { reprs: items, first_span };
// FIXME(jdonszelmann): never used
const TEMPLATE: AttributeTemplate = template!(List: &["C", "Rust", "transparent", "align(...)", "packed(...)", "<integer type>"]);
const TEMPLATE: AttributeTemplate = template!(
List: &["C", "Rust", "transparent", "align(...)", "packed(...)", "<integer type>"],
"https://doc.rust-lang.org/reference/type-layout.html#representations"
);

fn extend<'c>(
cx: &'c mut AcceptContext<'_, '_, S>,
Expand Down
11 changes: 8 additions & 3 deletions compiler/rustc_attr_parsing/src/attributes/test_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ impl<S: Stage> SingleAttributeParser<S> for IgnoreParser {
const PATH: &[Symbol] = &[sym::ignore];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
const TEMPLATE: AttributeTemplate = template!(Word, NameValueStr: "reason");
const TEMPLATE: AttributeTemplate = template!(
Word, NameValueStr: "reason",
"https://doc.rust-lang.org/reference/attributes/testing.html#the-ignore-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
Some(AttributeKind::Ignore {
Expand Down Expand Up @@ -51,8 +54,10 @@ impl<S: Stage> SingleAttributeParser<S> for ShouldPanicParser {
const PATH: &[Symbol] = &[sym::should_panic];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const TEMPLATE: AttributeTemplate =
template!(Word, List: &[r#"expected = "reason""#], NameValueStr: "reason");
const TEMPLATE: AttributeTemplate = template!(
Word, List: &[r#"expected = "reason""#], NameValueStr: "reason",
"https://doc.rust-lang.org/reference/attributes/testing.html#the-should_panic-attribute"
);

fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
Some(AttributeKind::ShouldPanic {
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_attr_parsing/src/session_diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
}
}

if let Some(link) = self.template.docs {
diag.note(format!("for more information, visit <{link}>"));
}
let suggestions = self.template.suggestions(false, &name);
diag.span_suggestions(
self.attr_span,
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,10 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
),
ungated!(
repr, Normal,
template!(List: &["C"], "https://doc.rust-lang.org/reference/type-layout.html#representations"),
template!(
List: &["C", "Rust", "transparent", "align(...)", "packed(...)", "<integer type>"],
"https://doc.rust-lang.org/reference/type-layout.html#representations"
),
DuplicatesOk, EncodeCrossCrate::No
),
// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/attributes/invalid-macro-use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,25 @@ extern crate std as s1;
#[macro_use(5)]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE expected a valid identifier here
//~| NOTE for more information, visit
extern crate std as s2;

#[macro_use(a = "b")]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE didn't expect any arguments here
//~| NOTE for more information, visit
extern crate std as s3;

#[macro_use(a(b))]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE didn't expect any arguments here
//~| NOTE for more information, visit
extern crate std as s4;

#[macro_use(a::b)]
//~^ ERROR malformed `macro_use` attribute input
//~| NOTE expected a valid identifier here
//~| NOTE for more information, visit
extern crate std as s5;

#[macro_use(a)]
Expand Down
26 changes: 15 additions & 11 deletions tests/ui/attributes/invalid-macro-use.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0469]: imported macro not found
--> $DIR/invalid-macro-use.rs:47:13
--> $DIR/invalid-macro-use.rs:51:13
|
LL | #[macro_use(a)]
| ^

error[E0469]: imported macro not found
--> $DIR/invalid-macro-use.rs:49:13
--> $DIR/invalid-macro-use.rs:53:13
|
LL | #[macro_use(b)]
| ^
Expand All @@ -24,6 +24,7 @@ LL | #[macro_use(5)]
| |
| expected a valid identifier here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[macro_use(5)]
Expand All @@ -34,13 +35,14 @@ LL + #[macro_use]
|

error[E0565]: malformed `macro_use` attribute input
--> $DIR/invalid-macro-use.rs:13:1
--> $DIR/invalid-macro-use.rs:14:1
|
LL | #[macro_use(a = "b")]
| ^^^^^^^^^^^^^^-----^^
| |
| didn't expect any arguments here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[macro_use(a = "b")]
Expand All @@ -51,13 +53,14 @@ LL + #[macro_use]
|

error[E0565]: malformed `macro_use` attribute input
--> $DIR/invalid-macro-use.rs:18:1
--> $DIR/invalid-macro-use.rs:20:1
|
LL | #[macro_use(a(b))]
| ^^^^^^^^^^^^^---^^
| |
| didn't expect any arguments here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[macro_use(a(b))]
Expand All @@ -68,13 +71,14 @@ LL + #[macro_use]
|

error[E0539]: malformed `macro_use` attribute input
--> $DIR/invalid-macro-use.rs:23:1
--> $DIR/invalid-macro-use.rs:26:1
|
LL | #[macro_use(a::b)]
| ^^^^^^^^^^^^----^^
| |
| expected a valid identifier here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[macro_use(a::b)]
Expand All @@ -85,13 +89,13 @@ LL + #[macro_use]
|

error: unused attribute
--> $DIR/invalid-macro-use.rs:28:1
--> $DIR/invalid-macro-use.rs:32:1
|
LL | #[macro_use(a)]
| ^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/invalid-macro-use.rs:30:1
--> $DIR/invalid-macro-use.rs:34:1
|
LL | #[macro_use]
| ^^^^^^^^^^^^
Expand All @@ -102,25 +106,25 @@ LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^

error: unused attribute
--> $DIR/invalid-macro-use.rs:36:1
--> $DIR/invalid-macro-use.rs:40:1
|
LL | #[macro_use(a)]
| ^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/invalid-macro-use.rs:34:1
--> $DIR/invalid-macro-use.rs:38:1
|
LL | #[macro_use]
| ^^^^^^^^^^^^

error: unused attribute
--> $DIR/invalid-macro-use.rs:42:1
--> $DIR/invalid-macro-use.rs:46:1
|
LL | #[macro_use]
| ^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/invalid-macro-use.rs:40:1
--> $DIR/invalid-macro-use.rs:44:1
|
LL | #[macro_use]
| ^^^^^^^^^^^^
Expand Down
22 changes: 21 additions & 1 deletion tests/ui/attributes/malformed-attrs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ LL | #[cfg]
| |
| expected this to be a list
| help: must be of the form: `#[cfg(predicate)]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute>

error: malformed `cfg_attr` attribute input
--> $DIR/malformed-attrs.rs:101:1
Expand Down Expand Up @@ -354,14 +356,24 @@ error[E0539]: malformed `rustc_macro_transparency` attribute input
--> $DIR/malformed-attrs.rs:43:1
|
LL | #[rustc_macro_transparency]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_macro_transparency = "transparent|semitransparent|opaque"]`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try changing it to one of the following valid forms of the attribute
|
LL | #[rustc_macro_transparency = "opaque"]
| ++++++++++
LL | #[rustc_macro_transparency = "semitransparent"]
| +++++++++++++++++++
LL | #[rustc_macro_transparency = "transparent"]
| +++++++++++++++

error[E0539]: malformed `repr` attribute input
--> $DIR/malformed-attrs.rs:45:1
|
LL | #[repr]
| ^^^^^^^ expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[repr(<integer type>)]
Expand Down Expand Up @@ -496,12 +508,16 @@ error[E0539]: malformed `link_name` attribute input
|
LL | #[link_name]
| ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_name-attribute>

error[E0539]: malformed `link_section` attribute input
--> $DIR/malformed-attrs.rs:85:1
|
LL | #[link_section]
| ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_section = "name"]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute>

error[E0539]: malformed `coverage` attribute input
--> $DIR/malformed-attrs.rs:87:1
Expand Down Expand Up @@ -560,6 +576,7 @@ LL | #[must_use = 1]
| |
| expected a string literal here
|
= note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute>
help: try changing it to one of the following valid forms of the attribute
|
LL - #[must_use = 1]
Expand All @@ -575,6 +592,7 @@ error[E0539]: malformed `proc_macro_derive` attribute input
LL | #[proc_macro_derive]
| ^^^^^^^^^^^^^^^^^^^^ expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros>
help: try changing it to one of the following valid forms of the attribute
|
LL | #[proc_macro_derive(TraitName)]
Expand Down Expand Up @@ -635,6 +653,8 @@ LL | #[link_ordinal]
| |
| expected this to be a list
| help: must be of the form: `#[link_ordinal(ordinal)]`
|
= note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute>

error[E0565]: malformed `ffi_const` attribute input
--> $DIR/malformed-attrs.rs:168:5
Expand Down
1 change: 1 addition & 0 deletions tests/ui/attributes/malformed-reprs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ error[E0539]: malformed `repr` attribute input
LL | #![repr]
| ^^^^^^^^ expected this to be a list
|
= note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations>
help: try changing it to one of the following valid forms of the attribute
|
LL - #![repr]
Expand Down
Loading