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 bug while compiling sysroot with -Zmir-opt-level=2 #74946

Closed
bjorn3 opened this issue Jul 30, 2020 · 6 comments · Fixed by #89476
Closed

Incremental recompilation bug while compiling sysroot with -Zmir-opt-level=2 #74946

bjorn3 opened this issue Jul 30, 2020 · 6 comments · Fixed by #89476
Assignees
Labels
A-incr-comp Area: Incremental compilation A-metadata Area: Crate metadata A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Jul 30, 2020

Code

Assuming that you copied $(rustc --print sysroot)/lib/rustlib/src/rust to ./sysroot_src.

#- Cargo.toml
[package]
authors = ["bjorn3 <bjorn3@users.noreply.github.com>"]
name = "sysroot"
version = "0.0.0"

[dependencies]
core = { path = "./sysroot_src/library/core" }
compiler_builtins = "0.1"
alloc = { path = "./sysroot_src/library/alloc" }
std = { path = "./sysroot_src/library/std", features = ["panic_unwind"] }

[patch.crates-io]
rustc-std-workspace-core = { path = "./sysroot_src/library/rustc-std-workspace-core" }
rustc-std-workspace-alloc = { path = "./sysroot_src/library/rustc-std-workspace-alloc" }
//- src/lib.rs
// empty
RUSTFLAGS="-Zmir-opt-level=2" cargo build; rm -r target/debug/{build,deps,examples}; RUSTFLAGS="-Zmir-opt-level=2" cargo build

Meta

rustc --version --verbose:

rustc 1.47.0-nightly (db0492ace 2020-07-29)
binary: rustc
commit-hash: db0492ace429cfeb3567e2c04e300be7df9972ff
commit-date: 2020-07-29
host: x86_64-unknown-linux-gnu
release: 1.47.0-nightly
LLVM version: 10.0

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/librustc_metadata/rmeta/decoder.rs:1886:22
Backtrace

stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at library/std/src/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at library/std/src/sys_common/backtrace.rs:59
   4: core::fmt::write
             at library/core/src/fmt/mod.rs:1117
   5: std::io::Write::write_fmt
             at library/std/src/io/mod.rs:1510
   6: std::sys_common::backtrace::_print
             at library/std/src/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at library/std/src/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at library/std/src/panicking.rs:198
   9: std::panicking::default_hook
             at library/std/src/panicking.rs:217
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at library/std/src/panicking.rs:530
  12: rust_begin_unwind
             at library/std/src/panicking.rs:437
  13: core::panicking::panic_fmt
             at library/core/src/panicking.rs:85
  14: core::panicking::panic
             at library/core/src/panicking.rs:50
  15: rustc_span::hygiene::decode_expn_id
  16: <rustc_span::hygiene::SyntaxContextData as rustc_serialize::serialize::Decodable>::decode
  17: rustc_span::hygiene::decode_syntax_context
  18: <rustc_metadata::rmeta::decoder::DecodeContext as rustc_serialize::serialize::SpecializedDecoder<rustc_span::span_encoding::Span>>::specialized_decode
  19: <rustc_middle::mir::SourceInfo as rustc_serialize::serialize::Decodable>::decode
  20: <rustc_middle::mir::Statement as rustc_serialize::serialize::Decodable>::decode
  21: rustc_serialize::serialize::Decoder::read_seq
  22: <rustc_middle::mir::BasicBlockData as rustc_serialize::serialize::Decodable>::decode
  23: rustc_serialize::serialize::Decoder::read_seq
  24: <rustc_middle::mir::Body as rustc_serialize::serialize::Decodable>::decode
  25: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_optimized_mir
  26: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
  27: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  28: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
  29: rustc_query_system::query::plumbing::get_query_impl
  30: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
  31: rustc_mir::monomorphize::collector::collect_neighbours
  32: rustc_mir::monomorphize::collector::collect_items_rec
  33: rustc_mir::monomorphize::collector::collect_items_rec
  34: rustc_mir::monomorphize::collector::collect_items_rec
  35: rustc_mir::monomorphize::collector::collect_items_rec
  36: rustc_mir::monomorphize::collector::collect_items_rec
  37: rustc_mir::monomorphize::collector::collect_items_rec
  38: rustc_mir::monomorphize::collector::collect_items_rec
  39: rustc_mir::monomorphize::collector::collect_items_rec
  40: rustc_mir::monomorphize::collector::collect_items_rec
  41: rustc_mir::monomorphize::collector::collect_items_rec
  42: rustc_mir::monomorphize::collector::collect_items_rec
  43: rustc_mir::monomorphize::collector::collect_items_rec
  44: rustc_mir::monomorphize::collector::collect_items_rec
  45: rustc_mir::monomorphize::collector::collect_items_rec
  46: rustc_mir::monomorphize::collector::collect_items_rec
  47: rustc_mir::monomorphize::collector::collect_items_rec
  48: rustc_mir::monomorphize::collector::collect_items_rec
  49: rustc_mir::monomorphize::collector::collect_items_rec
  50: rustc_mir::monomorphize::collector::collect_items_rec
  51: rustc_mir::monomorphize::collector::collect_items_rec
  52: rustc_mir::monomorphize::collector::collect_items_rec
  53: rustc_mir::monomorphize::collector::collect_items_rec
  54: rustc_mir::monomorphize::collector::collect_items_rec
  55: rustc_session::utils::<impl rustc_session::session::Session>::time
  56: rustc_mir::monomorphize::collector::collect_crate_mono_items
  57: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  58: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::collect_and_partition_mono_items>::compute
  59: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  60: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  61: rustc_data_structures::stack::ensure_sufficient_stack
  62: rustc_query_system::query::plumbing::force_query_impl
  63: rustc_middle::ty::query::force_from_dep_node
  64: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green
  65: rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_green_and_read
  66: rustc_data_structures::stack::ensure_sufficient_stack
  67: rustc_query_system::query::plumbing::get_query_impl
  68: rustc_metadata::rmeta::encoder::EncodeContext::encode_crate_root
  69: rustc_metadata::rmeta::encoder::encode_metadata_impl
  70: rustc_data_structures::sync::join
  71: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::encode_metadata
  72: rustc_middle::ty::context::TyCtxt::encode_metadata
  73: rustc_interface::passes::start_codegen
  74: rustc_middle::ty::context::tls::enter_global
  75: rustc_interface::queries::Queries::ongoing_codegen
  76: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  77: rustc_span::with_source_map
  78: rustc_interface::interface::create_compiler_and_run
  79: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

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

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

note: rustc 1.47.0-nightly (db0492ace 2020-07-29) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=2 -C prefer-dynamic -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type dylib --crate-type rlib

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `<alloc_crate::vec::IntoIter<T> as core::iter::Iterator>::next`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
#2 [exported_symbols] exported_symbols
end of query stack

@bjorn3 bjorn3 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 30, 2020
@bjorn3 bjorn3 changed the title Incremental recompilation bug while compiling sysroot Incremental recompilation bug while compiling sysroot with -Zmir-opt-level=2 Jul 30, 2020
@jonas-schievink jonas-schievink added A-incr-comp Area: Incremental compilation A-metadata Area: Crate metadata labels Jul 30, 2020
bjorn3 added a commit to rust-lang/rustc_codegen_cranelift that referenced this issue Aug 19, 2020
@pnkfelix
Copy link
Member

pnkfelix commented Dec 1, 2020

I reproduced this ICE locally.

On my end I did it by copying the git checkout of rust.git into ./sysroot_src, because I wasn't able to figure out the right rustup invocation to get it setup with files in $(rustc +nightly --print sysroot)/lib/rustlib/src/rust

  • (Oh, whoops, I think I was accidentally passing --target instead of --toolchain. Of course that wasn't going to work.)

well, not 100%, my query stack was a little different:

query stack during panic:
#0 [optimized_mir] optimizing MIR for `alloc::alloc::Global::alloc_impl`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack

but it seemed like a similar bug, nonetheless.

@pnkfelix
Copy link
Member

pnkfelix commented Dec 1, 2020

@rustbot modify labels: +I-prioritize

@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Dec 1, 2020
@camelid camelid added the A-mir-opt Area: MIR optimizations label Dec 1, 2020
@apiraino apiraino added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 2, 2020
@apiraino
Copy link
Contributor

apiraino commented Dec 2, 2020

Assigning P-medium as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 8, 2021

Now happens for gimli when retrying the repro. (with -Zmir-opt-level=2 replaced with -Zmir-opt-level=3 as it was changed in rustc)

backtrace
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:400:22
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e4a60327063e82413eed50a10df3b7d19b77bda0/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /rustc/e4a60327063e82413eed50a10df3b7d19b77bda0/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/e4a60327063e82413eed50a10df3b7d19b77bda0/library/core/src/panicking.rs:50:5
   3: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::hygiene::ExpnId>::decode
   4: rustc_span::hygiene::_DERIVE_rustc_serialize_Decodable_D_FOR_SyntaxContextData::<impl rustc_serialize::serialize::Decodable<__D> for rustc_span::hygiene::SyntaxContextData>::decode
   5: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::hygiene::SyntaxContext>::decode
   6: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::span_encoding::Span>::decode
   7: rustc_span::hygiene::_DERIVE_rustc_serialize_Decodable_D_FOR_ExpnData::<impl rustc_serialize::serialize::Decodable<__D> for rustc_span::hygiene::ExpnData>::decode
   8: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::hygiene::ExpnId>::decode
   9: rustc_span::hygiene::_DERIVE_rustc_serialize_Decodable_D_FOR_SyntaxContextData::<impl rustc_serialize::serialize::Decodable<__D> for rustc_span::hygiene::SyntaxContextData>::decode
  10: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::hygiene::SyntaxContext>::decode
  11: rustc_metadata::rmeta::decoder::<impl rustc_serialize::serialize::Decodable<rustc_metadata::rmeta::decoder::DecodeContext> for rustc_span::span_encoding::Span>::decode
  12: rustc_middle::mir::_DERIVE_rustc_serialize_Decodable_D_FOR_Statement::<impl rustc_serialize::serialize::Decodable<__D> for rustc_middle::mir::Statement>::decode
  13: rustc_serialize::serialize::Decoder::read_seq
  14: rustc_middle::mir::_DERIVE_rustc_serialize_Decodable_D_FOR_BasicBlockData::<impl rustc_serialize::serialize::Decodable<__D> for rustc_middle::mir::BasicBlockData>::decode
  15: rustc_serialize::serialize::Decoder::read_seq
  16: rustc_middle::mir::_DERIVE_rustc_serialize_Decodable_D_FOR_Body::<impl rustc_serialize::serialize::Decodable<__D> for rustc_middle::mir::Body>::decode
  17: rustc_metadata::rmeta::decoder::<impl rustc_metadata::creader::CrateMetadataRef>::get_optimized_mir
  18: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::optimized_mir
  19: rustc_query_system::query::plumbing::get_query_impl
  20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
  21: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
  22: rustc_mir::transform::inline::cycle::mir_inliner_callees
  23: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::mir_inliner_callees>::compute
  24: rustc_data_structures::stack::ensure_sufficient_stack
  25: rustc_query_system::query::plumbing::get_query_impl
  26: rustc_query_system::query::plumbing::get_query
  27: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_inliner_callees
  28: rustc_mir::transform::inline::cycle::mir_callgraph_reachable::process
  29: rustc_data_structures::stack::ensure_sufficient_stack
  30: rustc_mir::transform::inline::cycle::mir_callgraph_reachable::process
  31: rustc_data_structures::stack::ensure_sufficient_stack
  32: rustc_mir::transform::inline::cycle::mir_callgraph_reachable::process
  33: rustc_data_structures::stack::ensure_sufficient_stack
  34: rustc_mir::transform::inline::cycle::mir_callgraph_reachable::process
  35: rustc_mir::transform::inline::cycle::mir_callgraph_reachable
  36: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::mir_callgraph_reachable>::compute
  37: rustc_data_structures::stack::ensure_sufficient_stack
  38: rustc_query_system::query::plumbing::get_query_impl
  39: rustc_query_system::query::plumbing::get_query
  40: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_callgraph_reachable
  41: rustc_mir::transform::inline::Inliner::try_inlining
  42: rustc_mir::transform::inline::Inliner::process_blocks
  43: <rustc_mir::transform::inline::Inline as rustc_mir::transform::MirPass>::run_pass
  44: rustc_mir::transform::run_passes
  45: rustc_mir::transform::optimized_mir
  46: rustc_query_system::query::plumbing::get_query_impl
  47: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
  48: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
  49: rustc_mir::transform::inline::Inliner::try_inlining
  50: rustc_mir::transform::inline::Inliner::process_blocks
  51: <rustc_mir::transform::inline::Inline as rustc_mir::transform::MirPass>::run_pass
  52: rustc_mir::transform::run_passes
  53: rustc_mir::transform::optimized_mir
  54: rustc_query_system::query::plumbing::get_query_impl
  55: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
  56: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
  57: rustc_mir::transform::inline::Inliner::try_inlining
  58: rustc_mir::transform::inline::Inliner::process_blocks
  59: <rustc_mir::transform::inline::Inline as rustc_mir::transform::MirPass>::run_pass
  60: rustc_mir::transform::run_passes
  61: rustc_mir::transform::optimized_mir
  62: rustc_query_system::query::plumbing::get_query_impl
  63: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
  64: rustc_metadata::rmeta::encoder::EncodeContext::encode_crate_root
  65: rustc_metadata::rmeta::encoder::encode_metadata_impl
  66: rustc_data_structures::sync::join
  67: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_middle::middle::cstore::CrateStore for rustc_metadata::creader::CStore>::encode_metadata
  68: rustc_middle::ty::context::TyCtxt::encode_metadata
  69: rustc_interface::passes::QueryContext::enter
  70: rustc_interface::queries::Queries::ongoing_codegen
  71: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  72: rustc_span::with_source_map
  73: rustc_interface::interface::create_compiler_and_run
  74: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

error: Unrecognized option: 'clif'

error: could not compile `gimli`

To learn more, run the command again with --verbose.

It also gives an unstable fingerprint ICE for alloc::alloc::box_free when compiling panic_abort:

backtrace
thread 'rustc' panicked at 'Found unstable fingerprints for optimized_mir(alloc[3368]::alloc::box_free): Body { basic_blocks: [BasicBlockData { statements: [StorageLive(_3), StorageLive(_4), StorageLive(_5), StorageLive(_6), _6 = &_1, StorageLive(_19), StorageLive(_20), _20 = (*_6), StorageLive(_21), _21 = (_20.0: *const T), _19 = move _21 as *mut T (Misc), StorageDead(_21), StorageDead(_20), _5 = &(*_19), StorageDead(_19), _4 = &raw const (*_5), StorageDead(_6)], terminator: Some(Terminator { source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:20: 331:45 (#0), scope: scope[1] }, kind: _3 = core::intrinsics::size_of_val::<T>(move _4) -> bb1 }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_4), StorageDead(_5), StorageLive(_7), StorageLive(_8), StorageLive(_9), StorageLive(_10), _10 = &_1, StorageLive(_22), StorageLive(_23), _23 = (*_10), StorageLive(_24), _24 = (_23.0: *const T), _22 = move _24 as *mut T (Misc), StorageDead(_24), StorageDead(_23), _9 = &(*_22), StorageDead(_22), _8 = &raw const (*_9), StorageDead(_10)], terminator: Some(Terminator { source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:21: 332:51 (#0), scope: scope[2] }, kind: _7 = core::intrinsics::min_align_of_val::<T>(move _8) -> bb2 }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_8), StorageDead(_9), StorageLive(_11), StorageLive(_12), _12 = _3, StorageLive(_13), _13 = _7, StorageLive(_25), _25 = _12, StorageLive(_26), StorageLive(_27), _27 = _13, StorageLive(_28), _28 = _27, (_26.0: usize) = move _28, StorageDead(_28), StorageDead(_27), (_11.0: usize) = move _25, (_11.1: core::num::NonZeroUsize) = move _26, StorageDead(_26), StorageDead(_25), StorageDead(_13), StorageDead(_12), StorageLive(_14), _14 = &_2, StorageLive(_15), StorageLive(_16), StorageLive(_17), _17 = _1, StorageLive(_29), StorageLive(_30), StorageLive(_31), _31 = _17, StorageLive(_32), _32 = (_31.0: *const T), _30 = move _32 as *mut T (Misc), StorageDead(_32), StorageDead(_31), _29 = move _30 as *mut u8 (Misc), StorageDead(_30), StorageLive(_33), StorageLive(_34), StorageLive(_35), _35 = _29, _34 = move _35 as *const u8 (Pointer(MutToConstPointer)), StorageDead(_35), _33 = _34, (_16.0: *const u8) = move _33, StorageDead(_33), StorageDead(_34), StorageDead(_29), StorageDead(_17), StorageLive(_36), _36 = move _16, StorageLive(_37), StorageLive(_38), _38 = _36, StorageLive(_39), _39 = (_38.0: *const u8), _37 = move _39 as *mut u8 (Misc), StorageDead(_39), StorageDead(_38), StorageLive(_40), StorageLive(_41), StorageLive(_42), _42 = _37, _41 = move _42 as *const u8 (Pointer(MutToConstPointer)), StorageDead(_42), _40 = _41, (_15.0: *const u8) = move _40, StorageDead(_40), StorageDead(_41), StorageDead(_37), StorageDead(_36), StorageDead(_16), StorageLive(_18), _18 = _11], terminator: Some(Terminator { source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:9: 334:52 (#0), scope: scope[4] }, kind: _0 = <A as core::alloc::Allocator>::deallocate(move _14, move _15, move _18) -> bb3 }), is_cleanup: false }, BasicBlockData { statements: [StorageDead(_18), StorageDead(_15), StorageDead(_14), StorageDead(_11), StorageDead(_7), StorageDead(_3)], terminator: Some(Terminator { source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:336:1: 336:2 (#0), scope: scope[0] }, kind: drop(_2) -> bb4 }), is_cleanup: false }, BasicBlockData { statements: [], terminator: Some(Terminator { source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:336:2: 336:2 (#0), scope: scope[0] }, kind: return }), is_cleanup: false }], phase: Optimization, source: MirSource { instance: Item(WithOptConstParam { did: DefId(4:50 ~ alloc[3368]::alloc::box_free), const_param_did: None }), promoted: None }, source_scopes: [SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:329:1: 336:2 (#0), parent_scope: None, inlined: None, inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:330:5: 335:6 (#0), parent_scope: Some(scope[0]), inlined: None, inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:9: 335:6 (#0), parent_scope: Some(scope[1]), inlined: None, inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:9: 335:6 (#0), parent_scope: Some(scope[2]), inlined: None, inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:9: 335:6 (#0), parent_scope: Some(scope[3]), inlined: None, inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#472), parent_scope: Some(scope[1]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2164 ~ core[e765]::ptr::unique::{impl#3}::as_ref), const_param_did: None }), substs: [T] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#0))), inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#473), parent_scope: Some(scope[5]), inlined: None, inlined_parent_scope: Some(scope[5]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#474), parent_scope: Some(scope[6]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2163 ~ core[e765]::ptr::unique::{impl#3}::as_ptr), const_param_did: None }), substs: [T] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#477))), inlined_parent_scope: Some(scope[5]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#478), parent_scope: Some(scope[2]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2164 ~ core[e765]::ptr::unique::{impl#3}::as_ref), const_param_did: None }), substs: [T] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#0))), inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#479), parent_scope: Some(scope[8]), inlined: None, inlined_parent_scope: Some(scope[8]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#480), parent_scope: Some(scope[9]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2163 ~ core[e765]::ptr::unique::{impl#3}::as_ptr), const_param_did: None }), substs: [T] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#481))), inlined_parent_scope: Some(scope[8]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#482), parent_scope: Some(scope[3]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:12441 ~ core[e765]::alloc::layout::{impl#0}::from_size_align_unchecked), const_param_did: None }), substs: [] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#0))), inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#483), parent_scope: Some(scope[11]), inlined: None, inlined_parent_scope: Some(scope[11]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#484), parent_scope: Some(scope[12]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:21084 ~ core[e765]::num::nonzero::{impl#35}::new_unchecked), const_param_did: None }), substs: [] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#486))), inlined_parent_scope: Some(scope[11]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#487), parent_scope: Some(scope[13]), inlined: None, inlined_parent_scope: Some(scope[13]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#489), parent_scope: Some(scope[4]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2166 ~ core[e765]::ptr::unique::{impl#3}::cast), const_param_did: None }), substs: [T, u8] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#0))), inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#490), parent_scope: Some(scope[15]), inlined: None, inlined_parent_scope: Some(scope[15]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#491), parent_scope: Some(scope[16]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2163 ~ core[e765]::ptr::unique::{impl#3}::as_ptr), const_param_did: None }), substs: [T] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#493))), inlined_parent_scope: Some(scope[15]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#494), parent_scope: Some(scope[16]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2161 ~ core[e765]::ptr::unique::{impl#3}::new_unchecked), const_param_did: None }), substs: [u8] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#496))), inlined_parent_scope: Some(scope[15]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#497), parent_scope: Some(scope[18]), inlined: None, inlined_parent_scope: Some(scope[18]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#500), parent_scope: Some(scope[4]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2772 ~ core[e765]::convert::{impl#3}::into), const_param_did: None }), substs: [core::ptr::Unique<u8>, core::ptr::NonNull<u8>] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#0))), inlined_parent_scope: None, local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#501), parent_scope: Some(scope[20]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2114 ~ core[e765]::ptr::non_null::{impl#16}::from), const_param_did: None }), substs: [u8] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#502))), inlined_parent_scope: Some(scope[20]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#503), parent_scope: Some(scope[21]), inlined: None, inlined_parent_scope: Some(scope[21]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#504), parent_scope: Some(scope[22]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2163 ~ core[e765]::ptr::unique::{impl#3}::as_ptr), const_param_did: None }), substs: [u8] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#506))), inlined_parent_scope: Some(scope[21]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#507), parent_scope: Some(scope[22]), inlined: Some((Instance { def: Item(WithOptConstParam { did: DefId(1:2057 ~ core[e765]::ptr::non_null::{impl#3}::new_unchecked), const_param_did: None }), substs: [u8] }, /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#510))), inlined_parent_scope: Some(scope[21]), local_data: Clear }, SourceScopeData { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#511), parent_scope: Some(scope[24]), inlined: None, inlined_parent_scope: Some(scope[24]), local_data: Clear }], generator: None, local_decls: [LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: (), user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:329:82: 329:82 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Some(User(Clear)), internal: false, is_block_tail: None, ty: core::ptr::Unique<T>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:329:56: 329:59 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Some(User(Clear)), internal: false, is_block_tail: None, ty: A, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:329:72: 329:77 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Some(User(Clear)), internal: false, is_block_tail: None, ty: usize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:13: 331:17 (#0), scope: scope[1] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: *const T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: None, internal: false, is_block_tail: None, ty: &T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: &core::ptr::Unique<T>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:35 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Some(User(Clear)), internal: false, is_block_tail: None, ty: usize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:13: 332:18 (#0), scope: scope[2] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: *const T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: None, internal: false, is_block_tail: None, ty: &T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: &core::ptr::Unique<T>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:41 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: Some(User(Clear)), internal: false, is_block_tail: None, ty: core::alloc::Layout, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:13: 333:19 (#0), scope: scope[3] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: usize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:56: 333:60 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: usize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:62: 333:67 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: true, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:9: 334:52 (#0) }), ty: &A, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:9: 334:14 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: true, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:9: 334:52 (#0) }), ty: core::ptr::NonNull<u8>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: true, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:9: 334:52 (#0) }), ty: core::ptr::Unique<u8>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: true, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:9: 334:52 (#0) }), ty: core::ptr::Unique<T>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:29 (#0), scope: scope[0] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: true, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:9: 334:52 (#0) }), ty: core::alloc::Layout, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:45: 334:51 (#0), scope: scope[0] } }, LocalDecl { mutability: Not, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:118:18: 118:33 (#0) }), ty: *mut T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#514), scope: scope[5] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:118:18: 118:33 (#0) }), ty: core::ptr::Unique<T>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#515), scope: scope[5] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:106:9: 106:31 (#0) }), ty: *const T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#516), scope: scope[7] } }, LocalDecl { mutability: Not, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:118:18: 118:33 (#0) }), ty: *mut T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#518), scope: scope[8] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:118:18: 118:33 (#0) }), ty: core::ptr::Unique<T>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#519), scope: scope[8] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:106:9: 106:31 (#0) }), ty: *const T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#520), scope: scope[10] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/alloc/layout.rs:100:9: 100:86 (#0) }), ty: usize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#521), scope: scope[11] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/alloc/layout.rs:100:9: 100:86 (#0) }), ty: core::num::NonZeroUsize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#522), scope: scope[11] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/alloc/layout.rs:100:48: 100:82 (#0) }), ty: usize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#523), scope: scope[11] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/num/nonzero.rs:55:30: 55:37 (#379) }), ty: usize, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#524), scope: scope[13] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:139:18: 139:64 (#0) }), ty: *mut u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#527), scope: scope[15] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:139:18: 139:64 (#0) }), ty: *mut T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#528), scope: scope[15] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:139:18: 139:64 (#0) }), ty: core::ptr::Unique<T>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#529), scope: scope[15] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:106:9: 106:31 (#0) }), ty: *const T, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#530), scope: scope[17] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:89:18: 89:68 (#0) }), ty: *const u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#533), scope: scope[18] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:89:18: 89:68 (#0) }), ty: *const u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#535), scope: scope[18] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:89:18: 89:68 (#0) }), ty: *mut u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#538), scope: scope[18] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/convert/mod.rs:538:9: 538:22 (#0) }), ty: core::ptr::Unique<u8>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#540), scope: scope[20] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/non_null.rs:599:18: 599:57 (#0) }), ty: *mut u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#541), scope: scope[21] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/non_null.rs:599:18: 599:57 (#0) }), ty: core::ptr::Unique<u8>, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#542), scope: scope[21] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/unique.rs:106:9: 106:31 (#0) }), ty: *const u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#543), scope: scope[23] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/non_null.rs:163:18: 163:47 (#0) }), ty: *const u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#545), scope: scope[24] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/non_null.rs:163:18: 163:47 (#0) }), ty: *const u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#547), scope: scope[24] } }, LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: Some(BlockTailInfo { tail_result_is_ignored: false, span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/core/src/ptr/non_null.rs:163:18: 163:47 (#0) }), ty: *mut u8, user_ty: None, source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#549), scope: scope[24] } }], user_type_annotations: [], arg_count: 2, spread_arg: None, var_debug_info: [VarDebugInfo { name: "ptr", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:329:56: 329:59 (#0), scope: scope[0] }, value: _1 }, VarDebugInfo { name: "alloc", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:329:72: 329:77 (#0), scope: scope[0] }, value: _2 }, VarDebugInfo { name: "size", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:13: 331:17 (#0), scope: scope[2] }, value: _3 }, VarDebugInfo { name: "align", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:13: 332:18 (#0), scope: scope[3] }, value: _7 }, VarDebugInfo { name: "layout", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:13: 333:19 (#0), scope: scope[4] }, value: _11 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#551), scope: scope[5] }, value: _6 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:331:32: 331:44 (#552), scope: scope[7] }, value: _20 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#555), scope: scope[8] }, value: _10 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:332:38: 332:50 (#556), scope: scope[10] }, value: _23 }, VarDebugInfo { name: "size", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#557), scope: scope[11] }, value: _12 }, VarDebugInfo { name: "align", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#558), scope: scope[11] }, value: _13 }, VarDebugInfo { name: "n", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:333:22: 333:68 (#559), scope: scope[13] }, value: _27 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#561), scope: scope[15] }, value: _17 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#562), scope: scope[17] }, value: _31 }, VarDebugInfo { name: "ptr", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:36 (#564), scope: scope[18] }, value: _29 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#567), scope: scope[20] }, value: _16 }, VarDebugInfo { name: "unique", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#568), scope: scope[21] }, value: _36 }, VarDebugInfo { name: "self", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#569), scope: scope[23] }, value: _38 }, VarDebugInfo { name: "ptr", source_info: SourceInfo { span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:334:26: 334:43 (#571), scope: scope[24] }, value: _37 }], span: /home/bjorn/Projects/cg_clif2/build_sysroot/sysroot_src/library/alloc/src/alloc.rs:329:1: 336:2 (#0), required_consts: [], is_polymorphic: true, predecessor_cache: PredecessorCache { cache: OnceCell(Uninit) }, is_cyclic: GraphIsCyclicCache { cache: OnceCell(Uninit) } }', /rustc/e4a60327063e82413eed50a10df3b7d19b77bda0/compiler/rustc_query_system/src/query/plumbing.rs:620:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e4a60327063e82413eed50a10df3b7d19b77bda0/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/e4a60327063e82413eed50a10df3b7d19b77bda0/library/std/src/panicking.rs:457:5
   2: rustc_query_system::query::plumbing::incremental_verify_ich
   3: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
   4: rustc_data_structures::stack::ensure_sufficient_stack
   5: rustc_query_system::query::plumbing::get_query_impl
   6: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::optimized_mir
   7: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::instance_mir
   8: rustc_mir::monomorphize::collector::collect_neighbours
   9: rustc_mir::monomorphize::collector::collect_items_rec
  10: rustc_mir::monomorphize::collector::collect_items_rec
  11: rustc_mir::monomorphize::collector::collect_items_rec
  12: rustc_session::utils::<impl rustc_session::session::Session>::time
  13: rustc_mir::monomorphize::collector::collect_crate_mono_items
  14: rustc_mir::monomorphize::partitioning::collect_and_partition_mono_items
  15: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::collect_and_partition_mono_items>::compute
  16: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::force_query_with_job
  20: rustc_query_system::query::plumbing::get_query_impl
  21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_and_partition_mono_items
  22: rustc_codegen_cranelift::driver::aot::run_aot
  23: <rustc_codegen_cranelift::CraneliftCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
  24: rustc_interface::passes::QueryContext::enter
  25: rustc_interface::queries::Queries::ongoing_codegen
  26: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  27: rustc_span::with_source_map
  28: rustc_interface::interface::create_compiler_and_run
  29: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

error: Unrecognized option: 'clif'

error: aborting due to previous error

error: could not compile `panic_unwind`
$ rustc -vV
rustc 1.54.0-nightly (e4a603270 2021-06-07)
binary: rustc
commit-hash: e4a60327063e82413eed50a10df3b7d19b77bda0
commit-date: 2021-06-07
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

@tmiasko
Copy link
Contributor

tmiasko commented Oct 2, 2021

The compilation now fails when accessing session in Decodable<DecodeContext<'a, 'tcx>> for ExpnId:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:425:33

It looks that expn_hash_to_expn_id decodes ExpnData which in turn decodes ExpnId which in turn requires access to a session, but by the time of expn_hash_to_expn_id call, the session in no longer threaded through.

$ cat a.rs 
fn main() {
    if std::env::var("a").is_ok() {
        println!("b");
    }
}
$ rustc -Zmir-opt-level=3 a.rs -C incremental=incremental
$ rustc -Zmir-opt-level=3 a.rs -C incremental=incremental
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_metadata/src/rmeta/decoder.rs:425:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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

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

note: rustc 1.57.0-nightly (c02371c44 2021-10-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z mir-opt-level=3 -C incremental

query stack during panic:
#0 [optimized_mir] optimizing MIR for `main`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack

cc @cjgillot #86676

@cjgillot cjgillot self-assigned this Oct 2, 2021
Manishearth added a commit to Manishearth/rust that referenced this issue Oct 3, 2021
Correct decoding of foreign expansions during incr. comp.

Fixes rust-lang#74946

The original issue was due to a wrong assertion in `expn_hash_to_expn_id`.

The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
Manishearth added a commit to Manishearth/rust that referenced this issue Oct 7, 2021
Correct decoding of foreign expansions during incr. comp.

Fixes rust-lang#74946

The original issue was due to a wrong assertion in `expn_hash_to_expn_id`.

The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
Manishearth added a commit to Manishearth/rust that referenced this issue Oct 8, 2021
Correct decoding of foreign expansions during incr. comp.

Fixes rust-lang#74946

The original issue was due to a wrong assertion in `expn_hash_to_expn_id`.

The secondary issue was due to a mismatch between the encoding and decoding paths for expansions that are created after the TyCtxt is created.
@bors bors closed this as completed in aed1801 Oct 8, 2021
bjorn3 added a commit to rust-lang/rustc_codegen_cranelift that referenced this issue Oct 17, 2021
@bjorn3
Copy link
Member Author

bjorn3 commented Oct 17, 2021

I can confirm it works now. Pushed bjorn3/rustc_codegen_cranelift@1e5569d to re-enable incremental compilation for compiling the sysroot.

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 A-metadata Area: Crate metadata A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants