-
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 panic #39970
Comments
https://play.rust-lang.org/?gist=9404547723645a7f5d9c4661be8364c5&version=stable&backtrace=0 <-- I've been minimising too! |
The following features seem to be essential:
|
I think I found it: trait Array<'a> {
type Element: 'a;
}
trait Visit {
fn visit() {}
}
impl<'a> Array<'a> for () {
type Element = &'a ();
}
impl Visit for () where
//(): for<'a> Array<'a, Element=&'a ()>, // No ICE
(): for<'a> Array<'a, Element=()>, // ICE
{}
fn main() {
<() as Visit>::visit();
} This gives an error message like:
Note the |
Good spot. Can also interchange () with &() to get an even simpler version. |
The <() as Visit> part seems to be essential. No ICE. |
Another slight simplification. |
I have some more evidence that I think is worth recording here. Our minimised version above crashes the compiler in a case where it should be reporting an error. I now have a version that crashes the compiler when it should be accepting the program. I returned to my original program and specialized it to the case I care about, i.e. I instantiated all the generics. After minor fixes, it works. However, replacing |
The evaluation cache already exists, and it can handle differing parameter environments natively. Fixes rust-lang#39970. Fixes rust-lang#42796.
Replace the global fulfillment cache with the evaluation cache This uses the new "Chalk" ParamEnv refactoring to check "global" predicates in an empty environment, which should be correct because global predicates aren't affected by a consistent environment. Fixes #39970. Fixes #42796. r? @nikomatsakis
rustc asked me to file a bug report:
Here's a fragment of code sufficient to trigger the bug. It's not minimal yet, sorry. The code might not be correct; I was kinda relying on the compiler to tell me. ;-)
I hope you can make something of this.
The text was updated successfully, but these errors were encountered: