-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
#[deprecated(note = concat!("a", "b"))]
struct X;
Current output
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found `concat`
--> src/main.rs:1:21
|
1 | #[deprecated(note = concat!("a", "b"))]
| ^^^^^^
|
help: surround the identifier with quotation marks to make it into a string literal
|
1 | #[deprecated(note = "concat"!("a", "b"))]
| + +
Desired output
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found macro invocation
help: macros cannot be used here
Rationale and extra context
No response
Other cases
Rust Version
rustc 1.91.0-nightly (1ed3cd703 2025-09-06)
binary: rustc
commit-hash: 1ed3cd7030718935a5c5e5c8f6581f36d8be179f
commit-date: 2025-09-06
host: x86_64-unknown-linux-gnu
release: 1.91.0-nightly
LLVM version: 21.1.0
Anything else?
No response
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.