Skip to content

ICE: assertion failed: self.is_struct() || self.is_union()', compiler/rustc_middle/src/ty/adt.rs: #83505

Closed
@chengniansun

Description

@chengniansun

Code

#[repr(simd)]
enum Es {}
static CLs: Es;

Meta

rustc --version --verbose:

rustc 1.53.0-nightly (52e3dffa5 2021-03-25)
binary: rustc
commit-hash: 52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07
commit-date: 2021-03-25
host: x86_64-unknown-linux-gnu
release: 1.53.0-nightly
LLVM version: 12.0.0

Error output

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:1
  |
3 | static CLs: Es;
  | ^^^^^^^^^^^^^^-
  |               |
  |               help: provide a definition for the static: `= <expr>;`

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | / #[repr(simd)]
2 | | enum Es {}
3 | | static CLs: Es;
  | |_______________^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error[E0517]: attribute should be applied to a struct
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:8
  |
1 | #[repr(simd)]
  |        ^^^^
2 | enum Es {}
  | ---------- not a struct

error[E0084]: unsupported representation for zero-variant enum
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | #[repr(simd)]
  | ^^^^^^^^^^^^^
2 | enum Es {}
  | ---------- zero-variant enum

thread 'rustc' panicked at 'assertion failed: self.is_struct() || self.is_union()', compiler/rustc_middle/src/ty/adt.rs:293:9
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.53.0-nightly (52e3dffa5 2021-03-25) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [layout_raw] computing layout of `Es`
#1 [check_mod_item_types] checking item types in top-level module
end of query stack
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0084, E0517, E0601.
For more information about an error, try `rustc --explain E0084`.
Backtrace

error: free static item without body
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:1
  |
3 | static CLs: Es;
  | ^^^^^^^^^^^^^^-
  |               |
  |               help: provide a definition for the static: `= <expr>;`

error[E0601]: `main` function not found in crate `perses_node_priority_with_dfs_delta_reduced_mutant`
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | / #[repr(simd)]
2 | | enum Es {}
3 | | static CLs: Es;
  | |_______________^ consider adding a `main` function to `perses_node_priority_with_dfs_delta_reduced_mutant.rs`

error[E0517]: attribute should be applied to a struct
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:8
  |
1 | #[repr(simd)]
  |        ^^^^
2 | enum Es {}
  | ---------- not a struct

error[E0084]: unsupported representation for zero-variant enum
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:1:1
  |
1 | #[repr(simd)]
  | ^^^^^^^^^^^^^
2 | enum Es {}
  | ---------- zero-variant enum

thread 'rustc' panicked at 'assertion failed: self.is_struct() || self.is_union()', compiler/rustc_middle/src/ty/adt.rs:293:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/52e3dffa50cfffdcfa145c0cc0ba48b49abc0c07/library/core/src/panicking.rs:50:5
   3: rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt>::layout_raw_uncached
   4: rustc_middle::ty::layout::layout_raw
   5: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::layout_raw>::compute
   6: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
   7: rustc_data_structures::stack::ensure_sufficient_stack
   8: rustc_query_system::query::plumbing::force_query_with_job
   9: rustc_query_system::query::plumbing::get_query_impl
  10: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::layout_raw
  11: <rustc_middle::ty::layout::LayoutCx<rustc_middle::ty::context::TyCtxt> as rustc_target::abi::LayoutOf>::layout_of
  12: rustc_typeck::check::check::check_static_inhabited
  13: rustc_typeck::check::check::check_item_type
  14: rustc_middle::hir::map::Map::visit_item_likes_in_module
  15: rustc_typeck::check::check::check_mod_item_types
  16: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  17: rustc_query_system::query::plumbing::force_query_with_job
  18: rustc_query_system::query::plumbing::get_query_impl
  19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_mod_item_types
  20: rustc_session::utils::<impl rustc_session::session::Session>::time
  21: rustc_typeck::check_crate
  22: rustc_interface::passes::analysis
  23: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  24: rustc_data_structures::stack::ensure_sufficient_stack
  25: rustc_query_system::query::plumbing::force_query_with_job
  26: rustc_query_system::query::plumbing::get_query_impl
  27: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  28: rustc_interface::passes::QueryContext::enter
  29: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  30: rustc_span::with_source_map
  31: rustc_interface::interface::create_compiler_and_run
  32: 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.53.0-nightly (52e3dffa5 2021-03-25) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [layout_raw] computing layout of `Es`
#1 [check_mod_item_types] checking item types in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0084, E0517, E0601.
For more information about an error, try `rustc --explain E0084`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions