]> git.proxmox.com Git - rustc.git/blob - src/test/ui/macros/concat-bytes-error.rs
New upstream version 1.59.0+dfsg1
[rustc.git] / src / test / ui / macros / concat-bytes-error.rs
1 #![feature(concat_bytes)]
2
3 fn main() {
4 concat_bytes!(pie); //~ ERROR expected a byte literal
5 concat_bytes!(pie, pie); //~ ERROR expected a byte literal
6 concat_bytes!("tnrsi", "tnri"); //~ ERROR cannot concatenate string literals
7 concat_bytes!(2.8); //~ ERROR cannot concatenate float literals
8 concat_bytes!(300); //~ ERROR cannot concatenate numeric literals
9 concat_bytes!('a'); //~ ERROR cannot concatenate character literals
10 concat_bytes!(true, false); //~ ERROR cannot concatenate boolean literals
11 concat_bytes!(42, b"va", b'l'); //~ ERROR cannot concatenate numeric literals
12 concat_bytes!(42, b"va", b'l', [1, 2]); //~ ERROR cannot concatenate numeric literals
13 concat_bytes!([
14 "hi", //~ ERROR cannot concatenate string literals
15 ]);
16 concat_bytes!([
17 'a', //~ ERROR cannot concatenate character literals
18 ]);
19 concat_bytes!([
20 true, //~ ERROR cannot concatenate boolean literals
21 ]);
22 concat_bytes!([
23 false, //~ ERROR cannot concatenate boolean literals
24 ]);
25 concat_bytes!([
26 2.6, //~ ERROR cannot concatenate float literals
27 ]);
28 concat_bytes!([
29 265, //~ ERROR numeric literal is out of bounds
30 ]);
31 concat_bytes!([
32 -33, //~ ERROR expected a byte literal
33 ]);
34 concat_bytes!([
35 b"hi!", //~ ERROR cannot concatenate doubly nested array
36 ]);
37 concat_bytes!([
38 [5, 6, 7], //~ ERROR cannot concatenate doubly nested array
39 ]);
40 concat_bytes!(5u16); //~ ERROR cannot concatenate numeric literals
41 concat_bytes!([5u16]); //~ ERROR numeric literal is not a `u8`
42 concat_bytes!([3; ()]); //~ ERROR repeat count is not a positive number
43 concat_bytes!([3; -2]); //~ ERROR repeat count is not a positive number
44 concat_bytes!([pie; -2]); //~ ERROR repeat count is not a positive number
45 concat_bytes!([pie; 2]); //~ ERROR expected a byte literal
46 concat_bytes!([2.2; 0]); //~ ERROR cannot concatenate float literals
47 concat_bytes!([5.5; ()]); //~ ERROR repeat count is not a positive number
48 concat_bytes!([[1, 2, 3]; 3]); //~ ERROR cannot concatenate doubly nested array
49 concat_bytes!([[42; 2]; 3]); //~ ERROR cannot concatenate doubly nested array
50 }