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

Unhelpful error message for specialization-related type projection failures. #33481

Open
rphmeier opened this issue May 7, 2016 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. F-specialization `#![feature(specialization)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented May 7, 2016

Playground: http://is.gd/QMg2a8

@rphmeier
Copy link
Contributor Author

rphmeier commented May 7, 2016

Maybe related to this comment: https://github.com/rust-lang/rust/blob/ffca6c3e/src/librustc/traits/project.rs#L71 and #32205?

edit: definitely related to the comment: http://is.gd/Qjh6tB

@rphmeier
Copy link
Contributor Author

rphmeier commented May 7, 2016

seems that this is by design? if so, there should be an error indicative of it.

@rphmeier rphmeier changed the title Failure to normalize associated type on default impl Unhelpful error message for specialization-related type projection failures. May 12, 2016
@apasel422 apasel422 added the A-diagnostics Area: Messages for errors, warnings, and lints label Jun 17, 2016
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 25, 2017
@crlf0710 crlf0710 added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 11, 2020
@estebank
Copy link
Contributor

Current output:

error[E0271]: type mismatch resolving `<(i32, f32) as Sameness>::Same == False`
  --> src/main.rs:49:5
   |
40 | fn not_same<A, B>() where (A, B): NotSame {}
   |                                   ------- required by this bound in `not_same`
...
49 |     not_same::<i32, f32>();
   |     ^^^^^^^^^^^^^^^^^^^^ expected associated type, found struct `False`
   |
   = note: expected associated type `<(i32, f32) as Sameness>::Same`
                       found struct `False`
   = help: consider constraining the associated type `<(i32, f32) as Sameness>::Same` to `False` or calling a method that returns `<(i32, f32) as Sameness>::Same`
   = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
   = note: required because of the requirements on the impl of `NotSame` for `(i32, f32)`

@matthewjasper matthewjasper added the F-specialization `#![feature(specialization)]` label Apr 19, 2024
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-enhancement Category: An issue proposing an enhancement or a PR with one. F-specialization `#![feature(specialization)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants