Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upFailure to fulfill higher-kinded "outlives" predicate could have better error message #27114
Comments
steveklabnik
added
the
A-diagnostics
label
Jul 20, 2015
brson
added
T-doc
C-enhancement
E-easy
and removed
C-enhancement
labels
Jan 26, 2017
This comment has been minimized.
This comment has been minimized.
|
Message is the same today. Technically this is not hard to do. The hard part is just coming up wit hsomething better. |
This comment has been minimized.
This comment has been minimized.
|
I would say something along the lines of " @nikomatsakis or @arielb1 should be able to provide an example there ( |
This comment has been minimized.
This comment has been minimized.
|
I'm taking a look at implementing @eddyb's suggestion. Curious about the other examples mentioned, though. |
This comment has been minimized.
This comment has been minimized.
|
I've understood the code well enough to see the problem, but not enough to
What seems clear is that while terminating the higher-kinded predicate as One could try to plumb more information up along with the introduced |
This comment has been minimized.
This comment has been minimized.
|
@tschottdorf You can add an extra field to Then, a |
This comment has been minimized.
This comment has been minimized.
|
@eddyb I think I know how to go about the second part (making a special Let me see if I understand you correctly - you're proposing adding something to Whatever I pass down would have to hold the information that we synthesized a So perhaps a new pub enum ObligationCauseCode<'tcx> {
/// An obligation incurred from treating a higher-ranked trait situated at the specified Span.
HigherRankedRegion(Span) // do we need to keep a nested ObligationCauseCode here?
}
// code_to_error can now check the ObligationCauseCode if it sees a `ReStatic` bound
// and emit a custom error with both the obligation's Span (`&'b i32`) as well as the HRTB (`for<'a> T: 'a {}`).Assuming that that's reasonable (may well not be), one very practical question I have is how to get the |
This comment has been minimized.
This comment has been minimized.
|
There was a reason I said it like that, because you can change the callers of |
This comment has been minimized.
This comment has been minimized.
|
Ah, gotcha - thanks for the pointers, I'll put something together. |
steveklabnik
removed
the
T-compiler
label
Mar 9, 2017
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@tschottdorf You have a couple binaries you should not commit (run |
tbg
referenced this issue
Mar 10, 2017
Closed
wip: Better error when violating `for<'a> T: 'a` #40413
steveklabnik
added
T-compiler
and removed
T-doc
labels
Mar 22, 2017
Mark-Simulacrum
added
the
C-enhancement
label
Jul 22, 2017
Manishearth
removed
the
hacktoberfest
label
Sep 28, 2017
This comment has been minimized.
This comment has been minimized.
|
@tschottdorf Are you still working on this? |
This comment has been minimized.
This comment has been minimized.
|
No, knock yourself out! It wasn't worth doing by the time I stopped working on it, though that might've changed in the meantime. |
This comment has been minimized.
This comment has been minimized.
Ygg01
commented
Nov 27, 2018
|
Hi, is this issue still open. On Rust stable and nightly version 2015/2018 I get following message:
Is this the error the OP was suggesting? |
apasel422 commentedJul 18, 2015
Example:
Error:
It's not necessarily obvious why the type has to be
'staticin this case.