Skip to content

*mut "uses" type params, but *const (and therefore NonNull) does not #118976

Closed
@eggyal

Description

@eggyal

Update(fmease): See #118976 (comment) and #118976 (comment).


As first mentioned on URLO, and demonstrated on quick playground:

struct Foo<T>(*mut Self); // works
struct Bar<T>(*const Self); // error[E0392]: parameter `T` is never used

Is this a bug, or is there some obscure reason for it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-varianceArea: Variance (https://doc.rust-lang.org/nomicon/subtyping.html)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions