
Fixes #139082. Emits an error when `Self` is found in the projection bounds of a trait object. In type aliases, `Self` has no meaning, so `type A = &'static dyn B` where `trait B = Fn() -> Self` will expands to `type A = &'static Fn() -> Self` which is illegal, causing the region solver to bail out when hitting the uninferred Self. Bug: #139082 Signed-off-by: xtex <xtexchooser@duck.com>
12 lines
156 B
Rust
12 lines
156 B
Rust
#![feature(trait_alias)]
|
|
trait B = Fn() -> Self;
|
|
type D = &'static dyn B;
|
|
//~^ ERROR E0411
|
|
|
|
fn a() -> D {
|
|
unreachable!();
|
|
}
|
|
|
|
fn main() {
|
|
_ = a();
|
|
}
|