We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afaa329 commit c30badaCopy full SHA for c30bada
src/test/ui/traits/issue-98938.rs
@@ -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
@@ -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 commit comments