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

expected bits of [u32; 4], got Const #87209

Closed
wrnrlr opened this issue Jul 17, 2021 · 2 comments
Closed

expected bits of [u32; 4], got Const #87209

wrnrlr opened this issue Jul 17, 2021 · 2 comments
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

@wrnrlr
Copy link

wrnrlr commented Jul 17, 2021

Code

There is not much info in backtrace on where the problem originates so you'll have to build my entire project.

It probably has something todo with my use of std_simd, I also used to use the fn_traits but I turned it off to rule this out.

The project is very much still a WIP, many todo!(), but now I am stuck with this cryptic error.

git clone https://github.com/wrnrlr/g3
cd g3
rustup update -- nightly
RUST_BACKTRACE=full cargo build --verbose

Meta

My project uses the experimental crate std_simd

rustc --version --verbose:

rustc 1.55.0-nightly (952fdf2a1 2021-07-05)
binary: rustc
commit-hash: 952fdf2a1119affa1b37bcacb0c49cf9f0168ac8
commit-date: 2021-07-05
host: x86_64-apple-darwin
release: 1.55.0-nightly
LLVM version: 12.0.1

Error output

Backtrace

cargo build --verbose
       Fresh core_simd v0.1.0 (https://github.com/rust-lang/stdsimd#715f9ac4)
   Compiling g3 v0.1.0 (/Users/werner/Development/explore-rs/g3)
     Running `rustc --crate-name g3 --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=7c9046b49ab85c5d -C extra-filename=-7c9046b49ab85c5d --out-dir /Users/werner/Development/explore-rs/g3/target/debug/deps -C incremental=/Users/werner/Development/explore-rs/g3/target/debug/incremental -L dependency=/Users/werner/Development/explore-rs/g3/target/debug/deps --extern core_simd=/Users/werner/Development/explore-rs/g3/target/debug/deps/libcore_simd-bed9c2aba59047b0.rmeta`
error: internal compiler error: /rustc/952fdf2a1119affa1b37bcacb0c49cf9f0168ac8/compiler/rustc_middle/src/ty/consts.rs:195:32: expected bits of [u32; 4], got Const {
    ty: [u32; 4],
    val: Value(
        ByRef {
            alloc: Allocation {
                bytes: [
                    1,
                    0,
                    0,
                    0,
                    1,
                    0,
                    0,
                    0,
                    3,
                    0,
                    0,
                    0,
                    3,
                    0,
                    0,
                    0,
                ],
                relocations: Relocations(
                    SortedMap {
                        data: [],
                    },
                ),
                init_mask: InitMask {
                    blocks: [
                        65535,
                    ],
                    len: Size {
                        raw: 16,
                    },
                },
                align: Align {
                    pow2: 2,
                },
                mutability: Not,
                extra: (),
            },
            offset: Size {
                raw: 0,
            },
        },
    ),
}

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1006:9
stack backtrace:
   0:        0x10f194ba4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8e4ba4b55e218172
   1:        0x10f1f941c - core::fmt::write::h678ac65252cdb936
   2:        0x10f18694a - std::io::Write::write_fmt::h6e4183435968e8c5
   3:        0x10f19884f - std::panicking::default_hook::{{closure}}::h2d4327b072954705
   4:        0x10f19834d - std::panicking::default_hook::hf452eeb666b7d536
   5:        0x1078413d0 - rustc_driver::DEFAULT_HOOK::{{closure}}::{{closure}}::hb10ccdcf7a10d4d6
   6:        0x10f1990a6 - std::panicking::rust_panic_with_hook::hde5e2d5c940e2374
   7:        0x10ba18e51 - std::panicking::begin_panic::{{closure}}::h09fb2f46972469bd
   8:        0x10ba18e29 - std::sys_common::backtrace::__rust_end_short_backtrace::hf1a0ac76cfe0227a
   9:        0x10bcff681 - std::panicking::begin_panic::h6de7619ec68bd39e
  10:        0x10ba46350 - std::panic::panic_any::h96f9ffd7294f421e
  11:        0x10ba4c90c - rustc_errors::HandlerInner::bug::he733928a9de035b4
  12:        0x10ba4a727 - rustc_errors::Handler::bug::h4784dba70a4dbab9
  13:        0x10b723896 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h286f16855f9248bd
  14:        0x10b721af6 - rustc_middle::ty::context::tls::with_opt::{{closure}}::h6c998c2ea69cf380
  15:        0x10b721abf - rustc_middle::ty::context::tls::with_opt::he8b3292aa49fb660
  16:        0x10b7237db - rustc_middle::util::bug::opt_span_bug_fmt::hbb96084821d041fb
  17:        0x10bceb57f - rustc_middle::util::bug::bug_fmt::h6e1f261b90636146
  18:        0x10aead1fc - rustc_middle::ty::consts::Const::eval_bits::{{closure}}::h01471149f63020b7
  19:        0x10aeb4c1c - rustc_codegen_ssa::debuginfo::type_names::push_generic_params_internal::h0ec75a29c264ffa5
  20:        0x10aeb4d39 - rustc_codegen_ssa::debuginfo::type_names::push_generic_params::h36bc8aa103af54d4
  21:        0x107ac0734 - rustc_codegen_llvm::debuginfo::<impl rustc_codegen_ssa::traits::debuginfo::DebugInfoMethods for rustc_codegen_llvm::context::CodegenCx>::dbg_scope_fn::get_template_parameters::hd6124ca140aaed20
  22:        0x107aa6b69 - rustc_codegen_llvm::debuginfo::<impl rustc_codegen_ssa::traits::debuginfo::DebugInfoMethods for rustc_codegen_llvm::context::CodegenCx>::dbg_scope_fn::hcca3bb4866a09e04
  23:        0x107aa6549 - rustc_codegen_llvm::debuginfo::<impl rustc_codegen_ssa::traits::debuginfo::DebugInfoMethods for rustc_codegen_llvm::context::CodegenCx>::create_function_debug_context::h4cad27e2b163d2c0
  24:        0x107b17015 - rustc_codegen_ssa::mir::codegen_mir::h8802be8f360ba2ac
  25:        0x107aaf9f9 - rustc_codegen_ssa::base::codegen_instance::hc08e74e094e9d1be
  26:        0x107ada747 - <rustc_middle::mir::mono::MonoItem as rustc_codegen_ssa::mono_item::MonoItemExt>::define::hc24ae48e1c07492d
  27:        0x107ae8207 - rustc_codegen_llvm::base::compile_codegen_unit::module_codegen::h229a27288fe6bc45
  28:        0x107ab1b45 - rustc_query_system::dep_graph::graph::DepGraph<K>::with_task::hbfbc0c25c3f962f5
  29:        0x107ae7aeb - rustc_codegen_llvm::base::compile_codegen_unit::hae3f7bf3b0beff3a
  30:        0x107ac3e49 - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate::hf32e2045db3ef8fd
  31:        0x10795f87f - rustc_interface::passes::QueryContext::enter::h11f82127e4008651
  32:        0x107954b70 - rustc_interface::queries::Queries::ongoing_codegen::h29d60078ceabc575
  33:        0x1078801af - rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter::h3d6cee83f8b47607
  34:        0x10784fc96 - rustc_span::with_source_map::ha566d69d849bf45e
  35:        0x1078814d2 - rustc_interface::interface::create_compiler_and_run::h264b0e3d32b6b828
  36:        0x10785780f - scoped_tls::ScopedKey<T>::set::hb0cfa40314cdb8ba
  37:        0x1078503a9 - std::sys_common::backtrace::__rust_begin_short_backtrace::h959ec48bf0ae4e08
  38:        0x107844c8d - core::ops::function::FnOnce::call_once{{vtable.shim}}::h3b5b99f09ce5294a
  39:        0x10f1a45bb - std::sys::unix::thread::Thread::new::thread_start::hec67ea2955c28c58
  40:     0x7fff20358950 - __pthread_start

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.55.0-nightly (952fdf2a1 2021-07-05) running on x86_64-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:
end of query stack
error: aborting due to previous error

error: could not compile `g3`

Caused by:
  process didn't exit successfully: `rustc --crate-name g3 --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=7c9046b49ab85c5d -C extra-filename=-7c9046b49ab85c5d --out-dir /Users/werner/Development/explore-rs/g3/target/debug/deps -C incremental=/Users/werner/Development/explore-rs/g3/target/debug/incremental -L dependency=/Users/werner/Development/explore-rs/g3/target/debug/deps --extern core_simd=/Users/werner/Development/explore-rs/g3/target/debug/deps/libcore_simd-bed9c2aba59047b0.rmeta` (exit status: 101)

@wrnrlr wrnrlr 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 Jul 17, 2021
@yotamofek
Copy link
Contributor

IMHO, this looks like a duplicate of #86893 , try running it with the latest nightly (your traceback says you are using the nightly from 2021-07-05).

@wrnrlr
Copy link
Author

wrnrlr commented Jul 17, 2021

Yes you are right, I was using an old version of the nightly release, I did run rustup update buit for some reason this did not update the nightly release, anyway did a uninstall and install and now it is building without any problem

@wrnrlr wrnrlr closed this as completed Jul 17, 2021
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

2 participants