-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ui test for unsupported use of Self
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use async_trait::async_trait; | ||
|
||
#[async_trait] | ||
pub trait Trait { | ||
async fn method(); | ||
} | ||
|
||
#[async_trait] | ||
impl Trait for &'static str { | ||
async fn method() { | ||
let _ = Self; | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: Self type of this impl is unsupported in expression position | ||
--> $DIR/unsupported-self.rs:11:17 | ||
| | ||
11 | let _ = Self; | ||
| ^^^^ |