Uh oh!
There was an error while loading. Please reload this page.
Add more context to E0599 errors - #69255
Conversation
rust-highfive
commented
Feb 18, 2020
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
At least we're tracking the underlying issue now :o)
There was a problem hiding this comment.
TODO: we should determine whether the implementing trait is in scope. If it isn't, suggest importing it. If it is, check whether the found adt implements it directly but the bounds weren't fulfilled. If not, suggest implementing it.
Uh oh!
There was an error while loading. Please reload this page.
estebank
commented
Feb 20, 2020
This PR now accounts for arbitrary self types when reporting E0599, but it doesn't help when the trait definition is not crate local. The suggestion to constrain type parameters is not as good as I would wish (it should suggest constraining the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
I think this should go before both the struct and trait above
There was a problem hiding this comment.
This looks really, really good!
My only critique is that the two notes (one on the span, one outside) are redundant.
There was a problem hiding this comment.
Great! And I forgot to say again that I think the order of the spans ought to be reversed :)
This comment has been minimized.
This comment has been minimized.
| = note: the method `foo` exists but the following trait bounds were not satisfied: | ||
| `T: std::default::Default` | ||
| which is required by `Fin<T>: Bar` | ||
| help: consider restricting the type parameter to satisfy the obligation |
There was a problem hiding this comment.
consider rewording obligations to requirements(or a better alternative)? as obligation isn't a common term outside the internal rustc.
ps. a google search result
There was a problem hiding this comment.
What about "consider restricting the type parameter to satisfy the trait bound"?
| pub fn borrow_nested_obligations(&self) -> &[N] { | ||
| match &self { | ||
| VtableImpl(i) => &i.nested[..], |
There was a problem hiding this comment.
Huh, these are unpleasant variant names.
varkor
commented
Feb 27, 2020
@bors r+ |
bors
commented
Feb 27, 2020
📌 Commit c02e56a has been approved by |
Add more context to E0599 errors Point at the intermediary unfulfilled trait bounds. Fixrust-lang#52523, fixrust-lang#61661, cc rust-lang#36513, fixrust-lang#68131, fixrust-lang#64417, fixrust-lang#61768, cc rust-lang#57457, cc rust-lang#9082, fixrust-lang#57994, cc rust-lang#64934, cc rust-lang#65149.
Rollup of 8 pull requests Successful merges: - #60826 (Implement new gdb/lldb pretty-printers) - #69255 (Add more context to E0599 errors) - #69379 (Fail on multiple declarations of `main`.) - #69430 (librustc_typeck: remove loop that never actually loops) - #69449 (Do not ping PR reviewers in toolstate breakage) - #69491 (rustc_span: Add `Symbol::to_ident_string` for use in diagnostic messages) - #69495 (don't take redundant references to operands) - #69496 (use find(x) instead of filter(x).next()) Failed merges: r? @ghost
Add more context to E0599 errors Point at the intermediary unfulfilled trait bounds. Fixrust-lang#52523, fixrust-lang#61661, cc rust-lang#36513, fixrust-lang#68131, fixrust-lang#64417, fixrust-lang#61768, cc rust-lang#57457, cc rust-lang#9082, fixrust-lang#57994, cc rust-lang#64934, cc rust-lang#65149.
JohnTitor
commented
Feb 28, 2020
Failed in #69543 (comment) |
estebank
commented
Feb 28, 2020
@bors r=varkor rollup=never |
bors
commented
Feb 28, 2020
📌 Commit 2fb35ad has been approved by |
Dylan-DPC-zz
commented
Feb 29, 2020
@bors p=1 |
bors
commented
Feb 29, 2020
bors
commented
Feb 29, 2020
☀️ Test successful - checks-azure |
jonhoo
commented
Mar 3, 2020
This appears to have caused a regression: |


Point at the intermediary unfulfilled trait bounds.
Fix#52523, fix#61661, cc #36513, fix#68131, fix#64417, fix#61768, cc #57457, cc #9082, fix#57994, cc #64934, cc #65149.