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

ICE: "Unsigned value 0x10000 does not fit in 16 bits" with #[repr(align(65536))] on 16-bit target in release mode, different ICE in debug mode. #131122

Closed
zachs18 opened this issue Oct 2, 2024 · 3 comments · Fixed by #131633
Assignees
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

@zachs18
Copy link
Contributor

zachs18 commented Oct 2, 2024

Code

// lib.rs
#![no_std]

#[repr(align(65536))]
struct Hello;

pub fn bar() -> usize { core::mem::align_of::<Hello>() }

Compile with cargo +nightly build -Z build-std=core --target avr-unknown-gnu-atmega328 --release (basically the same results with --target msp430-none-elf, also a 16-bit tier 3 target)

Meta

rustc --version --verbose:

rustc 1.83.0-nightly (fb4aebddd 2024-09-30)
binary: rustc
commit-hash: fb4aebddd18d258046ddb51fd41589295259a0fa
commit-date: 2024-09-30
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Error output

rustc-ice-2024-10-02T01_00_03-507058.txt

$ cargo +nightly build -Z build-std=core --target avr-unknown-gnu-atmega328 --release
   Compiling compiler_builtins v0.1.130
   Compiling core v0.0.0 (/home/zachary/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling rustc-std-workspace-core v1.99.0 (/home/zachary/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling avr-testing v0.1.0 (/tmp/avr-testing)
error: internal compiler error: /rustc/fb4aebddd18d258046ddb51fd41589295259a0fa/compiler/rustc_middle/src/mir/interpret/value.rs:139:32: Unsigned value 0x10000 does not fit in 16 bits

thread 'rustc' panicked at /rustc/fb4aebddd18d258046ddb51fd41589295259a0fa/compiler/rustc_middle/src/mir/interpret/value.rs:139:32:
Box<dyn Any>
stack backtrace:
   0:     0x7b30d60dbf7a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h700a654fe77e1f9c
   1:     0x7b30d68033e6 - core::fmt::write::ha8ac3a5009e0941e
   2:     0x7b30d79bcb51 - std::io::Write::write_fmt::h280500187b8ab992
   3:     0x7b30d60dbdd2 - std::sys::backtrace::BacktraceLock::print::h5b5702bc7edef58d
   4:     0x7b30d60de2f1 - std::panicking::default_hook::{{closure}}::h7c4c08203556436f
   5:     0x7b30d60de124 - std::panicking::default_hook::h4a5c0931e8301a2f
   6:     0x7b30d51a2d7f - std[170610031590a965]::panicking::update_hook::<alloc[66d4c008c69e86cd]::boxed::Box<rustc_driver_impl[26aaba0b9f674e85]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7b30d60dea08 - std::panicking::rust_panic_with_hook::hf9da426777cf33fb
   8:     0x7b30d51dcf11 - std[170610031590a965]::panicking::begin_panic::<rustc_errors[2b9f4ebbc725b026]::ExplicitBug>::{closure#0}
   9:     0x7b30d51cffb6 - std[170610031590a965]::sys::backtrace::__rust_end_short_backtrace::<std[170610031590a965]::panicking::begin_panic<rustc_errors[2b9f4ebbc725b026]::ExplicitBug>::{closure#0}, !>
  10:     0x7b30d51cb499 - std[170610031590a965]::panicking::begin_panic::<rustc_errors[2b9f4ebbc725b026]::ExplicitBug>
  11:     0x7b30d51e67a1 - <rustc_errors[2b9f4ebbc725b026]::diagnostic::BugAbort as rustc_errors[2b9f4ebbc725b026]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7b30d580cbd4 - rustc_middle[1155dac776b01d50]::util::bug::opt_span_bug_fmt::<rustc_span[d0163105bd3f350c]::span_encoding::Span>::{closure#0}
  13:     0x7b30d57f295a - rustc_middle[1155dac776b01d50]::ty::context::tls::with_opt::<rustc_middle[1155dac776b01d50]::util::bug::opt_span_bug_fmt<rustc_span[d0163105bd3f350c]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7b30d57f27eb - rustc_middle[1155dac776b01d50]::ty::context::tls::with_context_opt::<rustc_middle[1155dac776b01d50]::ty::context::tls::with_opt<rustc_middle[1155dac776b01d50]::util::bug::opt_span_bug_fmt<rustc_span[d0163105bd3f350c]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7b30d2dcd620 - rustc_middle[1155dac776b01d50]::util::bug::bug_fmt
  16:     0x7b30d72213ae - <rustc_mir_transform[de8989103c0dc9d3]::gvn::VnState>::insert
  17:     0x7b30d721479c - <rustc_mir_transform[de8989103c0dc9d3]::gvn::VnState>::simplify_rvalue
  18:     0x7b30d3ed1674 - <rustc_mir_transform[de8989103c0dc9d3]::gvn::GVN as rustc_mir_transform[de8989103c0dc9d3]::pass_manager::MirPass>::run_pass
  19:     0x7b30d680b98d - rustc_mir_transform[de8989103c0dc9d3]::pass_manager::run_passes_inner
  20:     0x7b30d71c8262 - rustc_mir_transform[de8989103c0dc9d3]::optimized_mir
  21:     0x7b30d71c6b1d - rustc_query_impl[180b75f2ddc39270]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[180b75f2ddc39270]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1155dac776b01d50]::query::erase::Erased<[u8; 8usize]>>
  22:     0x7b30d682f438 - rustc_query_system[9f857c887a67b714]::query::plumbing::try_execute_query::<rustc_query_impl[180b75f2ddc39270]::DynamicConfig<rustc_query_system[9f857c887a67b714]::query::caches::DefIdCache<rustc_middle[1155dac776b01d50]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[180b75f2ddc39270]::plumbing::QueryCtxt, false>
  23:     0x7b30d682e9f3 - rustc_query_impl[180b75f2ddc39270]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  24:     0x7b30d6831816 - rustc_middle[1155dac776b01d50]::query::plumbing::query_get_at::<rustc_query_system[9f857c887a67b714]::query::caches::DefIdCache<rustc_middle[1155dac776b01d50]::query::erase::Erased<[u8; 8usize]>>>
  25:     0x7b30d3f7c414 - rustc_mir_transform[de8989103c0dc9d3]::cross_crate_inline::cross_crate_inlinable
  26:     0x7b30d6b85005 - rustc_query_impl[180b75f2ddc39270]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[180b75f2ddc39270]::query_impl::cross_crate_inlinable::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1155dac776b01d50]::query::erase::Erased<[u8; 1usize]>>
  27:     0x7b30d6b833cb - rustc_query_system[9f857c887a67b714]::query::plumbing::try_execute_query::<rustc_query_impl[180b75f2ddc39270]::DynamicConfig<rustc_query_system[9f857c887a67b714]::query::caches::DefIdCache<rustc_middle[1155dac776b01d50]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[180b75f2ddc39270]::plumbing::QueryCtxt, false>
  28:     0x7b30d6b82f8a - rustc_query_impl[180b75f2ddc39270]::query_impl::cross_crate_inlinable::get_query_non_incr::__rust_end_short_backtrace
  29:     0x7b30d71beb04 - rustc_passes[7a90872e0502ca71]::reachable::recursively_reachable
  30:     0x7b30d696b537 - rustc_passes[7a90872e0502ca71]::reachable::reachable_set
  31:     0x7b30d76808b8 - rustc_query_impl[180b75f2ddc39270]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[180b75f2ddc39270]::query_impl::reachable_set::dynamic_query::{closure#2}::{closure#0}, rustc_middle[1155dac776b01d50]::query::erase::Erased<[u8; 8usize]>>
  32:     0x7b30d767f2b9 - rustc_query_system[9f857c887a67b714]::query::plumbing::try_execute_query::<rustc_query_impl[180b75f2ddc39270]::DynamicConfig<rustc_query_system[9f857c887a67b714]::query::caches::SingleCache<rustc_middle[1155dac776b01d50]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[180b75f2ddc39270]::plumbing::QueryCtxt, false>
  33:     0x7b30d767fade - rustc_query_impl[180b75f2ddc39270]::query_impl::reachable_set::get_query_non_incr::__rust_end_short_backtrace
  34:     0x7b30d6f5e2a8 - <rustc_metadata[a1e01f1b85ceac18]::rmeta::encoder::EncodeContext>::encode_crate_root
  35:     0x7b30d7812393 - rustc_metadata[a1e01f1b85ceac18]::rmeta::encoder::encode_metadata
  36:     0x7b30d781a814 - rustc_metadata[a1e01f1b85ceac18]::fs::encode_and_write_metadata
  37:     0x7b30d7819603 - <rustc_interface[67c5fa7b03b13b84]::queries::Linker>::codegen_and_build_linker
  38:     0x7b30d750950b - rustc_interface[67c5fa7b03b13b84]::interface::run_compiler::<core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>, rustc_driver_impl[26aaba0b9f674e85]::run_compiler::{closure#0}>::{closure#1}
  39:     0x7b30d7629650 - std[170610031590a965]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[67c5fa7b03b13b84]::util::run_in_thread_with_globals<rustc_interface[67c5fa7b03b13b84]::util::run_in_thread_pool_with_globals<rustc_interface[67c5fa7b03b13b84]::interface::run_compiler<core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>, rustc_driver_impl[26aaba0b9f674e85]::run_compiler::{closure#0}>::{closure#1}, core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>>::{closure#0}, core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>>
  40:     0x7b30d7629cba - <<std[170610031590a965]::thread::Builder>::spawn_unchecked_<rustc_interface[67c5fa7b03b13b84]::util::run_in_thread_with_globals<rustc_interface[67c5fa7b03b13b84]::util::run_in_thread_pool_with_globals<rustc_interface[67c5fa7b03b13b84]::interface::run_compiler<core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>, rustc_driver_impl[26aaba0b9f674e85]::run_compiler::{closure#0}>::{closure#1}, core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>>::{closure#0}, core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d68a251df926a28b]::result::Result<(), rustc_span[d0163105bd3f350c]::ErrorGuaranteed>>::{closure#1} as core[d68a251df926a28b]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  41:     0x7b30d762a0ab - std::sys::pal::unix::thread::Thread::new::thread_start::h5cf1ac2878833c32
  42:     0x7b30d189ca94 - start_thread
                               at ./nptl/pthread_create.c:447:8
  43:     0x7b30d1929c3c - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
  44:                0x0 - <unknown>

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 `/tmp/avr-testing/rustc-ice-2024-10-02T01_00_03-507058.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C strip=debuginfo -Z unstable-options

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `bar`
#1 [cross_crate_inlinable] whether the item should be made inlinable across crates
end of query stack
error: could not compile `avr-testing` (lib)

Caused by:
  process didn't exit successfully: `/home/zachary/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name avr_testing --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=180 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=10bbcaf4572e942c -C extra-filename=-10bbcaf4572e942c --out-dir /home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps --target avr-unknown-gnu-atmega328 -C strip=debuginfo -L dependency=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps -L dependency=/home/zachary/opt_mount/zachary/cargo-target/release/deps --extern 'noprelude:compiler_builtins=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps/libcompiler_builtins-7fd167500327228b.rmeta' --extern 'noprelude:core=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps/libcore-fa3c34da63eafa79.rmeta' -Z unstable-options` (exit status: 101)
warning: build failed, waiting for other jobs to finish...
Backtrace

$ RUST_BACKTRACE=1 cargo +nightly build -Z build-std=core --target avr-unknown-gnu-atmega328 --release
   Compiling compiler_builtins v0.1.130
   Compiling core v0.0.0 (/home/zachary/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling rustc-std-workspace-core v1.99.0 (/home/zachary/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling avr-testing v0.1.0 (/tmp/avr-testing)
error: internal compiler error: /rustc/fb4aebddd18d258046ddb51fd41589295259a0fa/compiler/rustc_middle/src/mir/interpret/value.rs:139:32: Unsigned value 0x10000 does not fit in 16 bits

thread 'rustc' panicked at /rustc/fb4aebddd18d258046ddb51fd41589295259a0fa/compiler/rustc_middle/src/mir/interpret/value.rs:139:32:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   5: rustc_middle::util::bug::bug_fmt
   6: <rustc_mir_transform::gvn::VnState>::insert
   7: <rustc_mir_transform::gvn::VnState>::simplify_rvalue
   8: <rustc_mir_transform::gvn::GVN as rustc_mir_transform::pass_manager::MirPass>::run_pass
   9: rustc_mir_transform::pass_manager::run_passes_inner
  10: rustc_mir_transform::optimized_mir
      [... omitted 1 frame ...]
  11: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>>
  12: rustc_mir_transform::cross_crate_inline::cross_crate_inlinable
      [... omitted 1 frame ...]
  13: rustc_passes::reachable::recursively_reachable
  14: rustc_passes::reachable::reachable_set
      [... omitted 1 frame ...]
  15: <rustc_metadata::rmeta::encoder::EncodeContext>::encode_crate_root
  16: rustc_metadata::rmeta::encoder::encode_metadata
  17: rustc_metadata::fs::encode_and_write_metadata
  18: <rustc_interface::queries::Linker>::codegen_and_build_linker
  19: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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 `/tmp/avr-testing/rustc-ice-2024-10-02T01_02_44-507394.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C strip=debuginfo -Z unstable-options

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `bar`
#1 [cross_crate_inlinable] whether the item should be made inlinable across crates
#2 [reachable_set] reachability
end of query stack
error: could not compile `avr-testing` (lib)

Caused by:
  process didn't exit successfully: `/home/zachary/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name avr_testing --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=180 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=10bbcaf4572e942c -C extra-filename=-10bbcaf4572e942c --out-dir /home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps --target avr-unknown-gnu-atmega328 -C strip=debuginfo -L dependency=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps -L dependency=/home/zachary/opt_mount/zachary/cargo-target/release/deps --extern 'noprelude:compiler_builtins=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps/libcompiler_builtins-7fd167500327228b.rmeta' --extern 'noprelude:core=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/release/deps/libcore-fa3c34da63eafa79.rmeta' -Z unstable-options` (exit status: 101)
warning: build failed, waiting for other jobs to finish...


If you remove --release (and do [profile.dev.packages."*"] opt-level = 3 to make core not run out of registers when compiling), then you get a different ICE:

rustc-ice-2024-10-02T01_15_57-511791.txt

Error output

$ RUST_BACKTRACE=1 cargo +nightly build -Z build-std=core --target avr-unknown-gnu-atmega328 
   Compiling avr-testing v0.1.0 (/tmp/avr-testing)
thread 'rustc' panicked at compiler/rustc_codegen_llvm/src/common.rs:170:13:
assertion failed: i < (1 << bit_size)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: <rustc_codegen_ssa::mir::FunctionCx<rustc_codegen_llvm::builder::Builder>>::codegen_rvalue_operand
   4: rustc_codegen_ssa::mir::codegen_mir::<rustc_codegen_llvm::builder::Builder>
   5: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
   6: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
   7: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
   8: <rustc_interface::queries::Linker>::codegen_and_build_linker
   9: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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 `/tmp/avr-testing/rustc-ice-2024-10-02T01_15_57-511791.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -Z unstable-options

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

query stack during panic:
end of query stack
error: could not compile `avr-testing` (lib)

Caused by:
  process didn't exit successfully: `/home/zachary/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name avr_testing --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=180 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=ee58599ee021bb48 -C extra-filename=-ee58599ee021bb48 --out-dir /home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/debug/deps --target avr-unknown-gnu-atmega328 -C incremental=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/debug/incremental -L dependency=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/debug/deps -L dependency=/home/zachary/opt_mount/zachary/cargo-target/debug/deps --extern 'noprelude:compiler_builtins=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/debug/deps/libcompiler_builtins-c8a0592a6a11b0cd.rmeta' --extern 'noprelude:core=/home/zachary/opt_mount/zachary/cargo-target/avr-unknown-gnu-atmega328/debug/deps/libcore-3761d8d6676445dc.rmeta' -Z unstable-options` (exit status: 101)

Note that if you remove pub fn bar or make it non-pub it compiles.

#[repr(align(1 << N))] or higher should probably just give an unconditional error on (≤N)-bit targets (or maybe just anything that would determine its layout could error, similar to how core::mem::size_of::<[u8; 0x1_0000_0000_0000]>() fails to compile with "values of the type [u8; 281474976710656] are too big for the current architecture" on x86_64-unknown-linux-gnu, but type T = [u8; 0x1_0000_0000_0000]; alone is Fine™).

@zachs18 zachs18 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 Oct 2, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 2, 2024
@asquared31415

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Oct 3, 2024

Error: Parsing assign command in comment failed: ...' assign' | error: specify user to assign to at >| ''...

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@asquared31415
Copy link
Contributor

@rustbot claim

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 4, 2024
@bors bors closed this as completed in 95a9d49 Oct 28, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 28, 2024
Rollup merge of rust-lang#131633 - asquared31415:align_isize_max, r=jieyouxu

error on alignments greater than `isize::MAX`

Fixes rust-lang#131122

On zulip someone had a concern that it was legal to create a type with alignment `isize::MAX + 1`, but I do not believe this should be allowed for `repr(align)`, as `repr(align)` also increases the *size* of the type, and that would be larger than the maximum allowed size of objects.

(cc `@workingjubilee` rust-lang#131276)
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

Successfully merging a pull request may close this issue.

4 participants