-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Got a compiler panic while compiling ESP32-S3 code #135721
Comments
Possibly a duplicate of #135410. |
#135410 should already be fixed on nightly tho 🤔 |
Hmm, you're right, that is indeed strange |
I am pretty sure OP is using a fork of rustc, so I truly have no idea what the version string means. Our in-tree xtensa targets are broken, so the relevant community has been using a fork. See https://docs.esp-rs.org/book/installation/riscv-and-xtensa.html which is linked from one of the links posted in the issue description. |
@saethlin, you are right. I will close this issue. My bad, i'm kind of new in embedded Rust. For the STM32 environment I use the Rust toolchain, and I forgot that Espressif indeed forks their toolchain/compiler |
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: