Null terminate core::panic::Location file strings by Noratrieb · Pull Request #117431 · rust-lang/rust (original) (raw)

GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=rust-cloud-vms[bot]
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_aeaacc3e-9324-4b06-a1e2-ef8dea45c41d
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=nul-location
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_aeaacc3e-9324-4b06-a1e2-ef8dea45c41d
GITHUB_REF=refs/pull/117431/merge
GITHUB_REF_NAME=117431/merge
GITHUB_REF_PROTECTED=false
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=0abc97d5373a72cdb1412378708c765aaf698bff
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_aeaacc3e-9324-4b06-a1e2-ef8dea45c41d
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_aeaacc3e-9324-4b06-a1e2-ef8dea45c41d
GITHUB_TRIGGERING_ACTOR=rust-cloud-vms[bot]
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/117431/merge
GITHUB_WORKFLOW_SHA=0abc97d5373a72cdb1412378708c765aaf698bff
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
---- [codegen-units] tests/codegen-units/item-collection/implicit-panic-call.rs stdout ----

error: compilation failed!
status: exit status: 101
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/codegen-units/item-collection/implicit-panic-call.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "-Z" "human_readable_cgu_names" "-O" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-units/item-collection/implicit-panic-call" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen-units/item-collection/implicit-panic-call/auxiliary" "-Zprint-mono-items=lazy"
Build completed unsuccessfully in 0:12:53
Build completed unsuccessfully in 0:12:53
MONO_ITEM fn <i32 as Div>::div @@ implicit_panic_call.e56438d38d90c16f-cgu.0[External]
MONO_ITEM fn foo @@ implicit_panic_call.e56438d38d90c16f-cgu.0[External]
MONO_ITEM fn panic @@ implicit_panic_call.e56438d38d90c16f-cgu.0[Internal]
--- stderr -------------------------------
--- stderr -------------------------------
##[error]error: internal compiler error: compiler/rustc_const_eval/src/interpret/place.rs:701:21: write_immediate_to_mplace: invalid Scalar layout: TyAndLayout {
                                    ty: &str,
                                    layout: Layout {
                                        size: Size(16 bytes),
                                        align: AbiAndPrefAlign {
                                            abi: Align(8 bytes),
                                            pref: Align(8 bytes),
                                        abi: ScalarPair(
                                            Initialized {
                                                value: Pointer(
                                                    AddressSpace(
---
                                                0,
                                                1,
                                            ],
                                        },
                                        largest_niche: Some(
                                            Niche {
                                                offset: Size(0 bytes),
                                                value: Pointer(
                                                        0,
                                                    ),
                                                ),
                                                valid_range: 1..=18446744073709551615,
                                                valid_range: 1..=18446744073709551615,
                                            },
                                        ),
                                        variants: Single {
                                            index: 0,
                                        },
                                        max_repr_align: None,
                                        unadjusted_abi_align: Align(8 bytes),
                                }

thread 'rustc' panicked at /checkout/compiler/rustc_errors/src/lib.rs:1000:33:
Box<dyn Any>
Box<dyn Any>
stack backtrace:
   0:     0x7fe7952f765c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h862fdb600c26e0f3
   1:     0x7fe795361a0d - core::fmt::write::hc2b2cfd7e08bd08c
   2:     0x7fe7952ec1c5 - std::io::Write::write_fmt::h83dde47749ec6a15
   3:     0x7fe7952f7445 - std::sys_common::backtrace::print::hdcedd0342354538f
   4:     0x7fe7952fa52a - std::panicking::default_hook::{{closure}}::hdcafe1ea5eeb1f03
   5:     0x7fe7952fa234 - std::panicking::default_hook::hbcd05ca9a838d7b6
   6:     0x7fe795f17583 - <alloc[755396c631c13435]::boxed::Box<rustc_driver_impl[b8fa8fe2f5293580]::install_ice_hook::{closure#0}> as core[511e713565cfc98c]::ops::function::Fn<(&dyn for<'a, 'b> core[511e713565cfc98c]::ops::function::Fn<(&'a core[511e713565cfc98c]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[511e713565cfc98c]:📑:Sync + core[511e713565cfc98c]:📑:Send, &core[511e713565cfc98c]::panic::panic_info::PanicInfo)>>::call
   7:     0x7fe7952fac25 - std::panicking::rust_panic_with_hook::h54227dd9b92df52b
   8:     0x7fe796dbdc56 - std[4a28869af722ff04]::panicking::begin_panic::<rustc_errors[448f416c5a064a01]::ExplicitBug>::{closure#0}
   9:     0x7fe796dbc4d6 - std[4a28869af722ff04]::sys_common::backtrace::__rust_end_short_backtrace::<std[4a28869af722ff04]::panicking::begin_panic<rustc_errors[448f416c5a064a01]::ExplicitBug>::{closure#0}, !>
  10:     0x7fe795bfe0c6 - std[4a28869af722ff04]::panicking::begin_panic::<rustc_errors[448f416c5a064a01]::ExplicitBug>
  11:     0x7fe796d659b4 - <rustc_errors[448f416c5a064a01]::HandlerInner>::span_bug::<rustc_span[56196b0d7678e298]::span_encoding::Span, alloc[755396c631c13435]:🧵:String>
  12:     0x7fe796d65770 - <rustc_errors[448f416c5a064a01]::Handler>::span_bug::<rustc_span[56196b0d7678e298]::span_encoding::Span, alloc[755396c631c13435]:🧵:String>
  14:     0x7fe796cd528c - rustc_middle[9e67f4c04a8e010d]::ty::context::tls::with_opt::<rustc_middle[9e67f4c04a8e010d]::util:🐛:opt_span_bug_fmt<rustc_span[56196b0d7678e298]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7fe796cd528c - rustc_middle[9e67f4c04a8e010d]::ty::context::tls::with_opt::<rustc_middle[9e67f4c04a8e010d]::util:🐛:opt_span_bug_fmt<rustc_span[56196b0d7678e298]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x7fe796cd1fe4 - rustc_middle[9e67f4c04a8e010d]::ty::context::tls::with_context_opt::<rustc_middle[9e67f4c04a8e010d]::ty::context::tls::with_opt<rustc_middle[9e67f4c04a8e010d]::util:🐛:opt_span_bug_fmt<rustc_span[56196b0d7678e298]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x7fe795bfdd37 - rustc_middle[9e67f4c04a8e010d]::util:🐛:span_bug_fmt::<rustc_span[56196b0d7678e298]::span_encoding::Span>
  17:     0x7fe796c8ab4e - <rustc_const_eval[5c747e66eb378bb9]::interpret::eval_context::InterpCx<rustc_const_eval[5c747e66eb378bb9]::const_eval::machine::CompileTimeInterpreter>>::write_immediate_to_mplace_no_validate
  18:     0x7fe796c8a532 - <rustc_const_eval[5c747e66eb378bb9]::interpret::eval_context::InterpCx<rustc_const_eval[5c747e66eb378bb9]::const_eval::machine::CompileTimeInterpreter>>::write_immediate_no_validate::<rustc_const_eval[5c747e66eb378bb9]::interpret::place::MPlaceTy>
  19:     0x7fe796cea291 - rustc_const_eval[5c747e66eb378bb9]::util::caller_location::const_caller_location_provider
  20:     0x7fe7978002c9 - rustc_query_impl[c4733f723feec4e5]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[c4733f723feec4e5]::query_impl::const_caller_location::dynamic_query::{closure#2}::{closure#0}, rustc_middle[9e67f4c04a8e010d]::query::erase::Erased<[u8; 24usize]>>
  21:     0x7fe7978e3cc3 - <rustc_query_impl[c4733f723feec4e5]::query_impl::const_caller_location::dynamic_query::{closure#2} as core[511e713565cfc98c]::ops::function::FnOnce<(rustc_middle[9e67f4c04a8e010d]::ty::context::TyCtxt, (rustc_span[56196b0d7678e298]::symbol::Symbol, u32, u32))>>::call_once
  22:     0x7fe797b0bf15 - rustc_query_system[491ba758a15bbd60]::query::plumbing::try_execute_query::<rustc_query_impl[c4733f723feec4e5]::DynamicConfig<rustc_query_system[491ba758a15bbd60]::query::caches::DefaultCache<(rustc_span[56196b0d7678e298]::symbol::Symbol, u32, u32), rustc_middle[9e67f4c04a8e010d]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[c4733f723feec4e5]::plumbing::QueryCtxt, false>
  23:     0x7fe7978f14a2 - rustc_query_impl[c4733f723feec4e5]::query_impl::const_caller_location::get_query_non_incr::__rust_end_short_backtrace
  24:     0x7fe7988f8852 - <rustc_middle[9e67f4c04a8e010d]::ty::context::TyCtxt>::span_as_caller_location
  25:     0x7fe796222fac - <rustc_middle[9e67f4c04a8e010d]::mir::Body>::caller_location_span::<rustc_codegen_ssa[3948ec9de3296f60]::mir::operand::OperandRef<&rustc_codegen_llvm[33a25d7a161f12b2]::llvm_::ffi::Value>, <rustc_codegen_ssa[3948ec9de3296f60]::mir::FunctionCx<rustc_codegen_llvm[33a25d7a161f12b2]::builder::Builder>>::get_caller_location::{closure#0}>
  26:     0x7fe7961bc624 - <rustc_codegen_ssa[3948ec9de3296f60]::mir::FunctionCx<rustc_codegen_llvm[33a25d7a161f12b2]::builder::Builder>>::codegen_terminator
  27:     0x7fe7961ab797 - rustc_codegen_ssa[3948ec9de3296f60]::mir::codegen_mir::<rustc_codegen_llvm[33a25d7a161f12b2]::builder::Builder>
  28:     0x7fe7961cbf0c - rustc_codegen_ssa[3948ec9de3296f60]::base::codegen_instance::<rustc_codegen_llvm[33a25d7a161f12b2]::builder::Builder>
  29:     0x7fe7962988cf - <rustc_middle[9e67f4c04a8e010d]::mir::mono::MonoItem as rustc_codegen_ssa[3948ec9de3296f60]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[33a25d7a161f12b2]::builder::Builder>
  30:     0x7fe7962210fb - rustc_codegen_llvm[33a25d7a161f12b2]::base::compile_codegen_unit::module_codegen
  31:     0x7fe79622002a - rustc_codegen_llvm[33a25d7a161f12b2]::base::compile_codegen_unit
  32:     0x7fe7961cb456 - rustc_codegen_ssa[3948ec9de3296f60]::base::codegen_crate::<rustc_codegen_llvm[33a25d7a161f12b2]::LlvmCodegenBackend>
  33:     0x7fe79628f066 - <rustc_codegen_llvm[33a25d7a161f12b2]::LlvmCodegenBackend as rustc_codegen_ssa[3948ec9de3296f60]::traits::backend::CodegenBackend>::codegen_crate
  34:     0x7fe7960a0adf - <rustc_session[62d4bb5ba3c62922]::session::Session>::time::<alloc[755396c631c13435]::boxed::Box<dyn core[511e713565cfc98c]::any::Any>, rustc_interface[a1434bf08727a2b8]::passes::start_codegen::{closure#0}>
  35:     0x7fe79606db9d - rustc_interface[a1434bf08727a2b8]::passes::start_codegen
  36:     0x7fe7960e7bcb - <rustc_middle[9e67f4c04a8e010d]::ty::context::GlobalCtxt>::enter::<<rustc_interface[a1434bf08727a2b8]::queries::Queries>::ongoing_codegen::{closure#0}, core[511e713565cfc98c]::result::Result<alloc[755396c631c13435]::boxed::Box<dyn core[511e713565cfc98c]::any::Any>, rustc_span[56196b0d7678e298]::ErrorGuaranteed>>
  37:     0x7fe7960b6816 - <rustc_interface[a1434bf08727a2b8]::queries::Queries>::ongoing_codegen
  38:     0x7fe795f439ce - std[4a28869af722ff04]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[a1434bf08727a2b8]::util::run_in_thread_with_globals<rustc_interface[a1434bf08727a2b8]::interface::run_compiler<core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>, rustc_driver_impl[b8fa8fe2f5293580]::run_compiler::{closure#1}>::{closure#0}, core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>>
  39:     0x7fe795f2336e - std[4a28869af722ff04]::panicking::try::<core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>, core[511e713565cfc98c]::panic::unwind_safe::AssertUnwindSafe<<std[4a28869af722ff04]::thread::Builder>::spawn_unchecked_<rustc_interface[a1434bf08727a2b8]::util::run_in_thread_with_globals<rustc_interface[a1434bf08727a2b8]::interface::run_compiler<core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>, rustc_driver_impl[b8fa8fe2f5293580]::run_compiler::{closure#1}>::{closure#0}, core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
  40:     0x7fe795f147c0 - <<std[4a28869af722ff04]::thread::Builder>::spawn_unchecked_<rustc_interface[a1434bf08727a2b8]::util::run_in_thread_with_globals<rustc_interface[a1434bf08727a2b8]::interface::run_compiler<core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>, rustc_driver_impl[b8fa8fe2f5293580]::run_compiler::{closure#1}>::{closure#0}, core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[511e713565cfc98c]::result::Result<(), rustc_span[56196b0d7678e298]::ErrorGuaranteed>>::{closure#1} as core[511e713565cfc98c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7fe7950bcac3 - <unknown>
  43:     0x7fe79514ea40 - <unknown>
  44:                0x0 - <unknown>


note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

note: rustc 1.75.0-nightly (0abc97d53 2023-10-31) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z human_readable_cgu_names -C prefer-dynamic -C rpath -C debuginfo=0 -Z print-mono-items=lazy
query stack during panic:
query stack during panic:
#0 [const_caller_location] getting a &core::panic::Location referring to a span
error: aborting due to previous error
------------------------------------------