Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type parameters checks are inconsistent and incomplete #22706

Closed
flaper87 opened this issue Feb 23, 2015 · 3 comments
Closed

Type parameters checks are inconsistent and incomplete #22706

flaper87 opened this issue Feb 23, 2015 · 3 comments
Labels
A-resolve Area: Path resolution C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@flaper87
Copy link
Contributor

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() {}
@flaper87 flaper87 added I-wrong A-resolve Area: Path resolution labels Feb 23, 2015
@steveklabnik
Copy link
Member

Triage: this still compiles.

@Mark-Simulacrum
Copy link
Member

Triage: Still compiles.

@Mark-Simulacrum
Copy link
Member

Marking as E-needstest.

error[E0109]: type parameters are not allowed on this type
 --> test.rs:1:29
  |
1 | fn is_copy<T: ::std::marker<i32>::Copy>() {}
  |                             ^^^ type parameter not allowed

error: aborting due to previous error(s)

@Mark-Simulacrum Mark-Simulacrum added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Jun 22, 2017
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed C-enhancement Category: An issue proposing an enhancement or a PR with one. I-wrong labels Jul 22, 2017
Dushistov added a commit to Dushistov/rust that referenced this issue Sep 4, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Sep 6, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Sep 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Path resolution C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

3 participants