]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/bad-assoc-expr.rs
Auto merge of #93718 - thomcc:used-macho, r=pnkfelix
[rust.git] / src / test / ui / did_you_mean / bad-assoc-expr.rs
1 fn main() {
2     let a = [1, 2, 3, 4];
3     [i32; 4]::clone(&a);
4     //~^ ERROR missing angle brackets in associated item path
5
6     [i32]::as_ref(&a);
7     //~^ ERROR missing angle brackets in associated item path
8
9     (u8)::clone(&0);
10     //~^ ERROR missing angle brackets in associated item path
11
12     (u8, u8)::clone(&(0, 0));
13     //~^ ERROR missing angle brackets in associated item path
14
15     &(u8)::clone(&0);
16     //~^ ERROR missing angle brackets in associated item path
17
18     10 + (u8)::clone(&0);
19     //~^ ERROR missing angle brackets in associated item path
20 }
21
22 macro_rules! expr {
23     ($ty: ty) => ($ty::clone(&0))
24     //~^ ERROR missing angle brackets in associated item path
25 }
26 macro_rules! ty {
27     () => (u8)
28 }
29
30 fn check_macros() {
31     expr!(u8);
32     let _ = ty!()::clone(&0);
33     //~^ ERROR missing angle brackets in associated item path
34     ty!()::clone(&0);
35     //~^ ERROR missing angle brackets in associated item path
36 }