summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/issues/issue-57819.fixed
blob: 3fab21db2d06e42035df10025f16c6902264bf50 (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
39
40
41
42
43
44
45
46
47
// run-rustfix

#![allow(warnings)]

// This test checks that the following error is emitted and the suggestion works:
//
// ```
// let _ = vec![1, 2, 3].into_iter().collect::<<<Vec<usize>>();
//                                            ^^ help: remove extra angle brackets
// ```

trait Foo {
    type Output;
}

fn foo<T: Foo>() {
    // More complex cases with more than one correct leading `<` character:

    bar::<<T as Foo>::Output>();
    //~^ ERROR unmatched angle bracket

    bar::<<T as Foo>::Output>();
    //~^ ERROR unmatched angle bracket

    bar::<<T as Foo>::Output>();
    //~^ ERROR unmatched angle bracket

    bar::<<T as Foo>::Output>();
}

fn bar<T>() {}

fn main() {
    let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
    //~^ ERROR unmatched angle bracket

    let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
    //~^ ERROR unmatched angle bracket

    let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
    //~^ ERROR unmatched angle bracket

    let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
    //~^ ERROR unmatched angle bracket

    let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>();
}