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

internal compiler error: no errors encountered even though delay_span_bug issued #153

Closed
hintron opened this issue Oct 5, 2023 · 8 comments

Comments

@hintron
Copy link

hintron commented Oct 5, 2023

Hello!
After enabling optimizations for dependencies in my Bevy code, like so:

[profile.dev.package."*"]
opt-level = 3

my Bevy game fails to compile bevy-inspector-egui. Does anyone know what is going on, or how I can fix this?

bevy-inspector-egui: v0.18.3
Rust: rustc 1.75.0-nightly (2bbb61989 2023-10-04)
System: x86_64-pc-windows-msvc (w/ Git Bash terminal)
Bevy version: 0.10 w/ dynamic_linking enabled
compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -Z share-generics=n

output:

$ cargo run
   Compiling proc-macro2 v1.0.67
...
   Compiling bevy-inspector-egui-derive v0.18.1
   Compiling bevy_dylib v0.10.1
   Compiling bevy v0.10.1
   Compiling bevy_mod_raycast v0.8.0
   Compiling bevy_egui v0.20.2
   Compiling bevy_mod_picking v0.12.0
   Compiling bevy-inspector-egui v0.18.3
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(DefId(0:153 ~ bevy_inspector_egui[4c35]::bevy_inspector::ui_for_entity_components::{closure#3})) (after phase change to runtime-optimized) at bb5[4]:
                                Alias(Opaque, AliasTy { args: [ReErased, ReErased], def_id: DefId(0:2157 ~ bevy_inspector_egui[4c35]::restricted_world_view::{impl#3}::get_entity_component_reflect::{opaque#0}) }) does not have fields
   --> <REDACTED>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy-inspector-egui-0.18.3\src\bevy_inspector\mod.rs:394:17
    |
394 |                 set_changed();
    |                 ^^^^^^^^^^^
    |
note: delayed at compiler\rustc_const_eval\src\transform\validate.rs:96:25
         0: std::backtrace::Backtrace::disabled
         1: std::backtrace::Backtrace::capture
         2: <rustc_errors::HandlerInner>::emit_diagnostic
         3: <rustc_const_eval::transform::promote_consts::Candidate as core::fmt::Debug>::fmt
         4: <rustc_const_eval::transform::check_consts::post_drop_elaboration::CheckLiveDrops as rustc_middle::mir::visit::Visitor>::visit_terminator
         5: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         6: <rustc_mir_transform::ref_prop::ReferencePropagation as rustc_middle::mir::MirPass>::run_pass
         7: rustc_mir_transform::run_analysis_to_runtime_passes
         8: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::load_side_effects
         9: <windows::Windows::Win32::Globalization::CPINFO as core::cmp::PartialEq>::eq
        10: <windows::Windows::Win32::Globalization::CPINFO as core::cmp::PartialEq>::eq
        11: <windows::Windows::Win32::Globalization::CPINFO as core::cmp::PartialEq>::eq
        12: <rustc_middle::ty::context::TyCtxt>::instance_mir
        13: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_constant
        14: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        15: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        16: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        17: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        18: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        19: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        20: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        21: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        22: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        23: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        24: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        25: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        26: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        27: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        28: rustc_monomorphize::provide
        29: rustc_monomorphize::provide
        30: rustc_monomorphize::provide
        31: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_constant
        32: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        33: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        34: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        35: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        36: rustc_codegen_llvm::llvm_util::target_features
        37: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
        38: <rustc_interface::queries::Linker>::link
        39: rustc_interface::passes::start_codegen
        40: <rustc_interface::queries::Linker>::link
        41: <rustc_interface::queries::Queries>::ongoing_codegen
        42: <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt
        43: <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt
        44: <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt
        45: std::sys::windows::thread::Thread::new
        46: BaseThreadInitThunk
        47: RtlUserThreadStart
   --> <REDACTED>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy-inspector-egui-0.18.3\src\bevy_inspector\mod.rs:394:17
    |
394 |                 set_changed();
    |                 ^^^^^^^^^^^

error: internal compiler error: broken MIR in Item(DefId(0:153 ~ bevy_inspector_egui[4c35]::bevy_inspector::ui_for_entity_components::{closure#3})) (after phase change to runtime-optimized) at bb5[5]:
                                Alias(Opaque, AliasTy { args: [ReErased, ReErased], def_id: DefId(0:2157 ~ bevy_inspector_egui[4c35]::restricted_world_view::{impl#3}::get_entity_component_reflect::{opaque#0}) }) does not have fields
   --> <REDACTED>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy-inspector-egui-0.18.3\src\bevy_inspector\mod.rs:394:17
    |
394 |                 set_changed();
    |                 ^^^^^^^^^^^
    |
note: delayed at compiler\rustc_const_eval\src\transform\validate.rs:96:25
         0: std::backtrace::Backtrace::disabled
         1: std::backtrace::Backtrace::capture
         2: <rustc_errors::HandlerInner>::emit_diagnostic
         3: <rustc_const_eval::transform::promote_consts::Candidate as core::fmt::Debug>::fmt
         4: <rustc_const_eval::transform::check_consts::post_drop_elaboration::CheckLiveDrops as rustc_middle::mir::visit::Visitor>::visit_terminator
         5: <rustc_const_eval::transform::validate::Validator as rustc_middle::mir::MirPass>::run_pass
         6: <rustc_mir_transform::ref_prop::ReferencePropagation as rustc_middle::mir::MirPass>::run_pass
         7: rustc_mir_transform::run_analysis_to_runtime_passes
         8: <rustc_query_impl::plumbing::QueryCtxt as rustc_query_system::query::QueryContext>::load_side_effects
         9: <windows::Windows::Win32::Globalization::CPINFO as core::cmp::PartialEq>::eq
        10: <windows::Windows::Win32::Globalization::CPINFO as core::cmp::PartialEq>::eq
        11: <windows::Windows::Win32::Globalization::CPINFO as core::cmp::PartialEq>::eq
        12: <rustc_middle::ty::context::TyCtxt>::instance_mir
        13: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_constant
        14: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        15: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        16: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        17: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        18: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        19: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        20: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        21: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        22: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        23: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        24: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        25: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        26: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        27: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_operand
        28: rustc_monomorphize::provide
        29: rustc_monomorphize::provide
        30: rustc_monomorphize::provide
        31: <rustc_monomorphize::collector::MirUsedCollector as rustc_middle::mir::visit::Visitor>::visit_constant
        32: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        33: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        34: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        35: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
        36: rustc_codegen_llvm::llvm_util::target_features
        37: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
        38: <rustc_interface::queries::Linker>::link
        39: rustc_interface::passes::start_codegen
        40: <rustc_interface::queries::Linker>::link
        41: <rustc_interface::queries::Queries>::ongoing_codegen
        42: <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt
        43: <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt
        44: <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt
        45: std::sys::windows::thread::Thread::new
        46: BaseThreadInitThunk
        47: RtlUserThreadStart
   --> <REDACTED>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy-inspector-egui-0.18.3\src\bevy_inspector\mod.rs:394:17
    |
394 |                 set_changed();
    |                 ^^^^^^^^^^^

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

warning: the ICE couldn't be written to `<REDACTED>\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy-inspector-egui-0.18.3\rustc-ice-2023-10-05T17:37:33.0241552Z-7688.txt`: The filename, directory name, or volume label syntax is incorrect. (os error 123)

note: rustc 1.75.0-nightly (2bbb61989 2023-10-04) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -Z share-generics=n

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

query stack during panic:
end of query stack
error: could not compile `bevy-inspector-egui` (lib)
@jakobhellermann
Copy link
Owner

can you try if this still happens?

also did you try updating your nightly rust or running cargo clean? this looks like something that went wrong in rustc, not this crate

@StefanBRas
Copy link

I have the same problem and not sure how to isolate it. My Cargo.toml looks like this:

[package]
name = "my_bevy_game"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0.75"
bevy = { version = "0.12.0", features = ["dynamic_linking"] }
bevy-inspector-egui = "0.21.0"
bevy_mod_debugdump = "0.8.1"
bevy_screen_diagnostics = "0.4.0"
petgraph = "0.6.4"
rand = "0.8.5"
strum = "0.25.0"
strum_macros = "0.25.2"

# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1

# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3

It also happens if [profile.dev.package."*".opt-level] = 2.

I'm on rustc 1.74.0-nightly (ca62d2c44 2023-09-30).

It doesn't happen on a new project with bevy and bevy-inspecter-egui as the only dependencies.
It also doens't happen with the Cargo.toml above if I create a new project with a simple main function. It's difficult to isolate exactly what interaction makes it error out, because the compiles takes 20 minutes.

I'm not sure how I can debug it. I can upload the full project if needed, it's just me trying out bevy.

@Zackaryia
Copy link

Zackaryia commented Nov 9, 2023

For what its worth I have the same error and this is my Cargo.toml

[package]
name = "jame_gam_23"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# TODO: Remove dynamic_linking feature on release
bevy = { version = "0.12.0" }
bevy-inspector-egui = "0.21.0"
# bevy-inspector-egui = "0.21.0"
bevy_hanabi = "0.8.0"
bevy_xpbd_2d = { version = "0.3", default-features = false, features = [ "2d", "f64", "parallel", "enhanced-determinism" ] }

# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1

# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3

Also I didnt even add the plugin to my app or even import it in main.rs or any other file.

@brandon-reinhart
Copy link

I just did a rustup update and now I get the same ICE.

@Occuros
Copy link

Occuros commented Nov 29, 2023

Same here, after updating the rust compiler to the following:

stable-x86_64-pc-windows-msvc unchanged - rustc 1.74.0 (79e9716c9 2023-11-13)
nightly-x86_64-pc-windows-msvc unchanged - rustc 1.76.0-nightly (5facb422f 2023-11-28)

I have the same error as described above:

error: internal compiler error: broken MIR in Item(DefId(0:154 ~ bevy_inspector_egui[533f]::bevy_inspector::ui_for_entity_components::{closure#3})) (after phase change to runtime-optimized) at bb5[5]:
                               Alias(Opaque, AliasTy { args: [ReErased, ReErased], def_id: DefId(0:2228 ~ bevy_inspector_egui[533f]::restricted_world_view::{impl#3}::get_entity_component_reflect::{opaque#0}) }) does not have fields

@jakobhellermann
Copy link
Owner

This is the same issue as #163.

The tldr is: this is a bug in rustc 1.74, for a workaround you can use nightly or beta instead.

@rayrrr
Copy link

rayrrr commented Dec 17, 2023

This appears to no longer be an issue after updating to rustc 1.74.1.

@hintron
Copy link
Author

hintron commented Dec 18, 2023

I can confirm that the issue went away for me after upgrading past rustc 1.74.1 (nightly 1.76.0). Closing out. Thanks!

@hintron hintron closed this as completed Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants