-
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)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
Description
Found while triaging the NLL-enabled crater run, and extracted from specs-0.10
.
#![feature(nll)]
#![allow(unused_variables)]
struct Drain<'a, T: 'a> {
_marker: ::std::marker::PhantomData<&'a T>,
}
trait Join {
type Value;
fn get(value: &mut Self::Value);
}
impl<'a, T> Join for Drain<'a, T> {
type Value = &'a mut Option<T>;
fn get<'b>(value: &'b mut Self::Value) {
}
}
fn main() {
}
Note: the added 'b
is to make the error message clearer, about a the missed relationship between 'a
and 'b
from the argument type (maybe because it is going through the associated type).
Otherwise fn get(value: &mut Self::Value)
yields this more obscure free region "'a" does not outlive free region ""
.
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.