Closed
Description
Another regresssion of #103491 with a different failure path:
fn opaque<'a: 'a>() -> impl Sized {}
fn assert_static<T: 'static>(_: T) {}
fn test() {
let closure = |_| {
assert_static(opaque());
//~^ ERROR the opaque type may not live long enough
};
closure(&opaque());
}
#![feature(type_alias_impl_trait)]
type Opaque<'a> = impl Sized;
fn define<'a>() -> Opaque<'a> {}
fn test(_: &Opaque<'_>) {
None::<&'static Opaque<'_>>;
//~^ ERROR the opaque type may not live long enough
}
It should be fixed by ignoring non-captured lifetimes in:
cc @cjgillot
@rustbot label regression-from-stable-to-stable C-bug T-compiler T-types A-impl-trait
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Category: This is a bug.High priorityRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.