Skip to content

Commit c30bada

Browse files
committed
Add ui test for rust-lang#98938
1 parent afaa329 commit c30bada

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/test/ui/traits/issue-98938.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
trait Foo {
2+
fn bar() {}
3+
}
4+
5+
fn main() {
6+
Foo::bar();
7+
//~^ ERROR type annotations needed
8+
9+
<_ as Foo>::bar();
10+
}

src/test/ui/traits/issue-98938.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0283]: type annotations needed
2+
--> $DIR/issue-98938.rs:6:5
3+
|
4+
LL | Foo::bar();
5+
| ^^^^^^^^ cannot call trait method as a free function
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0283`.

0 commit comments

Comments
 (0)