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

[stable] cargo test causes a compiler error #117314

Closed
raymanfx opened this issue Oct 28, 2023 · 1 comment
Closed

[stable] cargo test causes a compiler error #117314

raymanfx opened this issue Oct 28, 2023 · 1 comment
Labels
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.

Comments

@raymanfx
Copy link

cargo build succeeds, as does cargo bench, so the code allegedly builds and runs fine, yet cargo test yields the compiler error.

Since the issue exists only on the stable channel, not nightly, it might be a known one (?)

Steps to reproduce:

$ git clone https://github.com/raymanfx/ffimage
$ cd ffimage/ffimage
$ cargo test

Code

?

Meta

rustc --version --verbose:

rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: aarch64-apple-darwin
release: 1.73.0
LLVM version: 17.0.2

Switching to nightly rustc makes the error go away.

Error output

https://github.com/raymanfx/ffimage/actions/runs/6676630329/job/18145862021
Backtrace

❯ RUST_BACKTRACE=1 cargo test
   Compiling ffimage v0.10.0 (/Users/chris/work/rs/ffimage/ffimage)
thread 'rustc' panicked at compiler/rustc_metadata/src/rmeta/decoder.rs:1174:17:
assertion `left == right` failed
  left: ValueNs("R")
 right: Ctor
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed::<rustc_hir::definitions::DefPathData, rustc_hir::definitions::DefPathData>
   4: <rustc_metadata::creader::CrateMetadataRef>::get_item_attrs
   5: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::item_attrs
      [... omitted 2 frames ...]
   6: <rustc_middle::ty::context::TyCtxt>::get_attrs::<rustc_span::def_id::DefId>
   7: <<rustc_hir_typeck::fn_ctxt::FnCtxt>::instantiate_value_path::CreateCtorSubstsContext as rustc_hir_analysis::astconv::CreateSubstsForGenericArgsCtxt>::inferred_kind
   8: rustc_hir_analysis::astconv::generics::create_args_for_parent_generic_args::<<rustc_hir_typeck::fn_ctxt::FnCtxt>::instantiate_value_path::CreateCtorSubstsContext>
   9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::instantiate_value_path
  10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_path
  11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::confirm_builtin_call
  16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  18: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl_initializer
  19: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_decl
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_stmt
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  24: rustc_hir_typeck::check::check_fn
  25: rustc_hir_typeck::typeck
      [... omitted 2 frames ...]
  26: <core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::par_for_each_in<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_analysis::check_crate::{closure#7}>::{closure#0}>::{closure#0}::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
  27: rustc_hir_analysis::check_crate
  28: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  29: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  30: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.73.0 (cc66ad468 2023-10-03) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

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

query stack during panic:
#0 [item_attrs] collecting attributes of `ffimage::color::rgb::Rgb::R`
#1 [typeck] type-checking `convert_rgb_to_gray`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `ffimage` (test "convert")

@raymanfx raymanfx 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 Oct 28, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 28, 2023
@lqd
Copy link
Member

lqd commented Oct 28, 2023

I believe this is a duplicate of at least #116662, and is already fixed on nightly as you mention. In addition, the fix should already be on beta, and on stable in a couple weeks.

Thanks for opening an issue, and I'll close it as already fixed. Feel free to reopen if it happens again once the fix hits stable though.

@lqd lqd closed this as completed Oct 28, 2023
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

No branches or pull requests

4 participants