
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>
9 lines
346 B
Text
9 lines
346 B
Text
error[E0411]: `Self` is not allowed in type aliases
|
|
--> $DIR/trait-alias-self-projection.rs:3:19
|
|
|
|
|
LL | type D = &'static dyn B;
|
|
| ^^^^^ `Self` is only available in impls, traits, and concrete type definitions
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0411`.
|