Skip to content

Commit

Permalink
Auto merge of #18226 - SabrinaJewson:fix-impl-use, r=Veykril
Browse files Browse the repository at this point in the history
Correctly parse `use` in generic parameters

Fixes: #18225
  • Loading branch information
bors committed Oct 14, 2024
2 parents aacf840 + 22129b1 commit e2c3ce5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fn type_bound(p: &mut Parser<'_>) -> bool {
T![for] => types::for_type(p, false),
// test precise_capturing
// fn captures<'a: 'a, 'b: 'b, T>() -> impl Sized + use<'b, T> {}
T![use] => {
T![use] if p.nth_at(1, T![<]) => {
p.bump_any();
generic_param_list(p)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SOURCE_FILE
IMPL
IMPL_KW "impl"
GENERIC_PARAM_LIST
L_ANGLE "<"
TYPE_PARAM
NAME
IDENT "T"
COLON ":"
WHITESPACE "\n"
TYPE_BOUND_LIST
ERROR
USE_KW "use"
WHITESPACE " "
MACRO_CALL
PATH
PATH_SEGMENT
NAME_REF
IDENT "std"
SEMICOLON ";"
WHITESPACE "\n"
error 8: expected R_ANGLE
error 8: expected type
error 11: expected `{`
error 15: expected BANG
error 15: expected `{`, `[`, `(`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
impl<T:
use std;

0 comments on commit e2c3ce5

Please sign in to comment.