mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
move inline function closer to relevant code
also updates generated inline tests
This commit is contained in:
parent
c78e34968f
commit
f077d5c303
@ -535,15 +535,15 @@ fn cast_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
||||
m.complete(p, CAST_EXPR)
|
||||
}
|
||||
|
||||
// test arg_with_attr
|
||||
// fn main() {
|
||||
// foo(#[attr] 92)
|
||||
// }
|
||||
fn arg_list(p: &mut Parser) {
|
||||
assert!(p.at(T!['(']));
|
||||
let m = p.start();
|
||||
p.bump(T!['(']);
|
||||
while !p.at(T![')']) && !p.at(EOF) {
|
||||
// test arg_with_attr
|
||||
// fn main() {
|
||||
// foo(#[attr] 92)
|
||||
// }
|
||||
attributes::outer_attributes(p);
|
||||
if !p.at_ts(EXPR_FIRST) {
|
||||
p.error("expected expression");
|
||||
|
@ -1,9 +0,0 @@
|
||||
fn assert_float(s: &str, n: f64) {}
|
||||
fn foo() {
|
||||
assert_float(
|
||||
"1.797693134862315708e+308L",
|
||||
#[allow(clippy::excessive_precision)]
|
||||
#[allow(dead_code)]
|
||||
1.797_693_134_862_315_730_8e+308,
|
||||
);
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
SOURCE_FILE@[0; 228)
|
||||
FN_DEF@[0; 35)
|
||||
FN_KW@[0; 2) "fn"
|
||||
WHITESPACE@[2; 3) " "
|
||||
NAME@[3; 15)
|
||||
IDENT@[3; 15) "assert_float"
|
||||
PARAM_LIST@[15; 32)
|
||||
L_PAREN@[15; 16) "("
|
||||
PARAM@[16; 23)
|
||||
BIND_PAT@[16; 17)
|
||||
NAME@[16; 17)
|
||||
IDENT@[16; 17) "s"
|
||||
COLON@[17; 18) ":"
|
||||
WHITESPACE@[18; 19) " "
|
||||
REFERENCE_TYPE@[19; 23)
|
||||
AMP@[19; 20) "&"
|
||||
PATH_TYPE@[20; 23)
|
||||
PATH@[20; 23)
|
||||
PATH_SEGMENT@[20; 23)
|
||||
NAME_REF@[20; 23)
|
||||
IDENT@[20; 23) "str"
|
||||
COMMA@[23; 24) ","
|
||||
WHITESPACE@[24; 25) " "
|
||||
PARAM@[25; 31)
|
||||
BIND_PAT@[25; 26)
|
||||
NAME@[25; 26)
|
||||
IDENT@[25; 26) "n"
|
||||
COLON@[26; 27) ":"
|
||||
WHITESPACE@[27; 28) " "
|
||||
PATH_TYPE@[28; 31)
|
||||
PATH@[28; 31)
|
||||
PATH_SEGMENT@[28; 31)
|
||||
NAME_REF@[28; 31)
|
||||
IDENT@[28; 31) "f64"
|
||||
R_PAREN@[31; 32) ")"
|
||||
WHITESPACE@[32; 33) " "
|
||||
BLOCK_EXPR@[33; 35)
|
||||
BLOCK@[33; 35)
|
||||
L_CURLY@[33; 34) "{"
|
||||
R_CURLY@[34; 35) "}"
|
||||
WHITESPACE@[35; 36) "\n"
|
||||
FN_DEF@[36; 227)
|
||||
FN_KW@[36; 38) "fn"
|
||||
WHITESPACE@[38; 39) " "
|
||||
NAME@[39; 42)
|
||||
IDENT@[39; 42) "foo"
|
||||
PARAM_LIST@[42; 44)
|
||||
L_PAREN@[42; 43) "("
|
||||
R_PAREN@[43; 44) ")"
|
||||
WHITESPACE@[44; 45) " "
|
||||
BLOCK_EXPR@[45; 227)
|
||||
BLOCK@[45; 227)
|
||||
L_CURLY@[45; 46) "{"
|
||||
WHITESPACE@[46; 51) "\n "
|
||||
EXPR_STMT@[51; 225)
|
||||
CALL_EXPR@[51; 224)
|
||||
PATH_EXPR@[51; 63)
|
||||
PATH@[51; 63)
|
||||
PATH_SEGMENT@[51; 63)
|
||||
NAME_REF@[51; 63)
|
||||
IDENT@[51; 63) "assert_float"
|
||||
ARG_LIST@[63; 224)
|
||||
L_PAREN@[63; 64) "("
|
||||
WHITESPACE@[64; 73) "\n "
|
||||
LITERAL@[73; 101)
|
||||
STRING@[73; 101) "\"1.797693134862315708 ..."
|
||||
COMMA@[101; 102) ","
|
||||
WHITESPACE@[102; 111) "\n "
|
||||
ATTR@[111; 148)
|
||||
POUND@[111; 112) "#"
|
||||
L_BRACK@[112; 113) "["
|
||||
PATH@[113; 118)
|
||||
PATH_SEGMENT@[113; 118)
|
||||
NAME_REF@[113; 118)
|
||||
IDENT@[113; 118) "allow"
|
||||
TOKEN_TREE@[118; 147)
|
||||
L_PAREN@[118; 119) "("
|
||||
IDENT@[119; 125) "clippy"
|
||||
COLON@[125; 126) ":"
|
||||
COLON@[126; 127) ":"
|
||||
IDENT@[127; 146) "excessive_precision"
|
||||
R_PAREN@[146; 147) ")"
|
||||
R_BRACK@[147; 148) "]"
|
||||
WHITESPACE@[148; 157) "\n "
|
||||
ATTR@[157; 176)
|
||||
POUND@[157; 158) "#"
|
||||
L_BRACK@[158; 159) "["
|
||||
PATH@[159; 164)
|
||||
PATH_SEGMENT@[159; 164)
|
||||
NAME_REF@[159; 164)
|
||||
IDENT@[159; 164) "allow"
|
||||
TOKEN_TREE@[164; 175)
|
||||
L_PAREN@[164; 165) "("
|
||||
IDENT@[165; 174) "dead_code"
|
||||
R_PAREN@[174; 175) ")"
|
||||
R_BRACK@[175; 176) "]"
|
||||
WHITESPACE@[176; 185) "\n "
|
||||
LITERAL@[185; 217)
|
||||
FLOAT_NUMBER@[185; 217) "1.797_693_134_862_315 ..."
|
||||
COMMA@[217; 218) ","
|
||||
WHITESPACE@[218; 223) "\n "
|
||||
R_PAREN@[223; 224) ")"
|
||||
SEMI@[224; 225) ";"
|
||||
WHITESPACE@[225; 226) "\n"
|
||||
R_CURLY@[226; 227) "}"
|
||||
WHITESPACE@[227; 228) "\n"
|
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
foo(#[attr] 92)
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
SOURCE_FILE@[0; 34)
|
||||
FN_DEF@[0; 33)
|
||||
FN_KW@[0; 2) "fn"
|
||||
WHITESPACE@[2; 3) " "
|
||||
NAME@[3; 7)
|
||||
IDENT@[3; 7) "main"
|
||||
PARAM_LIST@[7; 9)
|
||||
L_PAREN@[7; 8) "("
|
||||
R_PAREN@[8; 9) ")"
|
||||
WHITESPACE@[9; 10) " "
|
||||
BLOCK_EXPR@[10; 33)
|
||||
BLOCK@[10; 33)
|
||||
L_CURLY@[10; 11) "{"
|
||||
WHITESPACE@[11; 16) "\n "
|
||||
CALL_EXPR@[16; 31)
|
||||
PATH_EXPR@[16; 19)
|
||||
PATH@[16; 19)
|
||||
PATH_SEGMENT@[16; 19)
|
||||
NAME_REF@[16; 19)
|
||||
IDENT@[16; 19) "foo"
|
||||
ARG_LIST@[19; 31)
|
||||
L_PAREN@[19; 20) "("
|
||||
ATTR@[20; 27)
|
||||
POUND@[20; 21) "#"
|
||||
L_BRACK@[21; 22) "["
|
||||
PATH@[22; 26)
|
||||
PATH_SEGMENT@[22; 26)
|
||||
NAME_REF@[22; 26)
|
||||
IDENT@[22; 26) "attr"
|
||||
R_BRACK@[26; 27) "]"
|
||||
WHITESPACE@[27; 28) " "
|
||||
LITERAL@[28; 30)
|
||||
INT_NUMBER@[28; 30) "92"
|
||||
R_PAREN@[30; 31) ")"
|
||||
WHITESPACE@[31; 32) "\n"
|
||||
R_CURLY@[32; 33) "}"
|
||||
WHITESPACE@[33; 34) "\n"
|
Loading…
Reference in New Issue
Block a user