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

Incremental recompilation MIR ICE #110457

Closed
crumblingstatue opened this issue Apr 17, 2023 · 9 comments · Fixed by #112063
Closed

Incremental recompilation MIR ICE #110457

crumblingstatue opened this issue Apr 17, 2023 · 9 comments · Fixed by #112063
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue

Comments

@crumblingstatue
Copy link
Contributor

crumblingstatue commented Apr 17, 2023

See the minimal repro in a comment below.
The original was a repository that wasn't meant to be published (yet).

thread 'rustc' panicked at 'Found unstable fingerprints for mir_built(846f94324a996071-e947a0936904c2fb): Steal { value: RwLock(RefCell { value: Some(Body { basic_blocks: BasicBlocks { basic_blocks: [BasicBlockData { statements: [StorageLive(_3), StorageLive(_4), StorageLive(_5), StorageLive(_6), StorageLive(_7), StorageLive(_8), StorageLive(_9), _9 = [const ""], _8 = &_9, _7 = &(*_8), _6 = move _7 as &[&str] (Pointer(Unsize)), StorageDead(_7), StorageLive(_10), StorageLive(_11), StorageLive(_12), StorageLive(_13), StorageLive(_14), StorageLive(_15), StorageLive(_16), _16 = &(*(_1.0: &tiles::TileDb)), _15 = &(*_16)], terminator: Some(Terminator { source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#190), scope: scope[0] }, kind: _14 = ArgumentV1::<'_>::new_debug::<TileDb>(move _15) -> [return: bb1, unwind: bb9] }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_15), _13 = [move _14], StorageDead(_14), _12 = &_13, _11 = &(*_12), _10 = move _11 as &[core::fmt::ArgumentV1<'_>] (Pointer(Unsize)), StorageDead(_11)], terminator: Some(Terminator { source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:39: 120:79 (#190), scope: scope[0] }, kind: _5 = Arguments::<'_>::new_v1(move _6, move _10) -> [return: bb2, unwind: bb9] }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_10), StorageDead(_6)], terminator: Some(Terminator { source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:19: 120:80 (#189), scope: scope[0] }, kind: _4 = format(move _5) -> [return: bb3, unwind: bb9] }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_5), FakeRead(ForLet(None), _4), StorageDead(_16), StorageDead(_13), StorageDead(_12), StorageDead(_9), StorageDead(_8), _3 = move _4], terminator: Some(Terminator { source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:122:5: 122:6 (#189), scope: scope[0] }, kind: drop(_4) -> [return: bb4, unwind: bb9] }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_4)], terminator: Some(Terminator { source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#11365), scope: scope[0] }, kind: drop(((*_2).2: std::string::String)) -> [return: bb5, unwind: bb6] }), is_cleanup: false }, BasicBlockData { statements: [((*_2).2: std::string::String) = move _3, _0 = const ()], terminator: Some(Terminator { source_info: SourceInfo { span: src/game.rs:24:28: 24:29 (#162), scope: scope[0] }, kind: drop(_3) -> [return: bb7, unwind: bb9] }), is_cleanup: false }, BasicBlockData { statements: [((*_2).2: std::string::String) = move _3], terminator: Some(Terminator { source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#11365), scope: scope[0] }, kind: goto -> bb8 }), is_cleanup: true }, BasicBlockData { statements: [StorageDead(_3)], terminator: Some(Terminator { source_info: SourceInfo { span: src/game.rs:24:29: 24:29 (#162), scope: scope[0] }, kind: return }), is_cleanup: false }, BasicBlockData { statements: [], terminator: Some(Terminator { source_info: SourceInfo { span: src/game.rs:24:28: 24:29 (#162), scope: scope[0] }, kind: drop(_3) -> [return: bb9, unwind terminate] }), is_cleanup: true }, BasicBlockData { statements: [], terminator: Some(Terminator { source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] }, kind: resume }), is_cleanup: true }], cache: Cache { predecessors: OnceCell(Uninit), switch_sources: OnceCell(Uninit), is_cyclic: OnceCell(Uninit), postorder: OnceCell(Uninit) } }, phase: Built, pass_count: 0, source: MirSource { instance: Item(WithOptConstParam { did: DefId(0:769 ~ mantle_diver[456a]::game::{impl#2}::inspect_mut::{closure#0}::{closure#8}::{closure#0}), const_param_did: None }), promoted: None }, source_scopes: [SourceScopeData { span: src/game.rs:24:22: 24:29 (#162), parent_scope: None, inlined: None, inlined_parent_scope: None, local_data: Set(SourceScopeLocalData { lint_root: HirId(DefId(0:751 ~ mantle_diver[456a]::game::{impl#2}::inspect_mut).760), safety: Safe }) }, SourceScopeData { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:9: 122:6 (#189), parent_scope: Some(scope[0]), inlined: None, inlined_parent_scope: None, local_data: Set(SourceScopeLocalData { lint_root: HirId(DefId(0:751 ~ mantle_diver[456a]::game::{impl#2}::inspect_mut).760), safety: Safe }) }], generator: None, local_decls: [LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: (), user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:22 (#162), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: [closure@src/game.rs:24:22: 24:29], user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Set(User(Var(VarBindingForm { binding_mode: BindByValue(Not), opt_ty_info: None, opt_match_place: Some((None, src/game.rs:24:22: 24:29 (#162))), pat_span: src/game.rs:24:22: 24:29 (#162) }))), internal: false, ty: &mut egui::PlatformOutput, user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: std::string::String, user_ty: None, source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:119:23: 122:6 (#189), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Set(User(Var(VarBindingForm { binding_mode: BindByValue(Not), opt_ty_info: None, opt_match_place: Some((None, (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:19: 120:80 (#189))), pat_span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:13: 120:16 (#189) }))), internal: false, ty: std::string::String, user_ty: None, source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:13: 120:16 (#189), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: std::fmt::Arguments<'_>, user_ty: None, source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:39: 120:79 (#190), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: &[&str], user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: &[&str; 1], user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Set(Boring), internal: false, ty: &[&str; 1], user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Set(Boring), internal: false, ty: [&str; 1], user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: &[core::fmt::ArgumentV1<'_>], user_ty: None, source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:39: 120:79 (#190), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: &[core::fmt::ArgumentV1<'_>; 1], user_ty: None, source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:39: 120:79 (#190), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Set(Boring), internal: false, ty: &[core::fmt::ArgumentV1<'_>; 1], user_ty: None, source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:39: 120:79 (#190), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Set(Boring), internal: false, ty: [core::fmt::ArgumentV1<'_>; 1], user_ty: None, source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:39: 120:79 (#190), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: core::fmt::ArgumentV1<'_>, user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#190), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: &tiles::TileDb, user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#190), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Set(Boring), internal: false, ty: &tiles::TileDb, user_ty: None, source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#190), scope: scope[0] } }], user_type_annotations: [CanonicalUserTypeAnnotation { user_ty: Canonical { value: TypeOf(DefId(2:9040 ~ core[2859]::fmt::{impl#4}::new_v1), UserSubsts { substs: [ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) })], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9037 ~ core[2859]::fmt::{impl#4}), self_ty: std::fmt::Arguments<'_> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }] }, span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:39: 120:79 (#190), inferred_ty: fn(&[&'static str], &[core::fmt::ArgumentV1<'_>]) -> std::fmt::Arguments<'_> {std::fmt::Arguments::<'_>::new_v1} }, CanonicalUserTypeAnnotation { user_ty: Canonical { value: TypeOf(DefId(2:41685 ~ core[2859]::fmt::{impl#3}::new_debug), UserSubsts { substs: [ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrAnon(None) }), ^1], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:9030 ~ core[2859]::fmt::{impl#3}), self_ty: core::fmt::ArgumentV1<'_> }) }), max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Ty(General(U0)) }, CanonicalVarInfo { kind: Region(U0) }] }, span: src/game.rs:24:22: 24:29 (#190), inferred_ty: for<'b> fn(&'b tiles::TileDb) -> core::fmt::ArgumentV1<'b> {core::fmt::ArgumentV1::<'_>::new_debug::<tiles::TileDb>} }], arg_count: 2, spread_arg: None, var_debug_info: [VarDebugInfo { name: "o", source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#162), scope: scope[0] }, value: _2, argument_index: Some(2) }, VarDebugInfo { name: "self__tile_db", source_info: SourceInfo { span: src/game.rs:24:22: 24:29 (#1589), scope: scope[0] }, value: (*(_1.0: &tiles::TileDb)), argument_index: None }, VarDebugInfo { name: "res", source_info: SourceInfo { span: (omitted)/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/macros.rs:120:13: 120:16 (#189), scope: scope[1] }, value: _4, argument_index: None }], span: src/game.rs:24:22: 24:29 (#162), required_consts: [], is_polymorphic: false, injection_phase: None, tainted_by_errors: None }) }) }', /rustc/d0f204e4d750b62f9d6c2593405e828757126832/compiler/rustc_query_system/src/query/plumbing.rs:715:9
stack backtrace:
   0:     0x7f13df09dcca - std::backtrace_rs::backtrace::libunwind::trace::h5305f7ceb73a8f21
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f13df09dcca - std::backtrace_rs::backtrace::trace_unsynchronized::haaa611f40c18b8f2
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f13df09dcca - std::sys_common::backtrace::_print_fmt::hc172453659fd99fe
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f13df09dcca - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hacfa999350a262bc
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f13df1020cf - core::fmt::write::h90b031b2ddd09ae3
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/core/src/fmt/mod.rs:1254:17
   5:     0x7f13df090905 - std::io::Write::write_fmt::hbb52b722349829fc
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/io/mod.rs:1698:15
   6:     0x7f13df09da95 - std::sys_common::backtrace::_print::heb41e31eaa89e35c
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f13df09da95 - std::sys_common::backtrace::print::hf098c20687d22cb5
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f13df0a073e - std::panicking::default_hook::{{closure}}::h88384ed37cb8e0ea
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/panicking.rs:269:22
   9:     0x7f13df0a04e5 - std::panicking::default_hook::he41d226f47136c9d
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/panicking.rs:288:9
  10:     0x7f13dde1c9d5 - <rustc_driver_impl[dca6eaec99318d6f]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[2859ca24dae969e5]::ops::function::FnOnce<(&core[2859ca24dae969e5]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f13df0a0f34 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h9892c2e157351f3c
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/alloc/src/boxed.rs:1987:9
  12:     0x7f13df0a0f34 - std::panicking::rust_panic_with_hook::hd9989e613e7d3298
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/panicking.rs:695:13
  13:     0x7f13df0a0ca9 - std::panicking::begin_panic_handler::{{closure}}::h3053bcc9ba607096
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/panicking.rs:582:13
  14:     0x7f13df09e136 - std::sys_common::backtrace::__rust_end_short_backtrace::he69314b31cae3af9
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/sys_common/backtrace.rs:150:18
  15:     0x7f13df0a0a02 - rust_begin_unwind
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/panicking.rs:578:5
  16:     0x7f13df0fe443 - core::panicking::panic_fmt::h99dcfcf83543bc7f
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/core/src/panicking.rs:67:14
  17:     0x7f13de6f472e - rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[cf4061c8958768de]::ty::context::TyCtxt>
  18:     0x7f13dcecb527 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::execute_job_incr<rustc_query_impl[795a55a813d303c3]::queries::mir_built, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>
  19:     0x7f13dceca4cb - rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_execute_query::<rustc_query_impl[795a55a813d303c3]::queries::mir_built, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>
  20:     0x7f13dd81cbc5 - <rustc_query_impl[795a55a813d303c3]::Queries as rustc_middle[cf4061c8958768de]::ty::query::QueryEngine>::mir_built
  21:     0x7f13dcc118ab - rustc_mir_transform[6ecad65af303aadd]::mir_const
  22:     0x7f13de770231 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[795a55a813d303c3]::queries::mir_const, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>>
  23:     0x7f13de725501 - <rustc_middle[cf4061c8958768de]::dep_graph::dep_node::DepKind as rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::DepKind>::with_deps::<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[795a55a813d303c3]::queries::mir_const, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>>
  24:     0x7f13dcf4dac0 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::execute_job_incr<rustc_query_impl[795a55a813d303c3]::queries::mir_const, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>
  25:     0x7f13dcf4d01b - rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_execute_query::<rustc_query_impl[795a55a813d303c3]::queries::mir_const, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>
  26:     0x7f13dc502cf7 - rustc_mir_transform[6ecad65af303aadd]::mir_promoted
  27:     0x7f13de767e51 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[795a55a813d303c3]::queries::mir_promoted, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 16usize]>>::{closure#0}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 16usize]>>
  28:     0x7f13de71e1bd - <rustc_middle[cf4061c8958768de]::dep_graph::dep_node::DepKind as rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::DepKind>::with_deps::<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[795a55a813d303c3]::queries::mir_promoted, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 16usize]>>
  29:     0x7f13dc9f6f59 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::execute_job_incr<rustc_query_impl[795a55a813d303c3]::queries::mir_promoted, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>
  30:     0x7f13dc9f5bbe - rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_execute_query::<rustc_query_impl[795a55a813d303c3]::queries::mir_promoted, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>
  31:     0x7f13dd81cdb5 - <rustc_query_impl[795a55a813d303c3]::Queries as rustc_middle[cf4061c8958768de]::ty::query::QueryEngine>::mir_promoted
  32:     0x7f13dc5ef1e3 - rustc_mir_transform[6ecad65af303aadd]::mir_drops_elaborated_and_const_checked
  33:     0x7f13de76eeb1 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[795a55a813d303c3]::queries::mir_drops_elaborated_and_const_checked, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>>
  34:     0x7f13de724891 - <rustc_middle[cf4061c8958768de]::dep_graph::dep_node::DepKind as rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::DepKind>::with_deps::<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[795a55a813d303c3]::queries::mir_drops_elaborated_and_const_checked, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>>
  35:     0x7f13dcd7d070 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::execute_job_incr<rustc_query_impl[795a55a813d303c3]::queries::mir_drops_elaborated_and_const_checked, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#1}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[2859ca24dae969e5]::option::Option<(rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>>
  36:     0x7f13dcd7c5cb - rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_execute_query::<rustc_query_impl[795a55a813d303c3]::queries::mir_drops_elaborated_and_const_checked, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>
  37:     0x7f13dceee12a - rustc_mir_transform[6ecad65af303aadd]::optimized_mir
  38:     0x7f13dcef1455 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::execute_job_incr<rustc_query_impl[795a55a813d303c3]::queries::optimized_mir, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>
  39:     0x7f13dceed750 - rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_execute_query::<rustc_query_impl[795a55a813d303c3]::queries::optimized_mir, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>
  40:     0x7f13dcd474ef - rustc_monomorphize[3742297bb00b1687]::collector::collect_neighbours
  41:     0x7f13dcd44187 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  42:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  43:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  44:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  45:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  46:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  47:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  48:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  49:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  50:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  51:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  52:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  53:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  54:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  55:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  56:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  57:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  58:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  59:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  60:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  61:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  62:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  63:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  64:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  65:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  66:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  67:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  68:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  69:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  70:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  71:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  72:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  73:     0x7f13dcd44626 - rustc_monomorphize[3742297bb00b1687]::collector::collect_items_rec
  74:     0x7f13dce98271 - rustc_data_structures[d8df482a503b4e16]::sync::par_for_each_in::<alloc[b5adc9823d408db1]::vec::Vec<rustc_middle[cf4061c8958768de]::mir::mono::MonoItem>, rustc_monomorphize[3742297bb00b1687]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
  75:     0x7f13dce97f50 - <rustc_session[8b35cc4b9a893792]::session::Session>::time::<(), rustc_monomorphize[3742297bb00b1687]::collector::collect_crate_mono_items::{closure#1}>
  76:     0x7f13dce97a09 - rustc_monomorphize[3742297bb00b1687]::collector::collect_crate_mono_items
  77:     0x7f13dce95d57 - rustc_monomorphize[3742297bb00b1687]::partitioning::collect_and_partition_mono_items
  78:     0x7f13dd235a90 - <std[eb24bce596941705]::thread::local::LocalKey<core[2859ca24dae969e5]::cell::Cell<*const ()>>>::with::<rustc_middle[cf4061c8958768de]::ty::context::tls::enter_context<rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::execute_job_incr<rustc_query_impl[795a55a813d303c3]::queries::collect_and_partition_mono_items, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[cf4061c8958768de]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[3bbe62cc4d6de6cb]::dep_graph::graph::DepNodeIndex)>
  79:     0x7f13dd23558d - rustc_query_system[3bbe62cc4d6de6cb]::query::plumbing::try_execute_query::<rustc_query_impl[795a55a813d303c3]::queries::collect_and_partition_mono_items, rustc_query_impl[795a55a813d303c3]::plumbing::QueryCtxt>
  80:     0x7f13dd23502d - <rustc_query_impl[795a55a813d303c3]::Queries as rustc_middle[cf4061c8958768de]::ty::query::QueryEngine>::collect_and_partition_mono_items
  81:     0x7f13dd286b25 - rustc_codegen_ssa[c3c07222a87f26e1]::base::codegen_crate::<rustc_codegen_llvm[955e4dcdadf0f118]::LlvmCodegenBackend>
  82:     0x7f13dd2868fa - <rustc_codegen_llvm[955e4dcdadf0f118]::LlvmCodegenBackend as rustc_codegen_ssa[c3c07222a87f26e1]::traits::backend::CodegenBackend>::codegen_crate
  83:     0x7f13dd0e3352 - <rustc_session[8b35cc4b9a893792]::session::Session>::time::<alloc[b5adc9823d408db1]::boxed::Box<dyn core[2859ca24dae969e5]::any::Any>, rustc_interface[39fd61ecdbea2b33]::passes::start_codegen::{closure#0}>
  84:     0x7f13dd0e2e1d - rustc_interface[39fd61ecdbea2b33]::passes::start_codegen
  85:     0x7f13dd0de214 - <rustc_middle[cf4061c8958768de]::ty::context::GlobalCtxt>::enter::<<rustc_interface[39fd61ecdbea2b33]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[2859ca24dae969e5]::result::Result<alloc[b5adc9823d408db1]::boxed::Box<dyn core[2859ca24dae969e5]::any::Any>, rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>>
  86:     0x7f13dd0dc8b8 - <rustc_interface[39fd61ecdbea2b33]::queries::Queries>::ongoing_codegen
  87:     0x7f13dd0dc0c1 - <rustc_interface[39fd61ecdbea2b33]::interface::Compiler>::enter::<rustc_driver_impl[dca6eaec99318d6f]::run_compiler::{closure#1}::{closure#2}, core[2859ca24dae969e5]::result::Result<core[2859ca24dae969e5]::option::Option<rustc_interface[39fd61ecdbea2b33]::queries::Linker>, rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>>
  88:     0x7f13dd0d72e1 - rustc_span[da8828833cd3cbdf]::set_source_map::<core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>, rustc_interface[39fd61ecdbea2b33]::interface::run_compiler<core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>, rustc_driver_impl[dca6eaec99318d6f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  89:     0x7f13dd0d688f - std[eb24bce596941705]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[39fd61ecdbea2b33]::util::run_in_thread_pool_with_globals<rustc_interface[39fd61ecdbea2b33]::interface::run_compiler<core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>, rustc_driver_impl[dca6eaec99318d6f]::run_compiler::{closure#1}>::{closure#0}, core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>>
  90:     0x7f13dd6e6551 - <<std[eb24bce596941705]::thread::Builder>::spawn_unchecked_<rustc_interface[39fd61ecdbea2b33]::util::run_in_thread_pool_with_globals<rustc_interface[39fd61ecdbea2b33]::interface::run_compiler<core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>, rustc_driver_impl[dca6eaec99318d6f]::run_compiler::{closure#1}>::{closure#0}, core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2859ca24dae969e5]::result::Result<(), rustc_span[da8828833cd3cbdf]::ErrorGuaranteed>>::{closure#1} as core[2859ca24dae969e5]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  91:     0x7f13df0ab3b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h118c6a9a1198fa04
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/alloc/src/boxed.rs:1973:9
  92:     0x7f13df0ab3b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h227ba44e92b651ba
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/alloc/src/boxed.rs:1973:9
  93:     0x7f13df0ab3b5 - std::sys::unix::thread::Thread::new::thread_start::h0c1a778c12429624
                               at /rustc/d0f204e4d750b62f9d6c2593405e828757126832/library/std/src/sys/unix/thread.rs:108:17
  94:     0x7f13daa9ebb5 - <unknown>
  95:     0x7f13dab20d90 - <unknown>
  96:                0x0 - <unknown>

error: 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.71.0-nightly (d0f204e4d 2023-04-16) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C linker=clang -C incremental=[REDACTED] -C link-arg=--ld-path=/usr/bin/mold

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

query stack during panic:
#0 [mir_built] building MIR for `game::<impl at src/game.rs:24:22: 24:29>::inspect_mut::{closure#0}::{closure#8}::{closure#0}`
#1 [mir_const] preparing `game::<impl at src/game.rs:24:22: 24:29>::inspect_mut::{closure#0}::{closure#8}::{closure#0}` for borrow checking
#2 [mir_promoted] processing MIR for `game::<impl at src/game.rs:24:22: 24:29>::inspect_mut::{closure#0}::{closure#8}::{closure#0}`
#3 [mir_drops_elaborated_and_const_checked] elaborating drops for `game::<impl at src/game.rs:24:22: 24:29>::inspect_mut::{closure#0}::{closure#8}::{closure#0}`
#4 [optimized_mir] optimizing MIR for `game::<impl at src/game.rs:24:22: 24:29>::inspect_mut::{closure#0}::{closure#8}::{closure#0}`
#5 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (d0f204e4d 2023-04-16)
binary: rustc
commit-hash: d0f204e4d750b62f9d6c2593405e828757126832
commit-date: 2023-04-16
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Build help

Needs SFML as a non-rust dependency.
See https://github.com/jeremyletang/rust-sfml#environment-variables

Easiest way should be to download the source and build it with CMake, and point the above environment variables to the appropriate locations in your download folder.

@crumblingstatue crumblingstatue added the C-bug Category: This is a bug. label Apr 17, 2023
@Noratrieb Noratrieb self-assigned this Apr 17, 2023
@Noratrieb
Copy link
Member

Assigning myself to minimize, hopefully writing some cargo-minimize docs for incremental on the way.

@matthiaskrgr matthiaskrgr added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-incr-comp Area: Incremental compilation labels Apr 17, 2023
@Noratrieb
Copy link
Member

Noratrieb commented Apr 18, 2023

I have an MCVE (less minimal than I had hoped sadly)

pub struct TileDef {
    pub layer: (),
    #[cfg(second)]
    pub blend_graphic: String,
}

pub(crate) struct GameState {
    pub(crate) tile_db: TileDb,
}

impl GameState {
    fn inspect_mut(&mut self) {
        egui_inspect_derive::expand! {}
    }
}

fn new() -> GameState {
    loop {}
}

fn main() {
    let mut app = new();
    app.inspect_mut();
}
// this is actually used
pub struct TileDb {
    unknown_bg: TileDef,
}

impl std::fmt::Debug for TileDb {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        loop {}
    }
}

pub struct PlatformOutput {
    pub copied_text: String,
}

pub fn output_mut<R>(writer: impl FnOnce(&mut PlatformOutput) -> R) -> R {
    loop {}
}

Where egui_inspect_derive is a proc macro crate containing

use proc_macro::TokenStream;
use quote::quote;

#[proc_macro]
pub fn expand(_: TokenStream) -> TokenStream {
    quote! {
        output_mut(|o| o.copied_text = "".into());
        output_mut(|o| o.copied_text = format!("{:?}", self.tile_db));
    }
    .into()
}

I cannot manually expand the macro. I have already tried -Zincremental-relative-spans=no which didn't help. I will continue investigating this.

To reproduce, first compile it without any cfgs and then enable second.

@Noratrieb Noratrieb added the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Apr 18, 2023
@WaffleLapkin
Copy link
Member

Bisection results using Noratrieb/game-wip-dontplay@cc39bd4.
cc @cjgillot, the bisection points at #107270.

searched nightlies: from nightly-2021-01-01 to nightly-2023-04-19
regressed nightly: nightly-2023-03-17
searched commit range: ab65486...511364e
regressed commit: e386217

bisected with cargo-bisect-rustc v0.6.6

Host triple: aarch64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start 2021-01-01 --regress success --script ./repro.sh --access github

@Noratrieb
Copy link
Member

I've found some potentially interesting bits:
I've printed the result from both sessions and got the following diff:

128c128
<                 span: src/main.rs: 13: 9: 13: 40(#20),
---
>                 span: src/main.rs: 13: 9: 13: 40(#224),
165c165
<                 span: src/main.rs: 13: 9: 13: 40(#20),
---
>                 span: src/main.rs: 13: 9: 13: 40(#224),
230c230
<           did: DefId(0: 20~mantle_diver[
---
>           did: DefId(0: 21~mantle_diver[
248c248
<             lint_root: HirId(DefId(0: 8~mantle_diver[
---
>             lint_root: HirId(DefId(0: 9~mantle_diver[
264c264
<             lint_root: HirId(DefId(0: 8~mantle_diver[
---
>             lint_root: HirId(DefId(0: 9~mantle_diver[

Some DefIds are different (makes sense, a field was added) and two spans changed their SyntaxContext drastically. These are spans that are expanded from the proc macro using Span::call_site.

before
Steal{
  value: RwLock(RefCell{
    value: Some(Body{
      basic_blocks: BasicBlocks{
        basic_blocks: [
          BasicBlockData{
            statements: [
              StorageLive(_3),
              StorageLive(_4),
              StorageLive(_5),
              StorageLive(_6),
              StorageLive(_7),
              StorageLive(_8),
              StorageLive(_9),
              _9=[
                const""
              ],
              _8=&_9,
              _7=&(*_8),
              _6=move_7as&[
                &str
              ](Pointer(Unsize)),
              StorageDead(_7),
              StorageLive(_10),
              StorageLive(_11),
              StorageLive(_12),
              StorageLive(_13),
              StorageLive(_14),
              StorageLive(_15),
              StorageLive(_16),
              _16=&(*(_1.0: &TileDb)),
              _15=&(*_16)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#9),
                scope: scope[
                  0
                ]
              },
              kind: _14=core: : fmt: : ArgumentV1: : <'_>: : new_debug: : <TileDb>(move_15)->[
                return: bb1,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_15),
              _13=[
                move_14
              ],
              StorageDead(_14),
              _12=&_13,
              _11=&(*_12),
              _10=move_11as&[
                core: : fmt: : ArgumentV1<'_>
              ](Pointer(Unsize)),
              StorageDead(_11)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
                scope: scope[
                  0
                ]
              },
              kind: _5=Arguments: : <'_>: : new_v1(move_6,
              move_10)->[
                return: bb2,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_10),
              StorageDead(_6)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 19: 120: 80(#7),
                scope: scope[
                  0
                ]
              },
              kind: _4=format(move_5)->[
                return: bb3,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_5),
              FakeRead(ForLet(None),
              _4),
              StorageDead(_16),
              StorageDead(_13),
              StorageDead(_12),
              StorageDead(_9),
              StorageDead(_8),
              _3=move_4
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 122: 5: 122: 6(#7),
                scope: scope[
                  0
                ]
              },
              kind: drop(_4)->[
                return: bb4,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_4)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#20),
                scope: scope[
                  0
                ]
              },
              kind: drop(((*_2).0: std: : string: : String))->[
                return: bb5,
                unwind: bb6
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              ((*_2).0: std: : string: : String)=move_3,
              _0=const()
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 39: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: drop(_3)->[
                return: bb7,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              ((*_2).0: std: : string: : String)=move_3
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#20),
                scope: scope[
                  0
                ]
              },
              kind: goto->bb8
            }),
            is_cleanup: true
          },
          BasicBlockData{
            statements: [
              StorageDead(_3)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 40: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: return
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 39: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: drop(_3)->[
                return: bb9,
                unwindterminate
              ]
            }),
            is_cleanup: true
          },
          BasicBlockData{
            statements: [],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: resume
            }),
            is_cleanup: true
          }
        ],
        cache: Cache{
          predecessors: OnceCell(Uninit),
          switch_sources: OnceCell(Uninit),
          is_cyclic: OnceCell(Uninit),
          postorder: OnceCell(Uninit)
        }
      },
      phase: Built,
      pass_count: 0,
      source: MirSource{
        instance: Item(WithOptConstParam{
          did: DefId(0: 20~mantle_diver[
            d58e
          ]: : {
            impl#0
          }: : inspect_mut: : {
            closure#1
          }),
          const_param_did: None
        }),
        promoted: None
      },
      source_scopes: [
        SourceScopeData{
          span: src/main.rs: 13: 9: 13: 40(#5),
          parent_scope: None,
          inlined: None,
          inlined_parent_scope: None,
          local_data: Set(SourceScopeLocalData{
            lint_root: HirId(DefId(0: 8~mantle_diver[
              d58e
            ]: : {
              impl#0
            }: : inspect_mut).21),
            safety: Safe
          })
        },
        SourceScopeData{
          span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 9: 122: 6(#7),
          parent_scope: Some(scope[
            0
          ]),
          inlined: None,
          inlined_parent_scope: None,
          local_data: Set(SourceScopeLocalData{
            lint_root: HirId(DefId(0: 8~mantle_diver[
              d58e
            ]: : {
              impl#0
            }: : inspect_mut).21),
            safety: Safe
          })
        }
      ],
      generator: None,
      local_decls: [
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: (),
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 9(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: [
            closure@src/main.rs: 13: 9: 13: 40
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(User(Var(VarBindingForm{
            binding_mode: BindByValue(Not),
            opt_ty_info: None,
            opt_match_place: Some((None,
            src/main.rs: 13: 9: 13: 40(#5))),
            pat_span: src/main.rs: 13: 9: 13: 40(#5)
          }))),
          internal: false,
          ty: &mutPlatformOutput,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: std: : string: : String,
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 119: 23: 122: 6(#7),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(User(Var(VarBindingForm{
            binding_mode: BindByValue(Not),
            opt_ty_info: None,
            opt_match_place: Some((None,
            /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 19: 120: 80(#7))),
            pat_span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 13: 120: 16(#7)
          }))),
          internal: false,
          ty: std: : string: : String,
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 13: 120: 16(#7),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: std: : fmt: : Arguments<'_>,
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            &str
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            &str;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            &str;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: [
            &str;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            core: : fmt: : ArgumentV1<'_>
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            core: : fmt: : ArgumentV1<'_>;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            core: : fmt: : ArgumentV1<'_>;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: [
            core: : fmt: : ArgumentV1<'_>;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: core: : fmt: : ArgumentV1<'_>,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &TileDb,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: &TileDb,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#9),
            scope: scope[
              0
            ]
          }
        }
      ],
      user_type_annotations: [
        CanonicalUserTypeAnnotation{
          user_ty: Canonical{
            value: TypeOf(DefId(2: 9040~core[
              44ff
            ]: : fmt: : {
              impl#4
            }: : new_v1),
            UserSubsts{
              substs: [
                ReLateBound(DebruijnIndex(0),
                BoundRegion{
                  var: 0,
                  kind: BrAnon(None)
                })
              ],
              user_self_ty: Some(UserSelfTy{
                impl_def_id: DefId(2: 9037~core[
                  44ff
                ]: : fmt: : {
                  impl#4
                }),
                self_ty: std: : fmt: : Arguments<'_>
              })
            }),
            max_universe: U0,
            variables: [
              CanonicalVarInfo{
                kind: Region(U0)
              },
              CanonicalVarInfo{
                kind: Region(U0)
              }
            ]
          },
          span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
          inferred_ty: fn(&[
            &'staticstr
          ],
          &[
            core: : fmt: : ArgumentV1<'_>
          ])->std: : fmt: : Arguments<'_>{
            std: : fmt: : Arguments: : <'_>: : new_v1
          }
        },
        CanonicalUserTypeAnnotation{
          user_ty: Canonical{
            value: TypeOf(DefId(2: 41685~core[
              44ff
            ]: : fmt: : {
              impl#3
            }: : new_debug),
            UserSubsts{
              substs: [
                ReLateBound(DebruijnIndex(0),
                BoundRegion{
                  var: 0,
                  kind: BrAnon(None)
                }),
                ^1
              ],
              user_self_ty: Some(UserSelfTy{
                impl_def_id: DefId(2: 9030~core[
                  44ff
                ]: : fmt: : {
                  impl#3
                }),
                self_ty: core: : fmt: : ArgumentV1<'_>
              })
            }),
            max_universe: U0,
            variables: [
              CanonicalVarInfo{
                kind: Region(U0)
              },
              CanonicalVarInfo{
                kind: Ty(General(U0))
              },
              CanonicalVarInfo{
                kind: Region(U0)
              }
            ]
          },
          span: src/main.rs: 13: 9: 13: 40(#9),
          inferred_ty: for<'b>fn(&'bTileDb)->core: : fmt: : ArgumentV1<'b>{
            core: : fmt: : ArgumentV1: : <'_>: : new_debug: : <TileDb>
          }
        }
      ],
      arg_count: 2,
      spread_arg: None,
      var_debug_info: [
        VarDebugInfo{
          name: "o",
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          },
          value: _2,
          argument_index: Some(2)
        },
        VarDebugInfo{
          name: "self__tile_db",
          source_info: SourceInfo{
            span: src/main.rs: 12: 25: 12: 29(#0),
            scope: scope[
              0
            ]
          },
          value: (*(_1.0: &TileDb)),
          argument_index: None
        },
        VarDebugInfo{
          name: "res",
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 13: 120: 16(#7),
            scope: scope[
              1
            ]
          },
          value: _4,
          argument_index: None
        }
      ],
      span: src/main.rs: 13: 9: 13: 40(#5),
      required_consts: [],
      is_polymorphic: false,
      injection_phase: None,
      tainted_by_errors: None
    })
  })
}
after
Steal{
  value: RwLock(RefCell{
    value: Some(Body{
      basic_blocks: BasicBlocks{
        basic_blocks: [
          BasicBlockData{
            statements: [
              StorageLive(_3),
              StorageLive(_4),
              StorageLive(_5),
              StorageLive(_6),
              StorageLive(_7),
              StorageLive(_8),
              StorageLive(_9),
              _9=[
                const""
              ],
              _8=&_9,
              _7=&(*_8),
              _6=move_7as&[
                &str
              ](Pointer(Unsize)),
              StorageDead(_7),
              StorageLive(_10),
              StorageLive(_11),
              StorageLive(_12),
              StorageLive(_13),
              StorageLive(_14),
              StorageLive(_15),
              StorageLive(_16),
              _16=&(*(_1.0: &TileDb)),
              _15=&(*_16)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#9),
                scope: scope[
                  0
                ]
              },
              kind: _14=core: : fmt: : ArgumentV1: : <'_>: : new_debug: : <TileDb>(move_15)->[
                return: bb1,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_15),
              _13=[
                move_14
              ],
              StorageDead(_14),
              _12=&_13,
              _11=&(*_12),
              _10=move_11as&[
                core: : fmt: : ArgumentV1<'_>
              ](Pointer(Unsize)),
              StorageDead(_11)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
                scope: scope[
                  0
                ]
              },
              kind: _5=Arguments: : <'_>: : new_v1(move_6,
              move_10)->[
                return: bb2,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_10),
              StorageDead(_6)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 19: 120: 80(#7),
                scope: scope[
                  0
                ]
              },
              kind: _4=format(move_5)->[
                return: bb3,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_5),
              FakeRead(ForLet(None),
              _4),
              StorageDead(_16),
              StorageDead(_13),
              StorageDead(_12),
              StorageDead(_9),
              StorageDead(_8),
              _3=move_4
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 122: 5: 122: 6(#7),
                scope: scope[
                  0
                ]
              },
              kind: drop(_4)->[
                return: bb4,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              StorageDead(_4)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#224),
                scope: scope[
                  0
                ]
              },
              kind: drop(((*_2).0: std: : string: : String))->[
                return: bb5,
                unwind: bb6
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              ((*_2).0: std: : string: : String)=move_3,
              _0=const()
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 39: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: drop(_3)->[
                return: bb7,
                unwind: bb9
              ]
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [
              ((*_2).0: std: : string: : String)=move_3
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#224),
                scope: scope[
                  0
                ]
              },
              kind: goto->bb8
            }),
            is_cleanup: true
          },
          BasicBlockData{
            statements: [
              StorageDead(_3)
            ],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 40: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: return
            }),
            is_cleanup: false
          },
          BasicBlockData{
            statements: [],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 39: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: drop(_3)->[
                return: bb9,
                unwindterminate
              ]
            }),
            is_cleanup: true
          },
          BasicBlockData{
            statements: [],
            terminator: Some(Terminator{
              source_info: SourceInfo{
                span: src/main.rs: 13: 9: 13: 40(#5),
                scope: scope[
                  0
                ]
              },
              kind: resume
            }),
            is_cleanup: true
          }
        ],
        cache: Cache{
          predecessors: OnceCell(Uninit),
          switch_sources: OnceCell(Uninit),
          is_cyclic: OnceCell(Uninit),
          postorder: OnceCell(Uninit)
        }
      },
      phase: Built,
      pass_count: 0,
      source: MirSource{
        instance: Item(WithOptConstParam{
          did: DefId(0: 21~mantle_diver[
            d58e
          ]: : {
            impl#0
          }: : inspect_mut: : {
            closure#1
          }),
          const_param_did: None
        }),
        promoted: None
      },
      source_scopes: [
        SourceScopeData{
          span: src/main.rs: 13: 9: 13: 40(#5),
          parent_scope: None,
          inlined: None,
          inlined_parent_scope: None,
          local_data: Set(SourceScopeLocalData{
            lint_root: HirId(DefId(0: 9~mantle_diver[
              d58e
            ]: : {
              impl#0
            }: : inspect_mut).21),
            safety: Safe
          })
        },
        SourceScopeData{
          span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 9: 122: 6(#7),
          parent_scope: Some(scope[
            0
          ]),
          inlined: None,
          inlined_parent_scope: None,
          local_data: Set(SourceScopeLocalData{
            lint_root: HirId(DefId(0: 9~mantle_diver[
              d58e
            ]: : {
              impl#0
            }: : inspect_mut).21),
            safety: Safe
          })
        }
      ],
      generator: None,
      local_decls: [
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: (),
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 9(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: [
            closure@src/main.rs: 13: 9: 13: 40
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(User(Var(VarBindingForm{
            binding_mode: BindByValue(Not),
            opt_ty_info: None,
            opt_match_place: Some((None,
            src/main.rs: 13: 9: 13: 40(#5))),
            pat_span: src/main.rs: 13: 9: 13: 40(#5)
          }))),
          internal: false,
          ty: &mutPlatformOutput,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: std: : string: : String,
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 119: 23: 122: 6(#7),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(User(Var(VarBindingForm{
            binding_mode: BindByValue(Not),
            opt_ty_info: None,
            opt_match_place: Some((None,
            /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 19: 120: 80(#7))),
            pat_span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 13: 120: 16(#7)
          }))),
          internal: false,
          ty: std: : string: : String,
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 13: 120: 16(#7),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: std: : fmt: : Arguments<'_>,
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            &str
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            &str;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            &str;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: [
            &str;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            core: : fmt: : ArgumentV1<'_>
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            core: : fmt: : ArgumentV1<'_>;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: &[
            core: : fmt: : ArgumentV1<'_>;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: [
            core: : fmt: : ArgumentV1<'_>;1
          ],
          user_ty: None,
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: core: : fmt: : ArgumentV1<'_>,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Mut,
          local_info: Set(Boring),
          internal: false,
          ty: &TileDb,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#9),
            scope: scope[
              0
            ]
          }
        },
        LocalDecl{
          mutability: Not,
          local_info: Set(Boring),
          internal: false,
          ty: &TileDb,
          user_ty: None,
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#9),
            scope: scope[
              0
            ]
          }
        }
      ],
      user_type_annotations: [
        CanonicalUserTypeAnnotation{
          user_ty: Canonical{
            value: TypeOf(DefId(2: 9040~core[
              44ff
            ]: : fmt: : {
              impl#4
            }: : new_v1),
            UserSubsts{
              substs: [
                ReLateBound(DebruijnIndex(0),
                BoundRegion{
                  var: 0,
                  kind: BrAnon(None)
                })
              ],
              user_self_ty: Some(UserSelfTy{
                impl_def_id: DefId(2: 9037~core[
                  44ff
                ]: : fmt: : {
                  impl#4
                }),
                self_ty: std: : fmt: : Arguments<'_>
              })
            }),
            max_universe: U0,
            variables: [
              CanonicalVarInfo{
                kind: Region(U0)
              },
              CanonicalVarInfo{
                kind: Region(U0)
              }
            ]
          },
          span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 39: 120: 79(#9),
          inferred_ty: fn(&[
            &'staticstr
          ],
          &[
            core: : fmt: : ArgumentV1<'_>
          ])->std: : fmt: : Arguments<'_>{
            std: : fmt: : Arguments: : <'_>: : new_v1
          }
        },
        CanonicalUserTypeAnnotation{
          user_ty: Canonical{
            value: TypeOf(DefId(2: 41685~core[
              44ff
            ]: : fmt: : {
              impl#3
            }: : new_debug),
            UserSubsts{
              substs: [
                ReLateBound(DebruijnIndex(0),
                BoundRegion{
                  var: 0,
                  kind: BrAnon(None)
                }),
                ^1
              ],
              user_self_ty: Some(UserSelfTy{
                impl_def_id: DefId(2: 9030~core[
                  44ff
                ]: : fmt: : {
                  impl#3
                }),
                self_ty: core: : fmt: : ArgumentV1<'_>
              })
            }),
            max_universe: U0,
            variables: [
              CanonicalVarInfo{
                kind: Region(U0)
              },
              CanonicalVarInfo{
                kind: Ty(General(U0))
              },
              CanonicalVarInfo{
                kind: Region(U0)
              }
            ]
          },
          span: src/main.rs: 13: 9: 13: 40(#9),
          inferred_ty: for<'b>fn(&'bTileDb)->core: : fmt: : ArgumentV1<'b>{
            core: : fmt: : ArgumentV1: : <'_>: : new_debug: : <TileDb>
          }
        }
      ],
      arg_count: 2,
      spread_arg: None,
      var_debug_info: [
        VarDebugInfo{
          name: "o",
          source_info: SourceInfo{
            span: src/main.rs: 13: 9: 13: 40(#5),
            scope: scope[
              0
            ]
          },
          value: _2,
          argument_index: Some(2)
        },
        VarDebugInfo{
          name: "self__tile_db",
          source_info: SourceInfo{
            span: src/main.rs: 12: 25: 12: 29(#0),
            scope: scope[
              0
            ]
          },
          value: (*(_1.0: &TileDb)),
          argument_index: None
        },
        VarDebugInfo{
          name: "res",
          source_info: SourceInfo{
            span: /home/nilsh/projects/rust/library/alloc/src/macros.rs: 120: 13: 120: 16(#7),
            scope: scope[
              1
            ]
          },
          value: _4,
          argument_index: None
        }
      ],
      span: src/main.rs: 13: 9: 13: 40(#5),
      required_consts: [],
      is_polymorphic: false,
      injection_phase: None,
      tainted_by_errors: None
    })
  })
}

@cjgillot
Copy link
Contributor

The fact that DefIds are different is not an issue, those are just a shorthand, what's relevant is the DefPathHash.
I'm a bit more worried about the change in SyntaxContext. This may indicate a hash collision in expansions.
Thanks a lot for the investigation.

@cjgillot cjgillot self-assigned this Apr 22, 2023
@Noratrieb Noratrieb removed their assignment Apr 23, 2023
@cjgillot
Copy link
Contributor

Writing my progress here before forgetting about it.

First execution:

  1. Build MIR for mantle_diver.{impl#0}-inspect_mut-{closure#0};
  2. This requires marking some spans with Replace, so creates expansion expn5, and syntax context 40;
  3. Builds MIR for mantle_diver.{impl#0}-inspect_mut-{closure#1};
  4. This requires marking some other spans with Replace, so creates expansion expn6, and syntax context 41.

Subtlety: expn5 and expn6 are created from the same span information, because egui_inspect_derive does not give the two closures different spans. So these expansions' hashes collide. Because hash collisions are bad, we increment the disambiguator for expn6.
expn5 gets hash 14985880015710967966
expn6 gets hash 14036241682333888583

Second execution:

  1. MIR for mantle_diver.{impl#0}-inspect_mut-{closure#0} is green, so is not re-computed;
  2. MIR for mantle_diver.{impl#0}-inspect_mut-{closure#1} is green too;
  3. Processing MIR for mantle_diver.{impl#0}-inspect_mut-{closure#1} depends on the layout of TileDef;
  4. MIR for mantle_diver.{impl#0}-inspect_mut-{closure#1} is re-built;
  5. This requires marking the span with Replace, so to create an expansion and a syntax context;
  6. As closure#0 has not been built, there is no hash collision, so the expansion for closure#1 has hash 14985880015710967966, which is not the expected hash 14036241682333888583;
  7. ICE.

@cjgillot
Copy link
Contributor

The ICE itself should have been removed by #111952, in which MIR building does not create Replace expansions any more.

@cjgillot cjgillot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label May 27, 2023
@cjgillot cjgillot removed their assignment May 27, 2023
@WaffleLapkin
Copy link
Member

@cjgillot did #111952 fix the underlying problem, or only the way that it's reached here? (i.e. would it be possible to reach a similar ICE with non Replace expansions)

@cjgillot
Copy link
Contributor

It just removed the symptom. The underlying bug is still there, and should be fixed by #111815. I don't think it currently possible to trigger the ICE, not until someone adds post-lowering expansions back.

@bors bors closed this as completed in 36526cf May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants