-
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
Diagnostic points at entire path instead of path argument if the latter does not satisfy a trait bound #105306
Comments
…inding-obl, r=jackh726 Point at GAT `where` clause when an obligation is unsatisfied Slightly helps with rust-lang#105306
This also leads to some diagnostics getting deduplicated when they shouldn't. E.g. for |
@fmease could you provide a test for the last case you mentioned? |
trait Trait {
type P<T: Copy, U: Copy>;
}
impl Trait for () {
type P<T: Copy, U: Copy> = ();
}
fn main() {
let _: <() as Trait>::P<String, String>;
} Current output (only 1 error when it should be 2):
Expected output (2 errors with more precise spans):
|
Clearly the tracking on my PR is not correct:
|
Unfortunately, your PR didn't fix this issue for the following case: struct S<T: Copy>(T);
fn main() {
let _: S<String>;
}
It should only highlight |
@fmease thanks for filing the follow up ticket. I think that having multiple smaller (but interlinked) tickets makes it easier to keep track of the conversation and to write smaller more targeted PRs. |
Reopening for the last case. |
Edit: outstanding case:
Generic Arguments
Stderr:
Ideally, it should be:
GAT Arguments Specifically
Given the following code:
The current output is:
Ideally the output should look like:
The span is misleading because at first sight one might think that the compiler claimed that the projected type
()
ddid not implementCopy
. In this simplified case, it's quite easy to see what's going on (especially after reading the message and the label) but I bet in more complex scenarios involving several type parameters and more complicated bounds, it's much more difficult to decipher the diagnostic.The text was updated successfully, but these errors were encountered: