-
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
ICE on nightly when dereferencing boxed Iterator trait object #57673
Comments
|
I think I just ran into this bug as well. It's repros in the 2018-12-31 nightly. |
The bug was introduced in nightly-2018-12-21, so somewhere between 790f4c5...09d6ab9 |
This could possibly be the same bug as #57216. At least the stack trace and panic message is very similar. |
triage: P-high; assigning to self. |
(the ICE seems like it may have been injected by commit be2bb4f specifically.) |
I have been looking at this more. I am not 100% certain I understand the steps that are leading to the ICE, but here are some notes and hypotheses based on adding some
|
(also, am I wrong in feeling my eyebrows go up when I observe that the compiler is attempting to search for candidates similar to the method name |
Anyway, just to narrow the search space for the bug, I'm going to hack Update: No, this probably won't suffice: the ICE is itself arising, I think, during the execution of |
Okay, i think I have a hint at the problem More debug log inspection has led me to conclude that the problematic Look at this code: rust/src/librustc_typeck/check/method/probe.rs Lines 507 to 517 in 0974bdc
During the execution of:
is when the vid _#527t is created and then pushed (as part of a candidate) onto the inherent candidates list attached to self . But then the callback for self.fcx.probe(|_| { ... }) returns, and as part of exiting the probe call, it does a rollback, which pops off the entries for the newly created inference variables _#527t and _#528t .
Sometime well after this point, we attempt to look at the inherent candidates (during So, I am pretty sure the code for the Now my question is: How to fix this? |
Okay well as an experiment, I have tried just removing the wrapping call to |
(this bug wasn't fixed in time for the nightly-to-beta promotion and so its now affecting beta) |
PR #57835 fixes this problem and has been nominated for beta-backport. However, @arielb1 thinks that it is an insufficient solution and says they hope to have a better approach up soonish. Thus, we might not want to do an eager backport of PR #57835, since it would probably be nicer to make a single backport that includes both the effect of that PR as well as the hypothetical PR to be provided by @arielb1 |
When dereferencing a boxed
Iterator
trait object I get an internal compiler error (only on nightly).Here is a minimal example: (playground link)
This should result in a type error, as indeed it does if I swap out
dyn Iterator<Item=()>
withdyn std::fmt::Debug
.Instead, it results in the following error when compiled with nightly (
rustc src/main.rs
):Meta
Output from
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: