]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / fn-or-tuple-struct-with-underscore-args.rs
1 fn foo(a: usize, b: usize) -> usize { a }
2
3 struct S(usize, usize);
4
5 trait T {
6     fn baz(x: usize, y: usize) -> usize { x }
7 }
8
9 fn main() {
10     let _: usize = foo(_, _);
11     //~^ ERROR `_` can only be used on the left-hand side of an assignment
12     //~| ERROR `_` can only be used on the left-hand side of an assignment
13     let _: S = S(_, _);
14     //~^ ERROR `_` can only be used on the left-hand side of an assignment
15     //~| ERROR `_` can only be used on the left-hand side of an assignment
16     let _: usize = T::baz(_, _);
17     //~^ ERROR `_` can only be used on the left-hand side of an assignment
18     //~| ERROR `_` can only be used on the left-hand side of an assignment
19 }