From b00f39bc151f1b9af726b08649bb4d36ea200606 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 20 Apr 2018 14:55:47 -0700 Subject: [PATCH] Paper over a bug on master This commit papers over #49889 (introducing a fixme pointing at #50125) for a bug that was introduced with #49695. This workaround is taken from #49891. --- src/librustc/ty/sty.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index 7a9174cbfaf73..425ab1a312a70 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