summaryrefslogtreecommitdiffstats
path: root/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr
blob: a7ec192592e0d4d0deba2e4977737b38fbb8c433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
error[E0308]: mismatched types
  --> $DIR/brackets-to-braces-single-element.rs:1:24
   |
LL | const A: [&str; 1] = { "hello" };
   |                        ^^^^^^^ expected `[&str; 1]`, found `&str`
   |
help: to create an array, use square brackets instead of curly braces
   |
LL | const A: [&str; 1] = [ "hello" ];
   |                      ~         ~

error[E0308]: mismatched types
  --> $DIR/brackets-to-braces-single-element.rs:4:19
   |
LL | const B: &[u32] = &{ 1 };
   |                   ^^^^^^ expected `&[u32]`, found `&{integer}`
   |
   = note: expected reference `&'static [u32]`
              found reference `&{integer}`
help: to create an array, use square brackets instead of curly braces
   |
LL | const B: &[u32] = &[ 1 ];
   |                    ~   ~

error[E0308]: mismatched types
  --> $DIR/brackets-to-braces-single-element.rs:7:27
   |
LL | const C: &&[u32; 1] = &&{ 1 };
   |                           ^ expected `[u32; 1]`, found integer
   |
help: to create an array, use square brackets instead of curly braces
   |
LL | const C: &&[u32; 1] = &&[ 1 ];
   |                         ~   ~

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0308`.