Skip to content

Commit

Permalink
Add ui test for unsupported use of Self
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 4, 2019
1 parent a269d7b commit a9603b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/ui/unsupported-self.rs
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() {}
5 changes: 5 additions & 0 deletions tests/ui/unsupported-self.stderr
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;
| ^^^^

0 comments on commit a9603b8

Please sign in to comment.