Open
Description
Using type
with local type parameters or Self
should have a clearer error.
Reproduce with: (playpen link)
struct Foo;
impl Foo {
fn method<T>(&self) {
type X = (Self, T);
}
}
Current errors have a suggestion ("try..") that doesn't apply.
error[E0401]: can't use type parameters from outer function; try using a local type parameter instead
--> <anon>:6:19
|
6 | type X = (Self, T);
| ^^^^ use of type variable from outer function
error[E0401]: can't use type parameters from outer function; try using a local type parameter instead
--> <anon>:6:25
|
6 | type X = (Self, T);
| ^ use of type variable from outer function