Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up🔬 Tracking issue for RFC 2089: Implied bounds #44491
Comments
aturon
added
B-RFC-approved
T-lang
labels
Sep 11, 2017
nikomatsakis
added
WG-compiler-traits
E-needs-mentor
T-compiler
labels
Sep 15, 2017
TimNN
added
the
C-tracking-issue
label
Sep 17, 2017
This comment has been minimized.
This comment has been minimized.
|
I have a question not covered in the RFC (that not necessarily has to be part of the RFC): what will error reporting on bounds violations look like? Will it point to the original definition of the bound? |
This comment has been minimized.
This comment has been minimized.
|
I'm not part of this, but I'll summarize what appears to be the current state of this feature from what I can find: This tracking issue was posted shortly before the 2017 impl period began, and it looks like it fell under the scope of the WG-compiler-traits workgroup. On the workgroup's dropbox doc I see (under Query model):
I searched the issue tracker for recent issues/PRs about bound cycles or the query model, but nothing stood out. |
nikomatsakis
changed the title
Tracking issue for RFC 2089: Implied bounds
🔬 Tracking issue for RFC 2089: Implied bounds
Feb 25, 2018
steveklabnik
referenced this issue
Apr 3, 2018
Open
Update the book to include info about implied bounds #1285
leodasvacas
referenced this issue
May 16, 2018
Open
rustc: trait-level where clauses are mistakenly imposed when bounding by the trait #50792
This comment has been minimized.
This comment has been minimized.
Laaas
commented
Jun 10, 2018
|
Is this ready for being implemented? And if so, could I get some mentoring instructions? |
This comment has been minimized.
This comment has been minimized.
|
Sorry, it seems like this issue has been remaining silent for a long time!
We would definitely appreciate contributions for this second point, which may eventually enable really cool features in rustc like implied bounds, generic associated types and more generally better type inference. See you on the Zulip stream! |
This comment has been minimized.
This comment has been minimized.
|
I don't know if this is feasible, but if it is, I think it'd be a nice restriction, so wanted to record it for future consideration: I think this feature is great for direct uses, but weird for "sideways" uses. To try a concrete example: // in a world where `struct HashSet<T: Hash+Eq>`...
fn foo<T>(s: &mut HashSet<T>, a: T, b: T) -> bool {
let r = a == b; // not allowed, because _this_ method doesn't know T: PartialEq
s.insert(a); // allowed, because the method's `Self` type is HashSet, where we always know Hash+eq
r
}I think that would keep the core "look, I'm calling a hashset method, so obviously it's Hash+Eq; I shouldn't need to say so again" but still wouldn't let you directly call things on traits that you never mentioned. (I do, however, think that in that world, |
aturon commentedSep 11, 2017
This is a tracking issue for the RFC "Implied bounds" (rust-lang/rfcs#2089).
Steps:
Unresolved questions: