2022-03-25 04:34:57 +00:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/brackets-to-braces-single-element.rs:1:24
|
|
|
|
|
|
|
|
|
LL | const A: [&str; 1] = { "hello" };
|
2023-01-03 02:00:33 +00:00
|
|
|
| ^^^^^^^ expected `[&str; 1]`, found `&str`
|
2022-03-25 04:34:57 +00:00
|
|
|
|
|
|
|
|
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 };
|
2023-01-03 02:00:33 +00:00
|
|
|
| ^^^^^^ expected `&[u32]`, found `&{integer}`
|
2022-03-25 04:34:57 +00:00
|
|
|
|
|
|
|
|
= 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 };
|
2023-01-03 02:00:33 +00:00
|
|
|
| ^ expected `[u32; 1]`, found integer
|
2022-03-25 04:34:57 +00:00
|
|
|
|
|
|
|
|
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`.
|