]> git.lizzy.rs Git - rust.git/blob - src/test/ui/anon-params/anon-params-denied-2018.rs
Auto merge of #93718 - thomcc:used-macho, r=pnkfelix
[rust.git] / src / test / ui / anon-params / anon-params-denied-2018.rs
1 // Tests that anonymous parameters are a hard error in edition 2018.
2
3 // edition:2018
4
5 trait T {
6     fn foo(i32); //~ expected one of `:`, `@`, or `|`, found `)`
7
8     // Also checks with `&`
9     fn foo_with_ref(&mut i32);
10     //~^ ERROR expected one of `:`, `@`, or `|`, found `)`
11
12     fn foo_with_qualified_path(<Bar as T>::Baz);
13     //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
14
15     fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz);
16     //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
17
18     fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
19     //~^ ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
20     //~| ERROR expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
21
22     fn bar_with_default_impl(String, String) {}
23     //~^ ERROR expected one of `:`
24     //~| ERROR expected one of `:`
25
26     // do not complain about missing `b`
27     fn baz(a:usize, b, c: usize) -> usize { //~ ERROR expected one of `:`
28         a + b + c
29     }
30 }
31
32 fn main() {}