-
Notifications
You must be signed in to change notification settings - Fork 13.3k
internal compiler error: thread 'rustc' panicked at 'Box<dyn Any>' #95406
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I think this has been fixed in #94438 |
The above code works with 1.56.0. The ICE appeared in 1.57.0 and is still present in |
I have a somewhat small demo and I've narrow it down to a single line of code: when the closure, which is passed a marco
|
Here's an even small demo with 3 ways to avoid the ICE:
It appears that the underlying bug has something to do with how closures are handled. |
I was looking at this, in an attempt to fix it, and it seems that it's already been fixed on nightly. The fix bisects to #103398, which is a rollup, but it seems like the fix was almost certainly in PR #103224. I'm not even sure if we need to add a test; the test added by that PR covered a very similar case. |
Closing as fixed by #103224 on nightly, with an appropriate test being added by the same PR. Feel free to reopen if more work is needed. |
Thanks for taking a look! |
Code
You can find a small example in the gitlab repo.
The relevant code is:
When I try to inline the
ffi!
macro invocation, the error goes away (see my commented example for my attempt).Meta
In my
rust-roolchain
file, I have1.59.0. It works fine with 1.56.1.
Error output
The text was updated successfully, but these errors were encountered: