-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
regression: ICE ErrorReporting Overflow should not reach report_selection_err call #90319
Comments
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
I got this ICE today, too. Let me know if there's anything I can to help :).
(EDIT: Removing the ref/deref fixed both the error and the ICE for me.) |
I hit this in Syn. This is a regression in 1.57-beta. My own case minimized: struct Wrapper<T>(T);
trait Trait {
fn method(&self) {}
}
impl<'a, T> Trait for Wrapper<&'a T> where Wrapper<T>: Trait {}
fn get<T>() -> T {
unimplemented!()
}
fn main() {
let thing = get::<Thing>();
let wrapper = Wrapper(thing);
Trait::method(&wrapper);
}
|
Just to make sure, you are still only seeing a error -> ICE regression (which is only a "diagnostics regression", in some sense), correct? |
It bisected to nightly-2021-10-09 and e0aaffd (#89576). @tom7980 @estebank @Mark-Simulacrum That's right. According to the PR title too, it suggests this would only occur during trying to emit a suggestion about an ambiguous trait impl, so I think there wouldn't be previously successfully compilable code that would be affected by this. |
Looks like I missed a path to get to coerce_diag in my PR - seems you can get to it through the calls here to select_obligations_where_possible rust/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs Lines 322 to 324 in b8e5ab2
and the resolve_vars_with_obligations_and_mutate_fulfillment call here rust/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs Lines 378 to 380 in b8e5ab2
which drops into a selection context through rust/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs Lines 624 to 637 in b8e5ab2
which then goes into a selection context to resolve a list of obligations passing any errors back to be reported via
In my PR the Errors are ignored because it's done during a probe_op to check for replacements types & we only care about if the type we're checking is relevant but it looks like here that's not the case so we're not reporting the overflow errors on the trait implementation I think what I'll need to do is figure out a way to determine whether or not we are in a probe_op context with errors so we correctly output the right diagnostics but it should not impact previously compilable code only code that has any overflow errors during Trait coercion |
Updated regression label since 1.57.0 has been released as stable now. |
I don't know if this the same issue, but it seems to be the case. So, here is another backtrace for rustc 1.57.0 (f1edd04 2021-11-29) running on aarch64-apple-darwin.
|
That is the same error, the fix is being reviewed (though I need to rebase it) as it didn't make it in for 1.57.0 I'm hoping we'll be able to get it in before the next release though! |
Fix ice when error reporting recursion errors Fixes: rust-lang#90319, rust-lang#92148, rust-lang#93955
Fix ice when error reporting recursion errors Fixes: rust-lang#90319, rust-lang#92148, rust-lang#93955
Fix ice when error reporting recursion errors Fixes: rust-lang#90319, rust-lang#92148, rust-lang#93955
This crate already failed to build on 1.56, but it seems worth trying to fix the ICE in case it affects other code as well.
The text was updated successfully, but these errors were encountered: