mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
minor: better test placement
This commit is contained in:
parent
2195ecd7e7
commit
46326b8db7
1 changed files with 6 additions and 7 deletions
|
@ -148,14 +148,13 @@ pub(super) fn opt_item(p: &mut Parser, m: Marker) -> Result<(), Marker> {
|
||||||
// impl T for Foo {
|
// impl T for Foo {
|
||||||
// default async fn foo() {}
|
// default async fn foo() {}
|
||||||
// }
|
// }
|
||||||
|
T![async] => {
|
||||||
|
let mut maybe_fn = p.nth(2);
|
||||||
|
let is_unsafe = if matches!(maybe_fn, T![unsafe]) {
|
||||||
// test default_async_unsafe_fn
|
// test default_async_unsafe_fn
|
||||||
// impl T for Foo {
|
// impl T for Foo {
|
||||||
// default async unsafe fn foo() {}
|
// default async unsafe fn foo() {}
|
||||||
// }
|
// }
|
||||||
T![async] => {
|
|
||||||
let mut maybe_fn = p.nth(2);
|
|
||||||
let is_unsafe = if matches!(maybe_fn, T![unsafe]) {
|
|
||||||
maybe_fn = p.nth(3);
|
maybe_fn = p.nth(3);
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
|
@ -400,9 +399,9 @@ fn fn_(p: &mut Parser, m: Marker) {
|
||||||
// fn foo<T>() where T: Copy {}
|
// fn foo<T>() where T: Copy {}
|
||||||
type_params::opt_where_clause(p);
|
type_params::opt_where_clause(p);
|
||||||
|
|
||||||
|
if p.at(T![;]) {
|
||||||
// test fn_decl
|
// test fn_decl
|
||||||
// trait T { fn foo(); }
|
// trait T { fn foo(); }
|
||||||
if p.at(T![;]) {
|
|
||||||
p.bump(T![;]);
|
p.bump(T![;]);
|
||||||
} else {
|
} else {
|
||||||
expressions::block_expr(p)
|
expressions::block_expr(p)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue