Skip to content

Using Self when initializing a tuple struct #47085

Closed
@U007D

Description

@U007D

https://internals.rust-lang.org/t/initialization-syntax-for-self-tuple-structs/5389/5 talks about this problem. But the solution (using the typename, rather than Self) isn't discussed anywhere (that I could find).

Could a helpful compiler message be added (until the problem is fixed)? Something to the effect of
"Use of Self when initializing a tuple struct is not currently supported. Please try <typename>(...) instead." (where code following 'Please try' is the user's code with Self replaced with the struct's typename).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions