mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Fix for<'lifetime> for types specified by path
This commit is contained in:
parent
e3f8e6023d
commit
f1e62501c3
3 changed files with 85 additions and 2 deletions
|
@ -205,6 +205,7 @@ pub(super) fn for_binder(p: &mut Parser) {
|
|||
// type A = for<'a> fn() -> ();
|
||||
// fn foo<T>(_t: &T) where for<'a> &'a T: Iterator {}
|
||||
// fn bar<T>(_t: &T) where for<'a> &'a mut T: Iterator {}
|
||||
// fn baz<T>(_t: &T) where for<'a> <&'a T as Baz>::Foo: Iterator {}
|
||||
pub(super) fn for_type(p: &mut Parser) {
|
||||
assert!(p.at(T![for]));
|
||||
let m = p.start();
|
||||
|
@ -212,7 +213,7 @@ pub(super) fn for_type(p: &mut Parser) {
|
|||
match p.current() {
|
||||
T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p),
|
||||
T![&] => reference_type(p),
|
||||
_ if paths::is_path_start(p) => path_type_(p, false),
|
||||
_ if paths::is_path_start(p) || p.at(T![<]) => path_type_(p, false),
|
||||
_ => p.error("expected a path"),
|
||||
}
|
||||
m.complete(p, FOR_TYPE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue