-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
thread 'rustc' panicked at 'Box<Any>' #41210
Comments
Some context for the change that caused this:
Before this error happened, I changed the file |
Once I fix that, everything works again. No more compiler panic. So it seems to have something to do with when I split up that struct. All the messed up pattern matches caused a panic. (Actually just fixing 2 broken pattern matches fixed the problem.) |
I've just encountered this myself. I managed to reduce it down: struct Foo;
fn main() {
|| if let Foo::NotEvenReal() = Foo {};
} It looks like this happens when a closure's body is a single (non-block) expression, and a tuple struct pattern is used somewhere in the expression. A simple workaround (if anyone needs one for some reason), then, is to just make the closure body a block: struct Foo;
fn main() {
|| { if let Foo::NotEvenReal() = Foo {} };
} |
Closes rust-lang#29924. Closes rust-lang#38857. Closes rust-lang#39665. Closes rust-lang#39872. Closes rust-lang#39553. Closes rust-lang#41210. Closes rust-lang#41880. Closes rust-lang#43483.
I was in the middle of making a big changes to some code when this panic occurred. I was expecting a lot of compiler errors but got a compiler panic instead! 😨
Version Info
I ran the build with
cargo +nightly test
and the panic still occurred.Compiler Output
Run
cargo test
to get this.Here's the full output with
RUST_BACKTRACE=1
:Since I was in the middle of editing, there's no commit to point to, so I just attached my source code as is so you have something to debug. When you download it and run
cargo test
, the compiler should panic. The repo is called brain-lang/brain.I don't know how to narrow this issue down, or else I would try to find a smaller example for you. Hope this is good enough.
brain-rustc-panic.zip
The text was updated successfully, but these errors were encountered: