-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Incorrect coherence diagnostic #55752
Comments
This could be fixed by changing the wording to "the impl does not reference only types defined in this crate" either only for cases like this if easy, or always. |
I would like to give this a try. I haven't worked on this repo before so if possible I would appreciate some guidance. |
@lbrande the code to change is the note at rust/src/librustc_typeck/coherence/orphan.rs Lines 47 to 55 in 25a42b2
The simplest change will be to just change the wording unconditionally to "the impl does not reference only types defined in this crate". The other option is to look at the following method rust/src/librustc/traits/coherence.rs Lines 254 to 390 in 25a42b2
and come up with a further check for this case and new variant on Ideally we could produce output like the following, by keeping the
but I feel the added complexity in the implementation isn't as useful, and we might be better served with just improving the wording. I'm looking at the second edition of the book, and this is the explanation there:
For information on how to build and debug |
Thanks, will try to get things set up later today. |
Another possible output (which might be easier to accomplish) could be:
|
…varkor Improve the wording I'm sorry but re-opened the PR because I failed to squash commits(rust-lang#57397). Fixes rust-lang#55752. r? @varkor
…varkor Improve the wording I'm sorry but re-opened the PR because I failed to squash commits(rust-lang#57397). Fixes rust-lang#55752. r? @varkor
(Playground)
Errors:
This is incorrect because the error message states:
but the
impl
does reference one type defined in this crate:MyError
.The text was updated successfully, but these errors were encountered: