mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
update parser to support associated const equality
This commit is contained in:
parent
bdecd9374e
commit
6580d75308
3 changed files with 119 additions and 3 deletions
|
@ -40,11 +40,19 @@ fn generic_arg(p: &mut Parser) {
|
|||
name_ref(p);
|
||||
opt_generic_arg_list(p, false);
|
||||
match p.current() {
|
||||
// test assoc_type_eq
|
||||
// type T = StreamingIterator<Item<'a> = &'a T>;
|
||||
T![=] => {
|
||||
p.bump_any();
|
||||
types::type_(p);
|
||||
if types::TYPE_FIRST.contains(p.current()) {
|
||||
// test assoc_type_eq
|
||||
// type T = StreamingIterator<Item<'a> = &'a T>;
|
||||
types::type_(p);
|
||||
} else {
|
||||
// test assoc_const_eq
|
||||
// fn foo<F: Foo<N=3>>() {}
|
||||
// const TEST: usize = 3;
|
||||
// fn bar<F: Foo<N={TEST}>>() {}
|
||||
const_arg(p);
|
||||
}
|
||||
m.complete(p, ASSOC_TYPE_ARG);
|
||||
}
|
||||
// test assoc_type_bound
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue