Open
Description
https://rust.godbolt.org/z/fjjTxrYnh
#![feature(type_alias_impl_trait)]
struct Foo;
trait Bar {}
impl Bar for Foo {}
type Tait<'a> = impl Sized;
fn needs_bar<'a>() where Tait<'a>: Bar {
let x: Tait<'a> = Foo;
}
fn foo<'a>() -> Tait<'a> {
|| {
needs_bar();
};
Foo
}
But they also may not define the opaque, so we have to be ok w/ that too.
This example does not compile with the old solver as-well, however the old solver may have non-defining uses of the opaque in nested bodies, e.g.
pub fn defines_in_closure<'a>() -> impl Sized + 'a {
let _ = || defines_in_closure::<'a>();
}
Metadata
Metadata
Assignees
Labels
No labels