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 upsubtask of RFC 195: implement associated lifetimes #17842
Comments
aturon
added
the
I-nominated
label
Oct 9, 2014
This comment has been minimized.
This comment has been minimized.
|
To be clear, there's a P-backcompat-lang issue here: the design intends that lifetimes cannot be used in input position, only in output (associated item) position. The rationale is that the arguments to a trait are used to drive dispatch; each different set of instantiations can provide a distinct implementation for the same I would say this is P-backcompat-lang, but not necessarily 1.0 -- but we should discuss. |
aturon
referenced this issue
Oct 9, 2014
Closed
identify traits in libstd that should use associated lifetimes #17828
This comment has been minimized.
This comment has been minimized.
|
Assigning P-high, not 1.0. |
pnkfelix
added
P-medium
and removed
I-nominated
labels
Oct 9, 2014
This comment has been minimized.
This comment has been minimized.
Shouldn't we at least reserve the |
This comment has been minimized.
This comment has been minimized.
|
Is there any plan to move forward on this? It doesn't appear that the |
This comment has been minimized.
This comment has been minimized.
|
@apasel422 I don't know of any concrete plans, though a PR would be welcome. In terms of keyword reservation, this can likely be handled via "contextual keywords". |
This comment has been minimized.
This comment has been minimized.
|
@aturon Thanks. Do you know how associated lifetimes will be referenced? The RFC doesn't appear to depict that syntax. trait Foo {
lifetime b; // or is this supposed to be `lifetime 'b;`?
fn foo(&'Self::b self); // unsure if this is correct
} |
This comment has been minimized.
This comment has been minimized.
|
@apasel422 You're right -- the RFC is incomplete on these points. I suspect we'd want a |
This comment has been minimized.
This comment has been minimized.
|
By the way, this issue should be renamed to "subtask of RFC 195", not 59. |
apasel422
referenced this issue
Jul 27, 2015
Open
Amend RFC #195 to clarify associated lifetime syntax #1225
pnkfelix
changed the title
subtask of RFC 59: implement associated lifetimes
subtask of RFC 195: implement associated lifetimes
Mar 25, 2016
This comment has been minimized.
This comment has been minimized.
|
Is this ever going to happen? P-low? Should this be B-RFC-approved to indicate that it's for completion of an RFC? |
nikomatsakis
added
T-lang
and removed
T-compiler
labels
Oct 20, 2016
This comment has been minimized.
This comment has been minimized.
|
Switching over to lang team; my feeling is that I'd like this to happen, but I also sort of feel like a fresh RFC might be a good idea. Certainly I want this regularly when I have some "meta-parameterization" that is just a bundle of associated types (e.g., |
This comment has been minimized.
This comment has been minimized.
|
I know @pnkfelix and I have also talked about uses for this. |
This comment has been minimized.
This comment has been minimized.
|
Anyway, P-low for sure. triage: P-low |
rust-highfive
added
P-low
and removed
P-medium
I-nominated
labels
Oct 20, 2016
nikomatsakis
added
the
I-nominated
label
Oct 20, 2016
This comment has been minimized.
This comment has been minimized.
|
But I'll leave as nominated to discuss question of whether to have a new RFC. |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Why do you think a fresh RFC is needed? Offhand it doesn't seem like there's a ton of wiggle room in the design space; the feature has just never been high enough priority to bother implementing it. |
This comment has been minimized.
This comment has been minimized.
|
@aturon well, for example, the existing RFC gives zero examples of using an associated lifetime; based on a quick read, I didn't see an obvious syntax for how you name such a lifetime (is it |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis Got it, thanks. Given those gaps, I'd be fine closing this out and requiring a fresh RFC to flesh it out and motivate it more substantially. |
nikomatsakis
removed
the
I-nominated
label
Nov 3, 2016
This comment has been minimized.
This comment has been minimized.
|
Closing because it needs an RFC. |
pnkfelix commentedOct 7, 2014
As a subtask of #17307, we want to implement associated lifetimes at some point.
This blocks the code revisions implied by #17828.
@aturon notes here that this may block 1.0; or at least, we certainly cannot mark libraries associated with #17828 as
stable, so the real question is whether such library types need to be stable for 1.0.