Skip to content

Type parameters checks are inconsistent and incomplete #22706

Description

@flaper87

The way we currently check type parameters is inconsistent and error prone. The code below compiles and it shouldn't.

The resolve phase currently ignores these checks and leaves them up to typeck, collect and check, which as demonstrated by bugs like this one and #20302 makes this check unsound.

fn is_copy<T: ::std::marker<i32>::Copy>() {}

fn main() {}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions