-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.fixed-by-NLLBugs fixed, but only when NLL is enabled.Bugs fixed, but only when NLL is enabled.
Description
Spawned off of #21022, #21972; see also #21657.
Tracking order of destruction for r-value temporaries would (probably) allow us to resume writing code like this from RFC 769:
for line in old_io::stdin().lock().lines() {
...
}
which is currently disallowed because the region inference system does not know that the temporary yielded by stdin()
will outlive the temporary from stdin().lock()
.
(But note that it might also have fallout, potentially worse than that of #21657)
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.fixed-by-NLLBugs fixed, but only when NLL is enabled.Bugs fixed, but only when NLL is enabled.