File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -1046,13 +1046,16 @@ pub(crate) mod parsing {
1046
1046
let mut params = Punctuated :: new ( ) ;
1047
1047
loop {
1048
1048
let lookahead = input. lookahead1 ( ) ;
1049
- params. push_value ( if lookahead. peek ( Lifetime ) || lookahead. peek ( Ident ) {
1050
- input. parse :: < CapturedParam > ( ) ?
1051
- } else if lookahead. peek ( Token ! [ >] ) {
1052
- break ;
1053
- } else {
1054
- return Err ( lookahead. error ( ) ) ;
1055
- } ) ;
1049
+ params. push_value (
1050
+ if lookahead. peek ( Lifetime ) || lookahead. peek ( Ident ) || input. peek ( Token ! [ Self ] )
1051
+ {
1052
+ input. parse :: < CapturedParam > ( ) ?
1053
+ } else if lookahead. peek ( Token ! [ >] ) {
1054
+ break ;
1055
+ } else {
1056
+ return Err ( lookahead. error ( ) ) ;
1057
+ } ,
1058
+ ) ;
1056
1059
let lookahead = input. lookahead1 ( ) ;
1057
1060
params. push_punct ( if lookahead. peek ( Token ! [ , ] ) {
1058
1061
input. parse :: < Token ! [ , ] > ( ) ?
@@ -1079,8 +1082,8 @@ pub(crate) mod parsing {
1079
1082
let lookahead = input. lookahead1 ( ) ;
1080
1083
if lookahead. peek ( Lifetime ) {
1081
1084
input. parse ( ) . map ( CapturedParam :: Lifetime )
1082
- } else if lookahead. peek ( Ident ) {
1083
- input. parse ( ) . map ( CapturedParam :: Ident )
1085
+ } else if lookahead. peek ( Ident ) || input . peek ( Token ! [ Self ] ) {
1086
+ input. call ( Ident :: parse_any ) . map ( CapturedParam :: Ident )
1084
1087
} else {
1085
1088
Err ( lookahead. error ( ) )
1086
1089
}
Original file line number Diff line number Diff line change @@ -19,9 +19,6 @@ const REVISION: &str = "86d69c705a552236a622eee3fdea94bf13c5f102";
19
19
20
20
#[ rustfmt:: skip]
21
21
static EXCLUDE_FILES : & [ & str ] = & [
22
- // TODO: self capture: `impl Sized + use<Self>`
23
- "tests/ui/impl-trait/precise-capturing/self-capture.rs" ,
24
-
25
22
// TODO: non-lifetime binders: `where for<'a, T> &'a Struct<T>: Trait`
26
23
// https://github.com/dtolnay/syn/issues/1435
27
24
"src/tools/rustfmt/tests/source/issue_5721.rs" ,
You can’t perform that action at this time.
0 commit comments