pub enum E {
V {}
}
#[async_trait]
impl Trait for E {
async fn method(self) {
let _: () = self;
let _: Self = Self::V;
}
}
The error message points to call-site span:
error[E0533]: expected unit struct, unit variant or constant, found struct variant `#[async_trait]`
--> $DIR/self-span.rs:22:1
|
22 | #[async_trait]
| ^^^^^^^^^^^^^^
|
This PR fixes span of < and > tokens of QSelf to make the error message to point to the correct span:
error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V`
--> $DIR/self-span.rs:26:23
|
26 | let _: Self = Self::V;
| ^^^^^^^
A similar case to #102.
The following code:
The error message points to call-site span:
This PR fixes span of
<
and>
tokens ofQSelf
to make the error message to point to the correct span:(this originally caught in https://github.com/taiki-e/pin-project/pull/249. also https://github.com/serde-rs/serde/pull/1830 is already updated to include this)