Skip to content
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

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:1990 ~ full_moon[5c09]::ast::parsers::{impl#230}::parse::{closure#0}), const_param_did: None }) (end of phase Optimization) at bb15[0]: #88555

Closed
IndianBoy42 opened this issue Sep 1, 2021 · 6 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@IndianBoy42
Copy link

Code

The code is part of the full_moon package, I have filed an issue there to try and get a minimal example

Meta

This problem only happens on nightly version shown below

rustc --version --verbose:

❯ rustc --version --verbose
rustc 1.56.0-nightly (29ef6cf16 2021-08-31)
binary: rustc
commit-hash: 29ef6cf1637aa8317f8911f93f14e18d404c1b0e
commit-date: 2021-08-31
host: x86_64-unknown-linux-gnu
release: 1.56.0-nightly
LLVM version: 13.0.0

Error output

   Compiling full_moon v0.13.1
   Compiling stylua v0.10.1
error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:1976 ~ full_moon[7f67]::ast::parsers::{impl#225}::parse::{closure#0}), const_param_did: None }) (end of phase Optimization) at bb63[0]:
use of local _155, which has no storage here
    --> /home/amedhi/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/full_moon-0.13.1/src/ast/parsers.rs:1858:4
     |
1858 |               }
     |               ^
...
1865 | / make_op_parser!(BinOp, ParseBinOp,
1866 | |     {
1867 | |         And,
1868 | |         Caret,
...    |
1882 | |     }
1883 | | );
     | |__- in this macro invocation
     |
     = note: delayed at compiler/rustc_mir/src/transform/validate.rs:121:36
     = note: this error: internal compiler error originates in the macro `make_op_parser` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:1990 ~ full_moon[7f67]::ast::parsers::{impl#230}::parse::{closure#0}), const_param_did: None }) (end of phase Optimization) at bb15[0]:
use of local _35, which has no storage here
    --> /home/amedhi/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/full_moon-0.13.1/src/ast/parsers.rs:1858:4
     |
1858 |               }
     |               ^
...
1885 | / make_op_parser!(UnOp, ParseUnOp,
1886 | |     {
1887 | |         Minus,
1888 | |         Not,
1889 | |         Hash,
1890 | |     }
1891 | | );
     | |__- in this macro invocation
     |
     = note: delayed at compiler/rustc_mir/src/transform/validate.rs:121:36
     = note: this error: internal compiler error originates in the macro `make_op_parser` (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1166:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/29ef6cf1637aa8317f8911f93f14e18d404c1b0e/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/29ef6cf1637aa8317f8911f93f14e18d404c1b0e/library/std/src/panicking.rs:460:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map
   8: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.56.0-nightly (29ef6cf16 2021-08-31) running on x86_64-unknown-linux-gnu

note: compiler flags: -C opt-level=3 -C panic=abort -C linker-plugin-lto -C link-arg=-fuse-ld=lld -C target-cpu=native --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `full_moon`
warning: build failed, waiting for other jobs to finish...
error: failed to compile `stylua v0.10.1`, intermediate artifacts can be found at `/tmp/cargo-installvxqZx9`
Backtrace

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1166:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/29ef6cf1637aa8317f8911f93f14e18d404c1b0e/library/std/src/panicking.rs:517:5
   1: std::panicking::begin_panic_fmt
             at /rustc/29ef6cf1637aa8317f8911f93f14e18d404c1b0e/library/std/src/panicking.rs:460:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map
   8: scoped_tls::ScopedKey<T>::set

@IndianBoy42 IndianBoy42 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 1, 2021
@hellow554
Copy link
Contributor

I can't reproduce the ICE. Can you provide steps to reproduce it? Something like this:

git clone https://github.com/Kampfkarren/full-moon
cd full-moon
rustup override set nightly-2021-08-31
cargo build

@IndianBoy42
Copy link
Author

I encountered this when trying to install stylua and selene.

cargo install stylua

Perhaps this only happens in release mode?

@hellow554
Copy link
Contributor

cargo build --release is needed on the full-moon repository. I'm on it

@SNCPlay42
Copy link
Contributor

SNCPlay42 commented Sep 1, 2021

Duplicate of #88498 (which in turn is a duplicate of #88307).

@hellow554
Copy link
Contributor

Can confirm, that the code that produces the ICE is indeed the same.
This can therefore be closed.

@JohnTitor
Copy link
Member

Triage: Closing in favor of the above comments. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants