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 upTracking issue for RFC 2093: Infer `T: 'x` outlives requirements on structs #44493
Comments
aturon
added
B-RFC-approved
T-lang
labels
Sep 11, 2017
aturon
referenced this issue
Sep 11, 2017
Merged
Infer `T: 'x` outlives requirements on structs #2093
nikomatsakis
added
E-needs-mentor
WG-compiler-traits
labels
Sep 15, 2017
nikomatsakis
added this to the
impl period milestone
Sep 15, 2017
nikomatsakis
added
T-compiler
WG-compiler-middle
and removed
WG-compiler-traits
labels
Sep 15, 2017
aturon
removed this from the
impl period milestone
Sep 15, 2017
TimNN
added
the
C-tracking-issue
label
Sep 17, 2017
This comment has been minimized.
This comment has been minimized.
Mentoring instructionsIn the compiler, when we want to know what predicates are defined on something (e.g., a struct), we do that via the In terms of how to fit this inference into the compiler pipeline, then, I think we want to ensure that
The very first PR, then, could be to introduce the Now we have to figure out how to implemented
The The reason for this particular setup is that we can't infer the variances for a single item in isolation; the variance for an item X depends on the contents of the struct, and there may be cycles. Since cycles are generally forbidden between queries, we instead compute the variances for ALL structs in the crate, and then use individual queries to extract the result. So, for This crate-wide computation will work much as it is described in the RFC -- there will be a set of constraints being inferred for each struct Next, we can walk the types of the fields declared in each struct. These can be obtained by invoking Once this is done, we should have some kind of inferred set of obligations for each struct. I think it'd be good to setup a unit-testing mechanism for this similar to the one we use for variance. Basically, some custom code that looks for a So, in terms of first steps, these are good PRs to open:
|
nikomatsakis
added
E-mentor
and removed
E-needs-mentor
labels
Sep 18, 2017
This comment has been minimized.
This comment has been minimized.
|
I would like to work on this! |
toidiu
referenced this issue
Sep 19, 2017
Closed
Infer `T: 'x` outlives requirements on structs #44493 #44708
This comment has been minimized.
This comment has been minimized.
|
@toidiu hey, just checking in! I just r+'d that first PR, wondering if you'd had any time to mess around with the next few steps? |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis hey sry for the slow progress. I have have mainly been trying to wrap my head around all the different concepts and the repo structure. Have read the mentoring guide and rfc a few times now I am hoping to make some initial pr's early this week. |
toidiu
referenced this issue
Sep 26, 2017
Merged
#44493 add structure for inferred_outlives_of #44857
carols10cents
added
the
hacktoberfest
label
Sep 29, 2017
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this issue
Sep 29, 2017
bors
added a commit
that referenced
this issue
Oct 16, 2017
This comment has been minimized.
This comment has been minimized.
|
Pseudocode of how the inference wants to work, I think:
|
This comment has been minimized.
This comment has been minimized.
|
@toidiu Are you still working on this? If not, I'd be interested in taking a jab at this issue. |
This comment has been minimized.
This comment has been minimized.
|
@Yoric yea still making progress and iterating on one PR so as not to queue up bors |
steveklabnik
referenced this issue
Apr 3, 2018
Open
update the book for Infer `T: 'x` outlives requirements on structs #1279
Mark-Simulacrum
added
the
P-high
label
Aug 7, 2018
rfcbot
added
the
finished-final-comment-period
label
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Aug 9, 2018
|
The final comment period, with a disposition to merge, as per the review above, is now complete. |
rfcbot
removed
the
final-comment-period
label
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
|
Let's get this stabilized, then! There are instructions for how to do so here: https://forge.rust-lang.org/stabilization-guide.html @toidiu — you would be up for that? You've seen this thing through from start to finish thus far! |
nikomatsakis
added
E-easy
E-mentor
labels
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
|
I think we should also split off a new issue for the |
nikomatsakis
removed
the
I-nominated
label
Aug 9, 2018
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis yep would be glad to :) |
toidiu
referenced this issue
Aug 16, 2018
Closed
Bug: Outlives requirements results in ICE when we have escaping lifetimes #53419
alexcrichton
modified the milestones:
Rust 2018 Preview 2,
Edition RC 2,
Rust 2018 RC
Aug 21, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Aug 28, 2018
This comment has been minimized.
This comment has been minimized.
|
visiting for triage. PR #53793 is meant to resolve this. |
bors
added a commit
that referenced
this issue
Sep 12, 2018
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this issue
Sep 13, 2018
This comment has been minimized.
This comment has been minimized.
|
visiting for triage. #53793 landed. closing as fixed. |
pnkfelix
closed this
Sep 13, 2018
This comment has been minimized.
This comment has been minimized.
|
Created #54185 to track the |
This comment has been minimized.
This comment has been minimized.
|
#52042 already exists to track an idiom lint |
aturon commentedSep 11, 2017
•
edited by nikomatsakis
This is a tracking issue for the RFC "Infer
T: 'xoutlives requirements on structs " (rust-lang/rfcs#2093).Current status:
Implemented and we have decided to stabilize. We still need someone to make the stabilization PR! Mentoring instructions here:
https://github.com/rust-lang/rust/issue_comments#issuecomment-411781121
Until then, you can use this by adding
#![feature(infer_outlives_requirements)]to your crate.Steps:
Unresolved questions:
The interaction with
'staticremains a bit unclear. For example, do we want to infer aT: 'staticrequirement on the type parameterThere? The code currently will do so, arguably leading to confusing errors.