-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc panics on compile-fail/issue-36638 #49889
Comments
So, #36649 would gensym the name "Self" but #49695 erases that difference again by doing a string contents comparison. However, the test only gets to the failing assertion because of cc @rust-lang/compiler |
I don't think we should need |
As a stop-gap, what if we make diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs
index 310fcbcfcb37..c34514178d65 100644
--- a/src/librustc/ty/sty.rs
+++ b/src/librustc/ty/sty.rs
@@ -885,8 +885,7 @@ impl<'a, 'gcx, 'tcx> ParamTy {
}
pub fn is_self(&self) -> bool {
- if self.name == keywords::SelfType.name().as_str() {
- assert_eq!(self.idx, 0);
+ if self.name == keywords::SelfType.name().as_str() && self.idx == 0 {
true
} else {
false |
@cuviper That seems worse, because now instead of an ICE, the compiler might be doing weird things. Then again, this can only arise if there was a parse error, so I think it's an okay stopgap iff it's tagged with a My suggestion for a better fix remains #49889 (comment) - and the new issue could mention it. |
This commit papers over rust-lang#49889 (introducing a fixme pointing at rust-lang#50125) for a bug that was introduced with rust-lang#49695. This workaround is taken from rust-lang#49891.
The stopgap has been merged -- closing in favor of further cleanup in #50125. |
As noted in #49826 (comment), currently rustc is panicking on
compile-fail/issue-36638
. This only passed CI because main-thread panics are not being detected as ICE (to be fixed by #49826), and compiletest doesn't notice non-ICE panics (#49888).It's fine with
rustc 1.27.0-nightly (0b72d48f8 2018-04-10)
, so I was able to bisect this to the recent commit abfc8c2 from #49695 -- cc @michaelwoerister.Note that the test is dealing with improper usage of
Self
, and the assertion in question is also dealing with self:rust/src/librustc/ty/sty.rs
Lines 887 to 894 in abfc8c2
The text was updated successfully, but these errors were encountered: