E.g., compiling this code:
library;
struct S { }
impl S {
fn use_self() {
let _ = self.x();
}
fn x(self) -> u64 {
0
}
}
emits:
5 | impl S {
6 | fn use_self() {
7 | let _ = self.x();
| ^^^^ Identifier "self" was used as a variable, but it is actually a generic type parameter.
The error message is confusing, but aside from that, it looks like we might have a bigger issue here with injecting type parameters, because self is not a type parameter.
E.g., compiling this code:
emits:
The error message is confusing, but aside from that, it looks like we might have a bigger issue here with injecting type parameters, because
selfis not a type parameter.