about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2021-11-22 19:43:51 -0800
committerDavid Tolnay <dtolnay@gmail.com>2021-11-25 15:03:59 -0800
commit0cbb00f89875c085181f1d55bbe46d39ec36be3f (patch)
tree6eac0cca29bc5c59096f92608a0d6a1e1da34e20 /compiler/rustc_parse/src/parser
parent558ddee2cea3063a487393ea292126259702fe97 (diff)
downloadrust-0cbb00f89875c085181f1d55bbe46d39ec36be3f.tar.gz
rust-0cbb00f89875c085181f1d55bbe46d39ec36be3f.zip
Let qpath contain NtTy: <$:ty as $:ty>::rest
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/path.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs
index 7f8fadb33bd..04ede1f7e3b 100644
--- a/compiler/rustc_parse/src/parser/path.rs
+++ b/compiler/rustc_parse/src/parser/path.rs
@@ -155,6 +155,16 @@ impl<'a> Parser<'a> {
             path
         });
 
+        if let token::Interpolated(nt) = &self.token.kind {
+            if let token::NtTy(ty) = &**nt {
+                if let ast::TyKind::Path(None, path) = &ty.kind {
+                    let path = path.clone();
+                    self.bump();
+                    return Ok(path);
+                }
+            }
+        }
+
         let lo = self.token.span;
         let mut segments = Vec::new();
         let mod_sep_ctxt = self.token.span.ctxt();