rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.1k stars 12.55k forks source link

Crash in decoder.rs: 'called `Option::unwrap()` on a `None` value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75 #79856

Closed Nanduhirion closed 3 years ago

Nanduhirion commented 3 years ago

Code

I suppose it has something to do with "clone_into" since this was the last line I added. Before that compiling was successful.

         let w: u32 = (b.width - b.x).ceil() as u32;
            let h: u32 = (b.height - b.y).ceil() as u32;
            let mut pixels = vec![127 as u8; (w * h * 4) as usize];
            let fractal: Fractal = calculation::Fractal::new(
                0.0,
                0.0,
                3.0,
                512,
                4.0,
                w as i32,
                h as i32,
                calculation::Fractal::c_modulo,
                4,
                w as i32 *4,
            );
            let p: Arc<Mutex<FractalParams>> = Arc::clone(&fractal.params);
            let p2: MutexGuard<FractalParams> = p.lock().unwrap();
            p2.calculate_fractal();
            let p3 = p2.pixels.lock().unwrap();
            p3.clone_into(&mut pixels);
            let image_handle: Handle = image::Handle::from_pixels(w, h, pixels);

            (
                Primitive::Image { handle: image_handle, bounds: b },

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (e792288df 2020-12-05)
binary: rustc
commit-hash: e792288df31636ca28108516c63a00ce4267063a
commit-date: 2020-12-05
host: x86_64-pc-windows-msvc
release: 1.50.0-nightly

Error output

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75

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.50.0-nightly (e792288df 2020-12-05) running on x86_64-pc-windows-msvc

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental -C target-feature=+adx,+aes,+amx-bf16,+amx-int8,+amx-tile,+avx,+avx2,+avx512bf16,+avx512bitalg,+avx512bw,+avx512cd,+avx512dq,+avx512er,+avx512f,+avx512ifma,+avx512pf,+avx512vbmi,+avx512vbmi2,+avx512vl,+avx512vnni,+avx512vp2intersect,+avx512vpopcntdq,-bmi,-bmi2,+branchfusion,+clflushopt,+clwb,+cmov,+cx16,+cx8,+enqcmd,+ermsb,+f16c,+fast-11bytenop,+fast-15bytenop,+fast-7bytenop,-fast-bextr,+fast-gather,+fast-hops,+fast-lzcnt,+fast-scalar-fsqrt,+fast-scalar-shift-masks,+fast-shld-rotate,+fast-variable-shuffle,+fast-vector-fsqrt,+fast-vector-shift-masks,+fma,+fma4,+fsgsbase,+fxsr,+gfni,+idivl-to-divb,+idivq-to-divl,+lwp,+lzcnt,+macrofusion,+merge-to-threeway-branch,+mmx,+movbe,+movdir64b,+movdiri,+mwaitx,+nopl,+pad-short-functions,+pclmul,+pconfig,+popcnt,+prefer-256-bit,+prefer-mask-registers,+prfchw,+ptwrite,+rdpid,+rdrnd,+rdseed,+rtm,+sahf,+serialize,+sha,+shstk,+sse,+sse-unaligned-mem,+sse2,+sse3,+sse4.1,+sse4.2,+sse4a,+ssse3,-tbm,+tsxldtrk,+use-aa,+use-glm-div-sqrt-costs,+vaes,+vpclmulqdq,+vzeroupper,+waitpkg,+wbnoinvd,+xop,+xsave,+xsavec,+xsaveopt,+xsaves --crate-type bin

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

query stack during panic:
#0 [codegen_fn_attrs] computing codegen attributes of `futures_task::future_obj::if_alloc::<impl iced_native::futures::future::UnsafeFutureObj<'a, T> for std::boxed::Box<F>>::into_raw`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
Backtrace

``` thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler\rustc_metadata\src\rmeta\decoder.rs:1565:75 stack backtrace: 0: 0x7ffcaebbb865 - ::fmt::h106ca6f8fb6a294d 1: 0x7ffcaebe727b - core::fmt::write::h6390b994d95aebdb 2: 0x7ffcaebacefd - ::fmt::hd713332ae62141f3 3: 0x7ffcaebbfbdd - std::panicking::take_hook::h78f8a454f3a4df82 4: 0x7ffcaebbf66a - std::panicking::take_hook::h78f8a454f3a4df82 5: 0x7ffc9fc61127 - rustc_driver::report_ice::h4bc3647b6f621de8 6: 0x7ffcaebc0730 - std::panicking::rust_panic_with_hook::h931fd6f26be82856 7: 0x7ffcaebc01d3 - rust_begin_unwind 8: 0x7ffcaebbc20f - ::fmt::h106ca6f8fb6a294d 9: 0x7ffcaebc0159 - rust_begin_unwind 10: 0x7ffcaebe32f0 - core::panicking::panic_fmt::h45da916c710b88f7 11: 0x7ffcaebe323c - core::panicking::panic::h3a7a516f2be28c18 12: 0x7ffca3404ba6 - rustc_metadata::dynamic_lib::DynamicLibrary::open::h6e15f450696ffdaf 13: 0x7ffca359eb5d - rustc_metadata::rmeta::decoder::cstore_impl::::def_path_hash_to_def_id::hb8b08d53ae47c264 14: 0x7ffca40f1352 - rustc_middle::ty::query::on_disk_cache::OnDiskCache::compute_cnum_map::hbae92ac2867b06ae 15: 0x7ffca3f007b9 - rustc_middle::ty::query::force_from_dep_node::h841e1a791cab1f4a 16: 0x7ffca43d7425 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1 17: 0x7ffca43d721a - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1 18: 0x7ffca4020281 - rustc_middle::ty::context::TyCtxt::_intern_place_elems::hf379b6ef10105517 19: 0x7ffca42afdd8 - rustc_middle::ty::context::tls::TLV::__getit::h04ab82409bdf58e1 20: 0x7ffca419c788 - rustc_middle::mir::mono::MonoItem::instantiation_mode::hc366da6f5e5e4fc5 21: 0x7ffca2be31e4 - ::fmt::h2537cda26d18b021 22: 0x7ffca2da2dd8 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 23: 0x7ffca2da24ff - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 24: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 25: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 26: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 27: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 28: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 29: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 30: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 31: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 32: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 33: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 34: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 35: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 36: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 37: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 38: 0x7ffca2da2600 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 39: 0x7ffca2f997d3 - ::fmt::h754ae9e4acd7ca7f 40: 0x7ffca2da1551 - rustc_mir::monomorphize::collector::collect_crate_mono_items::h3b6010febd9be0ec 41: 0x7ffca2e53592 - rustc_mir::monomorphize::partitioning::partition::hf4e9b71f30996dc1 42: 0x7ffca005b6a7 - ::fmt::hcd3349ee8b0cb4a5 43: 0x7ffc9ff4f3ce - ::attrs::h9f7930f3acf2c906 44: 0x7ffc9ff9a637 - ::msvc_basic_name::h3aa8bca1fb5698b6 45: 0x7ffc9ffd3dc1 - rustc_codegen_llvm::type_::::reg_backend_type::h5c329ef30d26310a 46: 0x7ffca00f83e4 - ::unchecked_umul::h41879df1ba38c684 47: 0x7ffca0072d24 - ::codegen_crate::h409f60e0ae4aaf13 48: 0x7ffc9fe58ede - rustc_interface::interface::parse_cfgspecs::he4e421c50de55949 49: 0x7ffc9fe8d3da - rustc_interface::passes::BoxedResolver::to_resolver_outputs::hb096f93f8cf6df4c 50: 0x7ffc9fed5a46 - rustc_interface::queries::Queries::ongoing_codegen::ha9e2915cfb307d3a 51: 0x7ffc9fc08b74 - ::no_crt_objects::h47dd01e667a15f55 52: 0x7ffc9fc99aac - ::fmt::hb838ed2d57a61e3c 53: 0x7ffc9fc09bfc - ::no_crt_objects::h47dd01e667a15f55 54: 0x7ffc9fcb0f84 - ::fmt::hb838ed2d57a61e3c 55: 0x7ffc9fcb8270 - rustc_ast::util::parser::prec_let_scrutinee_needs_par::h0da38a96661182e5 56: 0x7ffc9fc12a3d - ::no_crt_objects::h47dd01e667a15f55 57: 0x7ffcaebcf4f7 - std::sys::windows::thread::Thread::new::h05d768f6146b61f1 58: 0x7ffd47f87034 - BaseThreadInitThunk 59: 0x7ffd49f3d0d1 - RtlUserThreadStart ```

camelid commented 3 years ago

Duplicate of #79779.