mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
fix: move use
parsing to outer match arm
This commit is contained in:
parent
e4941c0c73
commit
4a91453409
2 changed files with 19 additions and 18 deletions
|
@ -144,6 +144,12 @@ fn type_bound(p: &mut Parser<'_>) -> bool {
|
||||||
match p.current() {
|
match p.current() {
|
||||||
LIFETIME_IDENT => lifetime(p),
|
LIFETIME_IDENT => lifetime(p),
|
||||||
T![for] => types::for_type(p, false),
|
T![for] => types::for_type(p, false),
|
||||||
|
// test precise_capturing
|
||||||
|
// fn captures<'a: 'a, 'b: 'b, T>() -> impl Sized + use<'b, T> {}
|
||||||
|
T![use] => {
|
||||||
|
p.bump_any();
|
||||||
|
generic_param_list(p)
|
||||||
|
}
|
||||||
T![?] if p.nth_at(1, T![for]) => {
|
T![?] if p.nth_at(1, T![for]) => {
|
||||||
// test question_for_type_trait_bound
|
// test question_for_type_trait_bound
|
||||||
// fn f<T>() where T: ?for<> Sized {}
|
// fn f<T>() where T: ?for<> Sized {}
|
||||||
|
@ -167,12 +173,6 @@ fn type_bound(p: &mut Parser<'_>) -> bool {
|
||||||
T![async] => {
|
T![async] => {
|
||||||
p.bump_any();
|
p.bump_any();
|
||||||
}
|
}
|
||||||
// test precise_capturing
|
|
||||||
// fn captures<'a: 'a, 'b: 'b, T>() -> impl Sized + use<'b, T> {}
|
|
||||||
T![use] => {
|
|
||||||
p.bump_any();
|
|
||||||
generic_param_list(p);
|
|
||||||
}
|
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
if paths::is_use_path_start(p) {
|
if paths::is_use_path_start(p) {
|
||||||
|
|
|
@ -48,6 +48,7 @@ SOURCE_FILE
|
||||||
WHITESPACE " "
|
WHITESPACE " "
|
||||||
PLUS "+"
|
PLUS "+"
|
||||||
WHITESPACE " "
|
WHITESPACE " "
|
||||||
|
TYPE_BOUND
|
||||||
USE_KW "use"
|
USE_KW "use"
|
||||||
GENERIC_PARAM_LIST
|
GENERIC_PARAM_LIST
|
||||||
L_ANGLE "<"
|
L_ANGLE "<"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue