-
Notifications
You must be signed in to change notification settings - Fork 15
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
internal compiler error: ../src/librustc/ty/subst.rs:457: Type parameter Self/#0
(Self/0) out of range when substituting (root type=Some(&Self)) substs=[]
#40
Comments
Yeah this looks like one of the issues about substs/generics/monomorphization I mentioned before #17 (comment) (like this stack trace seems to show). I had worked on this very thing (eg part of this commit lqd@837eda7 but it also built upon temporary previous work, a hacky branch to try and compile libcore, so the code is not really usable as is unfortunately). IIRC, this was absolutely a required thing to do, and fixed some problematic cases on the previous nightly though, and would certainly fix some on the new nightly as well. At least the tests catch the problem now. Another problematic case showed up with code similar to https://github.com/lqd/mir2wasm/blob/e5f4f6b56cd9906dbae0fdd5d8c555250ff7e018/rust-examples/option.rs and seemed less related to substs per se, compared to monomorphization/resolving trait methods, and there also is the substs-related "possible duplicated fns" from another bullet point in #17 (comment) |
Thanks for the investigation! I opened this so we could have a tracking bug but go ahead and merge #39. Unfortunately, as soon as I did that I found another issue, which I mentioned at #39 (comment) |
…ic impls (side-step issue brson#40)
I think Self was in the fn's type_scheme.generics.types in the old nightly. This fixes the 3 examples exhibiting the brson#40 behavior, so I also added the default methods back to the tests that were created from those examples. (The cmp example and test are still failing, but it's surely because of substs/monomorphization problems)
I think Self was in the fn's type_scheme.generics.types in the old nightly. This fixes the 3 examples exhibiting the brson#40 behavior, so I also added the default methods back to the tests that were created from those examples. (The cmp example and test are still failing, but it's surely because of substs/monomorphization problems)
I think we should be good here |
Awesome. Are the tests that were failing still xfailed? If so, we should enable them again. |
|
Sounds good. I'll close the bug. As far as xfail versus compile-fail, I think of xfail as "these are tests that should work, but we know they don't and we'll fix them later." The tests in compile-fail are ones that are intentionally invalid and therefore we want to be sure they actually produce an error if you try to compile them. Is the test that got moved to compile-fail in this category? |
No, this test is intended to compile and run, and we should really xfail it and move it back to the compile-pass folder. Let's do this when we can |
Sounds good. Just to be sure, this was We should probably just remove the |
yup, cmp.rs |
A lot of our tests are showing this error after our latest nightly bump. Below is a representative stack trace.
The text was updated successfully, but these errors were encountered: