Repository navigation
lifetime rules are overly restricted in 1.65 nightly / beta #102029
Copy link
Copy link
Closed as not planned
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-bugCategory: This is a bug.Category: This is a bug.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Activity
@rustbot label +regression-untriaged, +regression-from-stable-to-beta +A-lifetimes
- addedA-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsregression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.regression-untriagedUntriaged performance or correctness regression.Untriaged performance or correctness regression.I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Sep 19, 2022 Indeed this was changed due to a correctness fix.
For clarity, you code can be fixed by changing
let b0 = Self::broke(b)?;tolet b0 = Foo::broke(b)?;I thought
Selfis just a syntactic sugar. Just curious how does it affect the binding of lifetime?Selfhere isFoo<'a>, whereasFooisFoo<'_>. So in the former, the closure captures the'alifetime, where in the latter, it captures some lifetime'_- removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}regression-untriagedUntriaged performance or correctness regression.Untriaged performance or correctness regression.
on Sep 20, 2022
Metadata
Metadata
Assignees
Labels
A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsC-bugCategory: This is a bug.Category: This is a bug.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
I tried this code:
The rustc in 1.63 compiles the code successfully while rustc 1.65.0-nightly (cf9ed0d 2022-09-15) fails to compile it:
Are there any changes in the language specifications that have tighten the lifetime rules?