File: typo-in-repeat-expr-issue-80173.rs

package info (click to toggle)
rustc 1.87.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 925,564 kB
  • sloc: xml: 158,127; python: 36,039; javascript: 19,761; sh: 19,737; cpp: 18,981; ansic: 13,133; asm: 4,376; makefile: 710; perl: 29; lisp: 28; ruby: 19; sql: 11
file content (70 lines) | stat: -rw-r--r-- 1,749 bytes parent folder | download | duplicates (11)
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
}