Got a compiler panic while compiling ESP32-S3 code #135721
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I've added my code as a zip file to this ticket.
Only been using Rust for a few years in hobby projects. So I can answer superficial questions.
Keep in mind, it is written for embedded hardware. I was trying to implement a SPI display.
To run code: Follow the installation guide of the ESP-Rust book.
Crates used are esp-hal & mididsi
screen_bare_metal_spi_test.tar.gz
Code
Meta
rustc --version --verbose
:Error output
|
14 | use esp_hal::time::Instant;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note:
#[warn(unused_imports)]
on by defaultwarning: unused import:
esp_hal::time::now
--> src/bin/main.rs:15:5
|
15 | use esp_hal::time::now;
| ^^^^^^^^^^^^^^^^^^
warning: unused import:
esp_hal::time::Duration
--> src/bin/main.rs:16:5
|
16 | use esp_hal::time::Duration;
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import:
mipidsi::TestImage
--> src/bin/main.rs:25:5
|
25 | use mipidsi::TestImage;
| ^^^^^^^^^^^^^^^^^^
warning: unused import:
embedded_graphics::primitives::Rectangle
--> src/bin/main.rs:28:5
|
28 | use embedded_graphics::primitives::Rectangle;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused imports:
pixelcolor::Rgb666
andprelude::*
--> src/bin/main.rs:29:25
|
29 | use embedded_graphics::{prelude::*, pixelcolor::Rgb666};
| ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
thread 'rustc' panicked at compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:1824:44:
called
Option::unwrap()
on aNone
valuestack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::option::unwrap_failed
4: <rustc_trait_selection::error_reporting::TypeErrCtxt>::report_similar_impl_candidates
5: <rustc_trait_selection::error_reporting::TypeErrCtxt>::report_fulfillment_errors
6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_ambiguity_errors
7: rustc_hir_typeck::typeck
[... omitted 2 frames ...]
8: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}
9: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::par_for_each_in<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_analysis::check_crate::{closure#4}>::{closure#0}>::{closure#0}::{closure#1}::{closure#0}>
10: rustc_hir_analysis::check_crate
11: rustc_interface::passes::analysis
[... omitted 2 frames ...]
12: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}::{closure#6}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
13: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#0}::{closure#1}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
14: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
15: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}>
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.error: 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: please make sure that you have updated to the latest nightly
note: please attach the file at
/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/rustc-ice-2025-01-19T09_30_22-28243.txt
to your bug reportnote: compiler flags: --crate-type bin -C opt-level=s -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on -C incremental=[REDACTED] -Z unstable-options -C link-arg=-nostartfiles -C link-arg=-Tlinkall.x -C link-arg=-Tdefmt.x
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [typeck] type-checking
__xtensa_lx_rt_main
#1 [analysis] running analysis passes on this crate
end of query stack
warning:
screen_bare_metal_spi_test
(bin "screen_bare_metal_spi_test") generated 6 warnings (runcargo fix --bin "screen_bare_metal_spi_test"
to apply 6 suggestions)error: could not compile
screen_bare_metal_spi_test
(bin "screen_bare_metal_spi_test"); 6 warnings emittedCaused by:
process didn't exit successfully:
/home/matthew/.rustup/toolchains/esp/bin/rustc --crate-name screen_bare_metal_spi_test --edition=2021 src/bin/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=129 --crate-type bin --emit=dep-info,link -C opt-level=s -C embed-bitcode=no -C debuginfo=2 -C debug-assertions=on --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=ef34b501a97a8c11 -C extra-filename=-ef34b501a97a8c11 --out-dir /home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps --target xtensa-esp32s3-none-elf -C incremental=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/incremental -L dependency=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps -L dependency=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/debug/deps --extern 'noprelude:alloc=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/liballoc-1512caddedacf3da.rlib' --extern 'noprelude:compiler_builtins=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libcompiler_builtins-4077c3db8c2eb37a.rlib' --extern 'noprelude:core=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libcore-9a0f746d2d847a70.rlib' --extern critical_section=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libcritical_section-9f65225161fb896d.rlib --extern defmt=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libdefmt-c657a2f2d7e7a401.rlib --extern defmt_rtt=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libdefmt_rtt-317e42e5650eeb5a.rlib --extern embedded_graphics=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libembedded_graphics-e41c0519d1949542.rlib --extern embedded_hal_bus=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libembedded_hal_bus-c8cecb0aa84631e5.rlib --extern esp_alloc=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libesp_alloc-08f13656ca7d541b.rlib --extern esp_backtrace=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libesp_backtrace-b06a017ce9825da8.rlib --extern esp_hal=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libesp_hal-ce2746cbfa5920b3.rlib --extern mipidsi=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libmipidsi-988715cd7b825ce2.rlib --extern screen_bare_metal_spi_test=/home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/deps/libscreen_bare_metal_spi_test-0087d207e36b78da.rlib -Z unstable-options -C link-arg=-nostartfiles -C link-arg=-Tlinkall.x -C link-arg=-Tdefmt.x -L /home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/build/defmt-2c4a5f4b4107e8c3/out -L /home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/build/esp-hal-c61d66a8eefff56c/out -L /home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/build/esp32s3-af46275828bccdd6/out -L /home/matthew/Git/DicerRoller/Software/RustTestProjects/screen_bare_metal_spi_test/target/xtensa-esp32s3-none-elf/debug/build/xtensa-lx-rt-a87d660fb6ae8a31/out
(exit status: 101)-->
Backtrace
The text was updated successfully, but these errors were encountered: