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

Avoid ICE when Canonicalizer.infcx is None #119416

Closed
wants to merge 2 commits into from

Conversation

obeis
Copy link
Contributor

@obeis obeis commented Dec 29, 2023

Closes #119381

ICE: with_negative_coherence: None in compiler/rustc_infer/src/infer/canonical/canonicalizer.rs
@rustbot
Copy link
Collaborator

rustbot commented Dec 29, 2023

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 29, 2023
@@ -0,0 +1,16 @@
#![feature(with_negative_coherence)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title of this issue doesn't really explain why it's an ICE. Specifically, there's no explanation for why we're encountering an inference variable in the type of a constant inside of a param-env, which is why this ICE occurs.

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the right solution, and causes us to totally ignore canonicalization for infer vars when the infcx is not provided. I'm pretty surprised that this even passes at all!

@compiler-errors
Copy link
Member

Please make sure to enable debug assertions in your local fork of the compiler, since this debug assertion fails with your modification:

debug_assert!(!out_value.has_infer() && !out_value.has_placeholders());

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=obeis
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_c809f2dd-b26b-49dd-949f-de22587809a2
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=05a828c9388c7ebf1a30eea4044766d08e615031
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_c809f2dd-b26b-49dd-949f-de22587809a2
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_c809f2dd-b26b-49dd-949f-de22587809a2
GITHUB_TRIGGERING_ACTOR=obeis
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/119416/merge
GITHUB_WORKFLOW_SHA=05a828c9388c7ebf1a30eea4044766d08e615031
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Fri Dec 29 19:39:08 UTC 2023
  network time: Fri, 29 Dec 2023 19:39:08 GMT
  network time: Fri, 29 Dec 2023 19:39:08 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: rust.codegen-units-std := 1
---
failures:

---- [ui] tests/ui/coherence/with-negative-coherence-issue-119381.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit status: 101
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/coherence/with-negative-coherence-issue-119381.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" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/coherence/with-negative-coherence-issue-119381" "-A" "unused" "-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/ui/coherence/with-negative-coherence-issue-119381/auxiliary"
--- stderr -------------------------------
error[E0428]: the name `S` is defined multiple times
##[error]  --> /checkout/tests/ui/coherence/with-negative-coherence-issue-119381.rs:13:1
   |
   |
LL | struct S<const N: [f32; N]>();
   | ------------------------------ previous definition of the type `S` here
...
...
LL | struct S<const N: usize>([f32; N]);
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `S` redefined here
   |
   = note: `S` must be defined only once in the type namespace of this module
error[E0770]: the type of const parameters must not depend on other generic parameters
##[error]  --> /checkout/tests/ui/coherence/with-negative-coherence-issue-119381.rs:4:25
   |
   |
LL | struct S<const N: [f32; N]>();
   |                         ^ the type must not depend on the parameter `N`
   = note: const parameters may not be used in the type of const parameters

error[E0770]: the type of const parameters must not depend on other generic parameters
##[error]  --> /checkout/tests/ui/coherence/with-negative-coherence-issue-119381.rs:4:25
##[error]  --> /checkout/tests/ui/coherence/with-negative-coherence-issue-119381.rs:4:25
   |
LL | struct S<const N: [f32; N]>();
   |                         ^ the type must not depend on the parameter `N`
   = note: const parameters may not be used in the type of const parameters
   = note: const parameters may not be used in the type of const parameters
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
thread 'rustc' panicked at compiler/rustc_infer/src/infer/canonical/canonicalizer.rs:625:9:
thread 'rustc' panicked at compiler/rustc_infer/src/infer/canonical/canonicalizer.rs:625:9:
assertion failed: !out_value.has_infer() && !out_value.has_placeholders()
stack backtrace:
   0:     0x7f5d10ad0889 - <std[99636b24f119ec2d]::sys_common::backtrace::_print::DisplayBacktrace as core[251c52021f5a0750]::fmt::Display>::fmt
   1:     0x7f5d10b2b2ef - core[251c52021f5a0750]::fmt::write
   2:     0x7f5d10ac5135 - <std[99636b24f119ec2d]::sys::unix::stdio::Stderr as std[99636b24f119ec2d]::io::Write>::write_fmt
   3:     0x7f5d10ad0665 - std[99636b24f119ec2d]::sys_common::backtrace::print
   4:     0x7f5d10ad39ea - std[99636b24f119ec2d]::panicking::default_hook::{closure#1}
   5:     0x7f5d10ad36ed - std[99636b24f119ec2d]::panicking::default_hook
   6:     0x7f5d117a5b27 - <alloc[78724e44951e0388]::boxed::Box<rustc_driver_impl[c462e639ce52817a]::install_ice_hook::{closure#0}> as core[251c52021f5a0750]::ops::function::Fn<(&dyn for<'a, 'b> core[251c52021f5a0750]::ops::function::Fn<(&'a core[251c52021f5a0750]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[251c52021f5a0750]::marker::Send + core[251c52021f5a0750]::marker::Sync, &core[251c52021f5a0750]::panic::panic_info::PanicInfo)>>::call
   7:     0x7f5d10ad40a4 - std[99636b24f119ec2d]::panicking::rust_panic_with_hook
   8:     0x7f5d10ad3df9 - std[99636b24f119ec2d]::panicking::begin_panic_handler::{closure#0}
   9:     0x7f5d10ad0e16 - std[99636b24f119ec2d]::sys_common::backtrace::__rust_end_short_backtrace::<std[99636b24f119ec2d]::panicking::begin_panic_handler::{closure#0}, !>
  11:     0x7f5d10a8aa75 - core[251c52021f5a0750]::panicking::panic_fmt
  12:     0x7f5d10a8ab33 - core[251c52021f5a0750]::panicking::panic
  13:     0x7f5d13cd809d - <rustc_infer[d80b9aa1b8bfa89a]::infer::canonical::canonicalizer::Canonicalizer>::canonicalize::<rustc_middle[c5561a859bbe688]::ty::ParamEnv>
  13:     0x7f5d13cd809d - <rustc_infer[d80b9aa1b8bfa89a]::infer::canonical::canonicalizer::Canonicalizer>::canonicalize::<rustc_middle[c5561a859bbe688]::ty::ParamEnv>
  14:     0x7f5d13c8b99a - <<rustc_infer[d80b9aa1b8bfa89a]::infer::InferCtxt>::canonicalize_query_with_mode<(rustc_middle[c5561a859bbe688]::ty::Ty, rustc_middle[c5561a859bbe688]::ty::Ty)>::{closure#0} as core[251c52021f5a0750]::ops::function::FnOnce<(rustc_middle[c5561a859bbe688]::ty::context::TyCtxt, rustc_middle[c5561a859bbe688]::ty::ParamEnv, &mut rustc_middle[c5561a859bbe688]::infer::canonical::OriginalQueryValues)>>::call_once
  15:     0x7f5d1467ac3e - <rustc_middle[c5561a859bbe688]::infer::canonical::CanonicalParamEnvCache>::get_or_insert
  16:     0x7f5d13c947c2 - <rustc_infer[d80b9aa1b8bfa89a]::infer::InferCtxt>::super_combine_consts::<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>
  17:     0x7f5d13cbbdd9 - <rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate as rustc_middle[c5561a859bbe688]::ty::relate::TypeRelation>::consts
  18:     0x7f5d13c0d790 - <rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg as rustc_middle[c5561a859bbe688]::ty::relate::Relate>::relate::<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>
  19:     0x7f5d13ccc23f - <core[251c52021f5a0750]::result::Result<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg, rustc_middle[c5561a859bbe688]::ty::error::TypeError> as rustc_type_ir[92ee43e9f95a76d8]::interner::CollectAndApply<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg, &rustc_middle[c5561a859bbe688]::ty::list::List<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>>::collect_and_apply::<core[251c52021f5a0750]::iter::adapters::map::Map<core[251c52021f5a0750]::iter::adapters::zip::Zip<core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>, core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>>, rustc_middle[c5561a859bbe688]::ty::relate::relate_args_invariantly<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>::{closure#0}>, <rustc_middle[c5561a859bbe688]::ty::context::TyCtxt>::mk_args_from_iter<core[251c52021f5a0750]::iter::adapters::map::Map<core[251c52021f5a0750]::iter::adapters::zip::Zip<core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>, core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>>, rustc_middle[c5561a859bbe688]::ty::relate::relate_args_invariantly<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>::{closure#0}>, core[251c52021f5a0750]::result::Result<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg, rustc_middle[c5561a859bbe688]::ty::error::TypeError>>::{closure#0}>
  20:     0x7f5d13cbb88a - <rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate as rustc_middle[c5561a859bbe688]::ty::relate::TypeRelation>::relate_item_args
  21:     0x7f5d13c623b0 - rustc_middle[c5561a859bbe688]::ty::relate::structurally_relate_tys::<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>
  22:     0x7f5d13c91bb5 - <rustc_infer[d80b9aa1b8bfa89a]::infer::InferCtxt>::super_combine_tys::<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>
  23:     0x7f5d13cbc914 - <rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate as rustc_middle[c5561a859bbe688]::ty::relate::TypeRelation>::tys
  24:     0x7f5d139882cc - <rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg as rustc_middle[c5561a859bbe688]::ty::relate::Relate>::relate::<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>
  25:     0x7f5d1398593f - <core[251c52021f5a0750]::result::Result<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg, rustc_middle[c5561a859bbe688]::ty::error::TypeError> as rustc_type_ir[92ee43e9f95a76d8]::interner::CollectAndApply<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg, &rustc_middle[c5561a859bbe688]::ty::list::List<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>>::collect_and_apply::<core[251c52021f5a0750]::iter::adapters::map::Map<core[251c52021f5a0750]::iter::adapters::zip::Zip<core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>, core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>>, rustc_middle[c5561a859bbe688]::ty::relate::relate_args_invariantly<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>::{closure#0}>, <rustc_middle[c5561a859bbe688]::ty::context::TyCtxt>::mk_args_from_iter<core[251c52021f5a0750]::iter::adapters::map::Map<core[251c52021f5a0750]::iter::adapters::zip::Zip<core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>, core[251c52021f5a0750]::iter::adapters::copied::Copied<core[251c52021f5a0750]::slice::iter::Iter<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg>>>, rustc_middle[c5561a859bbe688]::ty::relate::relate_args_invariantly<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>::{closure#0}>, core[251c52021f5a0750]::result::Result<rustc_middle[c5561a859bbe688]::ty::generic_args::GenericArg, rustc_middle[c5561a859bbe688]::ty::error::TypeError>>::{closure#0}>
  26:     0x7f5d13a9ee68 - <rustc_middle[c5561a859bbe688]::ty::sty::TraitRef as rustc_middle[c5561a859bbe688]::ty::relate::Relate>::relate::<rustc_infer[d80b9aa1b8bfa89a]::infer::relate::equate::Equate>
  27:     0x7f5d138cbb8c - <rustc_infer[d80b9aa1b8bfa89a]::infer::InferCtxt>::commit_if_ok::<rustc_infer[d80b9aa1b8bfa89a]::infer::InferOk<()>, rustc_middle[c5561a859bbe688]::ty::error::TypeError, <rustc_infer[d80b9aa1b8bfa89a]::infer::at::Trace>::eq<rustc_middle[c5561a859bbe688]::ty::sty::TraitRef>::{closure#0}>
  28:     0x7f5d13a8ad68 - <rustc_infer[d80b9aa1b8bfa89a]::infer::at::At>::eq::<rustc_middle[c5561a859bbe688]::ty::sty::TraitRef>
  29:     0x7f5d1394e835 - rustc_trait_selection[479932178ce44646]::traits::coherence::equate_impl_headers
  30:     0x7f5d1394019a - rustc_trait_selection[479932178ce44646]::traits::coherence::impl_intersection_has_negative_obligation
  31:     0x7f5d1394cc62 - rustc_trait_selection[479932178ce44646]::traits::coherence::overlap
  32:     0x7f5d1394c031 - rustc_trait_selection[479932178ce44646]::traits::coherence::overlapping_impls
  33:     0x7f5d13a84c09 - <rustc_middle[c5561a859bbe688]::traits::specialization_graph::Children as rustc_trait_selection[479932178ce44646]::traits::specialize::specialization_graph::ChildrenExt>::insert
  34:     0x7f5d13a82415 - <rustc_middle[c5561a859bbe688]::traits::specialization_graph::Graph as rustc_trait_selection[479932178ce44646]::traits::specialize::specialization_graph::GraphExt>::insert
  35:     0x7f5d139484a4 - rustc_trait_selection[479932178ce44646]::traits::specialize::specialization_graph_provider
  36:     0x7f5d1328c407 - rustc_query_impl[a3882dfb6bda7301]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3882dfb6bda7301]::query_impl::specialization_graph_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c5561a859bbe688]::query::erase::Erased<[u8; 8usize]>>
  37:     0x7f5d13337c19 - <rustc_query_impl[a3882dfb6bda7301]::query_impl::specialization_graph_of::dynamic_query::{closure#2} as core[251c52021f5a0750]::ops::function::FnOnce<(rustc_middle[c5561a859bbe688]::ty::context::TyCtxt, rustc_span[4e411843f8a530ef]::def_id::DefId)>>::call_once
  38:     0x7f5d1362dc7a - rustc_query_system[8647876a6d051]::query::plumbing::try_execute_query::<rustc_query_impl[a3882dfb6bda7301]::DynamicConfig<rustc_query_system[8647876a6d051]::query::caches::DefaultCache<rustc_span[4e411843f8a530ef]::def_id::DefId, rustc_middle[c5561a859bbe688]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[a3882dfb6bda7301]::plumbing::QueryCtxt, false>
  39:     0x7f5d13471817 - rustc_query_impl[a3882dfb6bda7301]::query_impl::specialization_graph_of::get_query_non_incr::__rust_end_short_backtrace
  40:     0x7f5d12248e11 - rustc_hir_analysis[2f1e2b290bd4137f]::coherence::coherent_trait
  41:     0x7f5d132753ba - rustc_query_impl[a3882dfb6bda7301]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3882dfb6bda7301]::query_impl::coherent_trait::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c5561a859bbe688]::query::erase::Erased<[u8; 0usize]>>
  42:     0x7f5d1345ea19 - <rustc_query_impl[a3882dfb6bda7301]::query_impl::coherent_trait::dynamic_query::{closure#2} as core[251c52021f5a0750]::ops::function::FnOnce<(rustc_middle[c5561a859bbe688]::ty::context::TyCtxt, rustc_span[4e411843f8a530ef]::def_id::DefId)>>::call_once
  43:     0x7f5d13617001 - rustc_query_system[8647876a6d051]::query::plumbing::try_execute_query::<rustc_query_impl[a3882dfb6bda7301]::DynamicConfig<rustc_query_system[8647876a6d051]::query::caches::DefaultCache<rustc_span[4e411843f8a530ef]::def_id::DefId, rustc_middle[c5561a859bbe688]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[a3882dfb6bda7301]::plumbing::QueryCtxt, false>
  44:     0x7f5d134705a4 - rustc_query_impl[a3882dfb6bda7301]::query_impl::coherent_trait::get_query_non_incr::__rust_end_short_backtrace
  45:     0x7f5d1213c169 - rustc_hir_analysis[2f1e2b290bd4137f]::check_crate
  46:     0x7f5d119af390 - rustc_interface[c16ba07f547382a7]::passes::analysis
  47:     0x7f5d13294ca3 - rustc_query_impl[a3882dfb6bda7301]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[a3882dfb6bda7301]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c5561a859bbe688]::query::erase::Erased<[u8; 1usize]>>
  48:     0x7f5d134d0601 - <rustc_query_impl[a3882dfb6bda7301]::query_impl::analysis::dynamic_query::{closure#2} as core[251c52021f5a0750]::ops::function::FnOnce<(rustc_middle[c5561a859bbe688]::ty::context::TyCtxt, ())>>::call_once
  49:     0x7f5d135c14a0 - rustc_query_system[8647876a6d051]::query::plumbing::try_execute_query::<rustc_query_impl[a3882dfb6bda7301]::DynamicConfig<rustc_query_system[8647876a6d051]::query::caches::SingleCache<rustc_middle[c5561a859bbe688]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[a3882dfb6bda7301]::plumbing::QueryCtxt, false>
  50:     0x7f5d1342754d - rustc_query_impl[a3882dfb6bda7301]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  51:     0x7f5d1178e09a - <rustc_middle[c5561a859bbe688]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}::{closure#0}::{closure#3}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>
  52:     0x7f5d117d183a - <rustc_interface[c16ba07f547382a7]::interface::Compiler>::enter::<rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}::{closure#0}, core[251c52021f5a0750]::result::Result<core[251c52021f5a0750]::option::Option<rustc_interface[c16ba07f547382a7]::queries::Linker>, rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>
  53:     0x7f5d11740853 - rustc_span[4e411843f8a530ef]::set_source_map::<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_interface[c16ba07f547382a7]::interface::run_compiler<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
  54:     0x7f5d1179a6fe - <scoped_tls[e54033cbd1f2c61c]::ScopedKey<rustc_span[4e411843f8a530ef]::SessionGlobals>>::set::<rustc_interface[c16ba07f547382a7]::util::run_in_thread_pool_with_globals<rustc_interface[c16ba07f547382a7]::interface::run_compiler<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>
  55:     0x7f5d11740d2c - rustc_span[4e411843f8a530ef]::create_session_globals_then::<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_interface[c16ba07f547382a7]::util::run_in_thread_pool_with_globals<rustc_interface[c16ba07f547382a7]::interface::run_compiler<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}>
  56:     0x7f5d11773f4e - std[99636b24f119ec2d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[c16ba07f547382a7]::util::run_in_thread_with_globals<rustc_interface[c16ba07f547382a7]::util::run_in_thread_pool_with_globals<rustc_interface[c16ba07f547382a7]::interface::run_compiler<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>
  57:     0x7f5d11748644 - std[99636b24f119ec2d]::panicking::try::<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, core[251c52021f5a0750]::panic::unwind_safe::AssertUnwindSafe<<std[99636b24f119ec2d]::thread::Builder>::spawn_unchecked_<rustc_interface[c16ba07f547382a7]::util::run_in_thread_with_globals<rustc_interface[c16ba07f547382a7]::util::run_in_thread_pool_with_globals<rustc_interface[c16ba07f547382a7]::interface::run_compiler<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#1}::{closure#0}>>
  58:     0x7f5d1177547a - <<std[99636b24f119ec2d]::thread::Builder>::spawn_unchecked_<rustc_interface[c16ba07f547382a7]::util::run_in_thread_with_globals<rustc_interface[c16ba07f547382a7]::util::run_in_thread_pool_with_globals<rustc_interface[c16ba07f547382a7]::interface::run_compiler<core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>, rustc_driver_impl[c462e639ce52817a]::run_compiler::{closure#0}>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[251c52021f5a0750]::result::Result<(), rustc_span[4e411843f8a530ef]::ErrorGuaranteed>>::{closure#1} as core[251c52021f5a0750]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  59:     0x7f5d10adfc2e - <std[99636b24f119ec2d]::sys::unix::thread::Thread>::new::thread_start
  61:     0x7f5d109590d0 - <unknown>
  62:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.
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.77.0-nightly (05a828c93 2023-12-29) 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 -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0
query stack during panic:
query stack during panic:
#0 [specialization_graph_of] building specialization graph of trait `core::marker::Copy`
#1 [coherent_trait] coherence checking all impls of trait `core::marker::Copy`
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0428, E0770.

@obeis obeis closed this Dec 29, 2023
@obeis obeis deleted the issue-119381 branch December 29, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: with_negative_coherence: None in compiler/rustc_infer/src/infer/canonical/canonicalizer.rs:483:43
5 participants