mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Separating parsing of for
in predicates and types
This commit is contained in:
parent
560b98bc50
commit
506e1ddbfa
12 changed files with 507 additions and 291 deletions
|
@ -285,6 +285,8 @@ where
|
|||
let pred = predicates.next().unwrap();
|
||||
let mut bounds = pred.type_bound_list().unwrap().bounds();
|
||||
|
||||
assert!(pred.for_token().is_none());
|
||||
assert!(pred.type_param_list().is_none());
|
||||
assert_eq!("T", pred.type_ref().unwrap().syntax().text().to_string());
|
||||
assert_bound("Clone", bounds.next());
|
||||
assert_bound("Copy", bounds.next());
|
||||
|
@ -322,6 +324,8 @@ where
|
|||
let pred = predicates.next().unwrap();
|
||||
let mut bounds = pred.type_bound_list().unwrap().bounds();
|
||||
|
||||
assert_eq!("for<'a> F", pred.type_ref().unwrap().syntax().text().to_string());
|
||||
assert!(pred.for_token().is_some());
|
||||
assert_eq!("<'a>", pred.type_param_list().unwrap().syntax().text().to_string());
|
||||
assert_eq!("F", pred.type_ref().unwrap().syntax().text().to_string());
|
||||
assert_bound("Fn(&'a str)", bounds.next());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue