]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/fn-or-tuple-struct-with-underscore-args.rs
Add underscore expressions for destructuring assignments
[rust.git] / src / test / 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     //~| ERROR destructuring assignments are unstable
14     //~| ERROR destructuring assignments are unstable
15     let _: S = S(_, _);
16     //~^ ERROR `_` can only be used on the left-hand side of an assignment
17     //~| ERROR `_` can only be used on the left-hand side of an assignment
18     //~| ERROR destructuring assignments are unstable
19     //~| ERROR destructuring assignments are unstable
20     let _: usize = T::baz(_, _);
21     //~^ ERROR `_` can only be used on the left-hand side of an assignment
22     //~| ERROR `_` can only be used on the left-hand side of an assignment
23     //~| ERROR destructuring assignments are unstable
24     //~| ERROR destructuring assignments are unstable
25 }