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

Nonsense "type parameter is not constrained" error after unresolved import #36836

Closed
bluss opened this issue Sep 29, 2016 · 1 comment · Fixed by #64108
Closed

Nonsense "type parameter is not constrained" error after unresolved import #36836

bluss opened this issue Sep 29, 2016 · 1 comment · Fixed by #64108
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bluss
Copy link
Member

bluss commented Sep 29, 2016

The second error in this snippet is "nonsense" because it says the type parameter N is not constrained, while the real error was already reported — the actual type could not be imported.

error[E0432]: unresolved import `graph::stable::StableGraph`
  --> src/visit.rs:27:5
   |
27 | use graph::stable::StableGraph;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `stable` in `graph`

error[E0207]: the type parameter `N` is not constrained by the impl trait, self type, or predicates
  --> src/visit.rs:63:10
   |
63 | impl<'a, N, E: 'a, Ty, Ix> IntoNeighbors for &'a StableGraph<N, E, Ty, Ix>
   |          ^ unconstrained type parameter

Found in: rustc 1.13.0-nightly (d0623cf 2016-09-26)

@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label Oct 7, 2016
@steveklabnik steveklabnik added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 9, 2017
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Jun 4, 2017

Still reproduces today.

trait Foo {}

impl<T> Foo for Bar<T> {}

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 26, 2017
Centril added a commit to Centril/rust that referenced this issue Sep 5, 2019
Do not complain about unconstrained params when Self is Ty Error

Fix rust-lang#36836.
@bors bors closed this as completed in 7eb65df Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants