Skip to content

ICE: compiler/rustc_mir/src/interpret/place.rs:463:18: mplace_index called on non-array type f32x3 #82926

Closed
@chengniansun

Description

@chengniansun

Code

#![feature(staged_api)]
struct f32x3(f32, f32, f32);
extern "platform-intrinsic" {
    #[rustc_const_stable(feature = "foo", since = "1.3.37")]
    fn simd_insert<T>(x: T, idx: u32, val: U) -> T;
}
fn main() {
    const U: f32x3 = f32x3(13., 14., 15.);
    const { simd_insert(U, 1_u32, 42_f32) }
}

Meta

rustc --version --verbose:

rustc 1.52.0-nightly (8f349be27 2021-03-08)
binary: rustc
commit-hash: 8f349be27815d43d462a32faeb270a22a68486b6
commit-date: 2021-03-08
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0

Error output

error[E0412]: cannot find type `U` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:44
  |
5 |     fn simd_insert<T>(x: T, idx: u32, val: U) -> T;
  |                    -                       ^ help: a type parameter with a similar name exists: `T`
  |                    |
  |                    similarly named type parameter `T` defined here

error[E0658]: inline-const is experimental
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:5
  |
9 |     const { simd_insert(U, 1_u32, 42_f32) }
  |     ^^^^^
  |
  = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information
  = help: add `#![feature(inline_const)]` to the crate attributes to enable

error[E0658]: platform intrinsics are experimental and possibly buggy
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:8
  |
3 | extern "platform-intrinsic" {
  |        ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #27731 <https://github.com/rust-lang/rust/issues/27731> for more information
  = help: add `#![feature(platform_intrinsics)]` to the crate attributes to enable

warning: type `f32x3` should have an upper camel case name
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:8
  |
2 | struct f32x3(f32, f32, f32);
  |        ^^^^^ help: convert the identifier to upper camel case (notice the capitalization): `F32x3`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0094]: intrinsic has wrong number of type parameters: found 1, expected 2
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:19
  |
5 |     fn simd_insert<T>(x: T, idx: u32, val: U) -> T;
  |                   ^^^ expected 2 type parameter

error[E0308]: mismatched types
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:5
  |
7 | fn main() {
  |           - expected `()` because of default return type
8 |     const U: f32x3 = f32x3(13., 14., 15.);
9 |     const { simd_insert(U, 1_u32, 42_f32) }
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `f32x3`

error: internal compiler error: compiler/rustc_mir/src/interpret/place.rs:463:18: `mplace_index` called on non-array type f32x3
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:13
  |
9 |     const { simd_insert(U, 1_u32, 42_f32) }
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<Any>', /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/std/src/panic.rs:59:5
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.52.0-nightly (8f349be27 2021-03-08) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `main::{constant#0}`
#1 [eval_to_const_value_raw] simplifying constant for the type system `main::{constant#0}`
end of query stack
error: aborting due to 6 previous errors; 1 warning emitted

Some errors have detailed explanations: E0094, E0308, E0412, E0658.
For more information about an error, try `rustc --explain E0094`.
Backtrace

error[E0412]: cannot find type `U` in this scope
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:44
  |
5 |     fn simd_insert<T>(x: T, idx: u32, val: U) -> T;
  |                    -                       ^ help: a type parameter with a similar name exists: `T`
  |                    |
  |                    similarly named type parameter `T` defined here

error[E0658]: inline-const is experimental
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:5
  |
9 |     const { simd_insert(U, 1_u32, 42_f32) }
  |     ^^^^^
  |
  = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information
  = help: add `#![feature(inline_const)]` to the crate attributes to enable

error[E0658]: platform intrinsics are experimental and possibly buggy
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:3:8
  |
3 | extern "platform-intrinsic" {
  |        ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #27731 <https://github.com/rust-lang/rust/issues/27731> for more information
  = help: add `#![feature(platform_intrinsics)]` to the crate attributes to enable

warning: type `f32x3` should have an upper camel case name
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:2:8
  |
2 | struct f32x3(f32, f32, f32);
  |        ^^^^^ help: convert the identifier to upper camel case (notice the capitalization): `F32x3`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0094]: intrinsic has wrong number of type parameters: found 1, expected 2
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:5:19
  |
5 |     fn simd_insert<T>(x: T, idx: u32, val: U) -> T;
  |                   ^^^ expected 2 type parameter

error[E0308]: mismatched types
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:5
  |
7 | fn main() {
  |           - expected `()` because of default return type
8 |     const U: f32x3 = f32x3(13., 14., 15.);
9 |     const { simd_insert(U, 1_u32, 42_f32) }
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `f32x3`

error: internal compiler error: compiler/rustc_mir/src/interpret/place.rs:463:18: `mplace_index` called on non-array type f32x3
 --> perses_node_priority_with_dfs_delta_reduced_mutant.rs:9:13
  |
9 |     const { simd_insert(U, 1_u32, 42_f32) }
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

thread 'rustc' panicked at 'Box<Any>', /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/std/src/panic.rs:59:5
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::span_bug
   3: rustc_errors::Handler::span_bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::span_bug_fmt
   7: rustc_mir::interpret::intrinsics::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::emulate_intrinsic
   8: <rustc_mir::const_eval::machine::CompileTimeInterpreter as rustc_mir::interpret::machine::Machine>::call_intrinsic
   9: rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::eval_fn_call
  10: rustc_mir::interpret::step::<impl rustc_mir::interpret::eval_context::InterpCx<M>>::run
  11: rustc_mir::const_eval::eval_queries::eval_to_allocation_raw_provider
  12: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::eval_to_allocation_raw>::compute
  13: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  14: rustc_data_structures::stack::ensure_sufficient_stack
  15: rustc_query_system::query::plumbing::force_query_with_job
  16: rustc_query_system::query::plumbing::get_query_impl
  17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::eval_to_allocation_raw
  18: rustc_mir::const_eval::eval_queries::eval_to_const_value_raw_provider
  19: rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::eval_to_const_value_raw>::compute
  20: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  21: rustc_data_structures::stack::ensure_sufficient_stack
  22: rustc_query_system::query::plumbing::force_query_with_job
  23: rustc_query_system::query::plumbing::get_query_impl
  24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::eval_to_const_value_raw
  25: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_global_id
  26: rustc_middle::mir::interpret::queries::<impl rustc_middle::ty::context::TyCtxt>::const_eval_resolve
  27: rustc_infer::infer::InferCtxt::const_eval_resolve
  28: rustc_trait_selection::traits::const_evaluatable::is_const_evaluatable
  29: rustc_trait_selection::traits::fulfill::FulfillProcessor::progress_changed_obligations
  30: rustc_data_structures::obligation_forest::ObligationForest<O>::process_obligations
  31: <rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::select_where_possible
  32: rustc_typeck::check::fn_ctxt::_impl::<impl rustc_typeck::check::fn_ctxt::FnCtxt>::select_obligations_where_possible
  33: rustc_infer::infer::InferCtxtBuilder::enter
  34: rustc_typeck::check::typeck
  35: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  36: rustc_data_structures::stack::ensure_sufficient_stack
  37: rustc_query_system::query::plumbing::force_query_with_job
  38: rustc_query_system::query::plumbing::get_query_impl
  39: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
  40: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  41: rustc_typeck::check::typeck_item_bodies
  42: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  43: rustc_data_structures::stack::ensure_sufficient_stack
  44: rustc_query_system::query::plumbing::force_query_with_job
  45: rustc_query_system::query::plumbing::get_query_impl
  46: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
  47: rustc_session::utils::<impl rustc_session::session::Session>::time
  48: rustc_typeck::check_crate
  49: rustc_interface::passes::analysis
  50: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  51: rustc_data_structures::stack::ensure_sufficient_stack
  52: rustc_query_system::query::plumbing::force_query_with_job
  53: rustc_query_system::query::plumbing::get_query_impl
  54: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  55: rustc_interface::passes::QueryContext::enter
  56: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  57: rustc_span::with_source_map
  58: rustc_interface::interface::create_compiler_and_run
  59: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.52.0-nightly (8f349be27 2021-03-08) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `main::{constant#0}`
#1 [eval_to_const_value_raw] simplifying constant for the type system `main::{constant#0}`
#2 [typeck] type-checking `main`
#3 [typeck_item_bodies] type-checking all item bodies
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 6 previous errors; 1 warning emitted

Some errors have detailed explanations: E0094, E0308, E0412, E0658.
For more information about an error, try `rustc --explain E0094`.

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