Skip to content

1.100 beta regression: the Self constructor can only be used with tuple or unit structs #163800

Closed

Description

@mejrs

Found in #163482:

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>

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 5, 2026
  2. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 5, 2026
  3. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    on Oct 5, 2026
  4. mejrs commented on Oct 5, 2026

    @mejrs
    MemberAuthor

    Most likely #163080, cc @cyrgani @nnethercote

    The phantom macro rewrites the struct to en enum, so Self is no longer valid. that PR rewrote the macro to emit Self rather than the name of the struct, which is also re-exported by the phantom macro as an enum variant.

  5. self-assigned this
    on Oct 5, 2026
  6. added
    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically
    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
    T-langRelevant to the language team
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    and removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 5, 2026
  7. added 4 commits that reference this issue on Oct 6, 2026
  8. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 6, 2026
  9. rustbot commented on Oct 6, 2026

    @rustbot
    Collaborator

    Assigning P-high (discussion on Zulip).

  10. added 3 commits that reference this issue on Oct 7, 2026
  11. added a commit that references this issue on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamregression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions