-
Notifications
You must be signed in to change notification settings - Fork 13.2k
/
Copy pathtypo-in-repeat-expr-issue-80173.rs
70 lines (53 loc) · 1.71 KB
/
typo-in-repeat-expr-issue-80173.rs
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#[derive(Copy, Clone)]
struct Type;
struct NewType;
const fn get_size() -> usize {
10
}
fn get_dyn_size() -> usize {
10
}
fn main() {
let a = ["a", 10];
//~^ ERROR mismatched types
//~| HELP replace the comma with a semicolon to create an array
const size_b: usize = 20;
let b = [Type, size_b];
//~^ ERROR mismatched types
//~| HELP replace the comma with a semicolon to create an array
let size_c: usize = 13;
let c = [Type, size_c];
//~^ ERROR mismatched types
const size_d: bool = true;
let d = [Type, size_d];
//~^ ERROR mismatched types
let e = [String::new(), 10];
//~^ ERROR mismatched types
//~| HELP try using a conversion method
let f = ["f", get_size()];
//~^ ERROR mismatched types
//~| HELP replace the comma with a semicolon to create an array
let m = ["m", get_dyn_size()];
//~^ ERROR mismatched types
// is_vec, is_clone, is_usize_like
let g = vec![String::new(), 10];
//~^ ERROR mismatched types
//~| HELP replace the comma with a semicolon to create a vector
let dyn_size = 10;
let h = vec![Type, dyn_size];
//~^ ERROR mismatched types
//~| HELP replace the comma with a semicolon to create a vector
let i = vec![Type, get_dyn_size()];
//~^ ERROR mismatched types
//~| HELP replace the comma with a semicolon to create a vector
let k = vec!['c', 10];
//~^ ERROR mismatched types
//~| HELP replace the comma with a semicolon to create a vector
let j = vec![Type, 10_u8];
//~^ ERROR mismatched types
let l = vec![NewType, 10];
//~^ ERROR mismatched types
let byte_size: u8 = 10;
let h = vec![Type, byte_size];
//~^ ERROR mismatched types
}