914d142c02
This commit extends the trailing `>` detection to also work for paths such as `Foo::<Bar>>:Baz`. This involves making the existing check take the token that is expected to follow the path being checked as a parameter. Care is taken to ensure that this only happens on the construction of a whole path segment and not a partial path segment (during recursion). Through this enhancement, it was also observed that the ordering of right shift token and greater than tokens was overfitted to the examples being tested. In practice, given a sequence of `>` characters: `>>>>>>>>>` ..then they will be split into `>>` eagerly: `>> >> >> >> >`. ..but when a `<` is prepended, then the first `>>` is split: `<T> > >> >> >> >` ..and then when another `<` is prepended, a right shift is first again: `Vec<<T>> >> >> >> >` In the previous commits, a example that had two `<<` characters was always used and therefore it was incorrectly assumed that `>>` would always be first - but when there is a single `<`, this is not the case.
27 lines
756 B
Plaintext
27 lines
756 B
Plaintext
error: unmatched angle brackets
|
|
--> $DIR/issue-54521-2.rs:11:25
|
|
|
|
|
LL | let _ = Vec::<usize>>>>>::new();
|
|
| ^^^^ help: remove extra angle brackets
|
|
|
|
error: unmatched angle brackets
|
|
--> $DIR/issue-54521-2.rs:14:25
|
|
|
|
|
LL | let _ = Vec::<usize>>>>::new();
|
|
| ^^^ help: remove extra angle brackets
|
|
|
|
error: unmatched angle brackets
|
|
--> $DIR/issue-54521-2.rs:17:25
|
|
|
|
|
LL | let _ = Vec::<usize>>>::new();
|
|
| ^^ help: remove extra angle brackets
|
|
|
|
error: unmatched angle bracket
|
|
--> $DIR/issue-54521-2.rs:20:25
|
|
|
|
|
LL | let _ = Vec::<usize>>::new();
|
|
| ^ help: remove extra angle bracket
|
|
|
|
error: aborting due to 4 previous errors
|
|
|