Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/paths.rs')
-rw-r--r--crates/parser/src/grammar/paths.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/parser/src/grammar/paths.rs b/crates/parser/src/grammar/paths.rs
index 770827c6b0..dfe7cb57d2 100644
--- a/crates/parser/src/grammar/paths.rs
+++ b/crates/parser/src/grammar/paths.rs
@@ -89,19 +89,22 @@ fn path_segment(p: &mut Parser<'_>, mode: Mode, first: bool) -> Option<Completed
// test qual_paths
// type X = <A as B>::Output;
// fn foo() { <usize as Default>::default(); }
- if first && p.eat(T![<]) {
+ if first && p.at(T![<]) {
+ let m = p.start();
+ p.bump(T![<]);
// test_err angled_path_without_qual
// type X = <()>;
// type Y = <A as B>;
types::type_(p);
if p.eat(T![as]) {
if is_use_path_start(p) {
- types::path_type(p);
+ types::path_type_bounds(p, true);
} else {
p.error("expected a trait");
}
}
p.expect(T![>]);
+ m.complete(p, TYPE_ANCHOR);
if !p.at(T![::]) {
p.error("expected `::`");
}