Skip to content

Commit

Permalink
Add ui test for rust-lang#98938
Browse files Browse the repository at this point in the history
  • Loading branch information
obeis committed Jul 19, 2022
1 parent afaa329 commit c30bada
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/ui/traits/issue-98938.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
trait Foo {
fn bar() {}
}

fn main() {
Foo::bar();
//~^ ERROR type annotations needed

<_ as Foo>::bar();
}
9 changes: 9 additions & 0 deletions src/test/ui/traits/issue-98938.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0283]: type annotations needed
--> $DIR/issue-98938.rs:6:5
|
LL | Foo::bar();
| ^^^^^^^^ cannot call trait method as a free function

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.

0 comments on commit c30bada

Please sign in to comment.