Skip to content

ICE: Failing to compile gfx-backend-metal: Unexpected type for constructor #89393

Closed
@tuzz

Description

@tuzz

Repro

When compiling on an Apple M1 processor:

git clone https://github.com/gfx-rs/gfx.git
cd gfx/src/backend/metal
RUST_BACKTRACE=1 cargo check

Meta

rustc --version --verbose:

rustc 1.57.0-nightly (11491938f 2021-09-29)

Error output

error: internal compiler error: compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs:1191:22: Unexpected type for `Single` constructor: <&soft::Ref as soft::Resources>::BufferArray

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1146:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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 (11491938f 2021-09-29) running on aarch64-apple-darwin

note: compiler flags: -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
#0 [check_match] match-checking `soft::<impl at src/backend/metal/src/soft.rs:208:1: 476:2>::own_render`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `gfx-backend-metal`
Backtrace

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1146:9
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_mir_build::thir::pattern::deconstruct_pat::Fields::wildcards
   8: rustc_mir_build::thir::pattern::deconstruct_pat::DeconstructedPat::specialize
   9: rustc_mir_build::thir::pattern::usefulness::is_useful
  10: rustc_mir_build::thir::pattern::usefulness::is_useful
  11: rustc_mir_build::thir::pattern::usefulness::is_useful
  12: rustc_mir_build::thir::pattern::usefulness::is_useful
  13: rustc_mir_build::thir::pattern::usefulness::compute_match_usefulness
  14: <rustc_mir_build::thir::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  15: <rustc_mir_build::thir::pattern::check_match::MatchVisitor as rustc_hir::intravisit::Visitor>::visit_expr
  16: rustc_mir_build::thir::pattern::check_match::check_match
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::try_execute_query
  20: rustc_query_system::query::plumbing::get_query
  21: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  22: rustc_session::utils::<impl rustc_session::session::Session>::time
  23: rustc_session::utils::<impl rustc_session::session::Session>::time
  24: rustc_interface::passes::analysis
  25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
  26: rustc_data_structures::stack::ensure_sufficient_stack
  27: rustc_query_system::query::plumbing::try_execute_query
  28: rustc_query_system::query::plumbing::get_query
  29: rustc_interface::passes::QueryContext::enter
  30: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  31: rustc_span::with_source_map
  32: scoped_tls::ScopedKey<T>::set

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-exhaustiveness-checkingRelating to exhaustiveness / usefulness checking of patternsC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions