Repository navigation
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosArea: Procedural macrosA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.T-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Found in #163482:
- https://crater-reports.s3.amazonaws.com/beta-1.100/1.100.0-beta.1/gh/parrrate.matchjson/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.100/1.100.0-beta.1/gh/agner-rs.mm1/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.100/1.100.0-beta.1/gh/xjoker-dev.NPorter/log.txt (with Default derive macro: https://github.com/xjoker-dev/NPorter/blob/da2f92f0029a2819fdf01880fe3b6c234d2b5bc0/third_party/rustables/src/expr/masquerade.rs#L8)
- https://crater-reports.s3.amazonaws.com/beta-1.100/1.100.0-beta.1/reg/mm1-multinode-0.7.26/log.txt
- https://crater-reports.s3.amazonaws.com/beta-1.100/1.100.0-beta.1/gh/Skxxtz.Fishnet/log.txt
I tried this code:
#[derive(Clone, Copy)]
#[ghost::phantom]
pub struct Spooky<T>;I expected to see this happen: compiles successfully on stable
Instead, this happened: compile error on beta:
error: the `Self` constructor can only be used with tuple or unit structs
--> src\lib.rs:1:10
|
1 | #[derive(Clone, Copy)]
| ^^^^^
Meta
rustc --version --verbose:
1.100-beta
Backtrace
<backtrace>
Reacted by Max and teor
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosArea: Procedural macrosA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityT-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.T-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Activity
mejrs commentedon Oct 5, 2026
Most likely #163080, cc @cyrgani @nnethercote
The phantom macro rewrites the struct to en enum, so
Selfis no longer valid. that PR rewrote the macro to emitSelfrather than the name of the struct, which is also re-exported by thephantommacro as an enum variant.Rollup merge of rust-lang#163863 - cyrgani:annoying-attr-macros, r=nn…
Rollup merge of rust-lang#163863 - cyrgani:annoying-attr-macros, r=nn…
Rollup merge of rust-lang#163863 - cyrgani:annoying-attr-macros, r=nn…
Rollup merge of rust-lang#163863 - cyrgani:annoying-attr-macros, r=nn…
rustbot commentedon Oct 6, 2026
Assigning P-high (discussion on Zulip).
Rollup merge of rust-lang#163863 - cyrgani:annoying-attr-macros, r=nn…
Rollup merge of rust-lang#163863 - cyrgani:annoying-attr-macros, r=nn…
Rollup merge of rust-lang#163863 - cyrgani:annoying-attr-macros, r=nn…
Unrolled build for #163863 in rollup 163957
Rollup merge of #163863 - cyrgani:annoying-attr-macros, r=nnethercote