about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2018-04-20 11:37:41 -0700
committerJosh Stone <jistone@redhat.com>2018-04-24 16:16:49 -0700
commita42db7dbfd6ffdcc0c60246d688dc09376c2a1ef (patch)
treec7c95445406cb9861da9ce7860a211653074c548 /src
parentcc48ae5a64a4e648211a2e7c9f37df0c5d6c32a6 (diff)
downloadrust-a42db7dbfd6ffdcc0c60246d688dc09376c2a1ef.tar.gz
rust-a42db7dbfd6ffdcc0c60246d688dc09376c2a1ef.zip
Add a stopgap for #49889
Diffstat (limited to 'src')
-rw-r--r--src/librustc/ty/sty.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs
index 310fcbcfcb3..320191167be 100644
--- a/src/librustc/ty/sty.rs
+++ b/src/librustc/ty/sty.rs
@@ -885,8 +885,10 @@ impl<'a, 'gcx, 'tcx> ParamTy {
     }
 
     pub fn is_self(&self) -> bool {
-        if self.name == keywords::SelfType.name().as_str() {
-            assert_eq!(self.idx, 0);
+        // FIXME(#50125): Ignoring `Self` with `idx != 0` might lead to weird behavior elsewhere,
+        // but this should only be possible when using `-Z continue-parse-after-error` like
+        // `compile-fail/issue-36638.rs`.
+        if self.name == keywords::SelfType.name().as_str() && self.idx == 0 {
             true
         } else {
             false