-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
E0726 makes invalid mid-keyword suggestion with proc-macro derived on struct #108256
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
and in
Cargo.toml:I expected either:
cargo checkInstead, this error appeared:
I'm guessing the error being pointed to is in the procedural macro generated code, but that's not immediately clear as it points to my struct definition. This code compiles when I remove SortBy and its attribute.
Meta
rustc --version --verbose:(Issue template requested a backtrace but
RUST_BACKTRACE=1 cargo builddid not produce additional output.)