You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: expected identifier, found keyword `Self`
--> src/lib.rs:1:8
|
1 | fn foo<Self>() {}
| ^^^^ expected identifier, found keyword
The diagnostic itself is right but confusing; it lacks why Self is a reserved keyword (IIUC it's because Self is special-cased to represent traits or ADTs in its implementations).
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=53b02445623677643befa3e7dbe0f3b4
The current output is:
The diagnostic itself is right but confusing; it lacks why
Selfis a reserved keyword (IIUC it's becauseSelfis special-cased to represent traits or ADTs in its implementations).