about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-04-03 22:34:53 -0400
committerMichael Goulet <michael@errs.io>2024-04-15 16:45:01 -0400
commitc897092654bae65d5695ef3b1a5850c15513ed5d (patch)
tree1af4c36ca65ecc08a57dc9e350ae787f06e5384b /compiler/rustc_parse/src/parser
parentfc9e344874ce718c951016ba29f7fcabb36f26c3 (diff)
downloadrust-c897092654bae65d5695ef3b1a5850c15513ed5d.tar.gz
rust-c897092654bae65d5695ef3b1a5850c15513ed5d.zip
Implement resolution, parse use<Self>
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/ty.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
index 62f0602e1fa..a24ecf938ba 100644
--- a/compiler/rustc_parse/src/parser/ty.rs
+++ b/compiler/rustc_parse/src/parser/ty.rs
@@ -694,7 +694,13 @@ impl<'a> Parser<'a> {
                 &TokenKind::Gt,
                 SeqSep::trailing_allowed(token::Comma),
                 |self_| {
-                    if self_.check_ident() {
+                    if self_.check_keyword(kw::SelfUpper) {
+                        self_.bump();
+                        Ok(PreciseCapturingArg::Arg(
+                            self_.prev_token.ident().unwrap().0,
+                            DUMMY_NODE_ID,
+                        ))
+                    } else if self_.check_ident() {
                         Ok(PreciseCapturingArg::Arg(self_.parse_ident().unwrap(), DUMMY_NODE_ID))
                     } else if self_.check_lifetime() {
                         Ok(PreciseCapturingArg::Lifetime(self_.expect_lifetime()))