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: repr packed not a power of 2 #16284

Closed
matthiaskrgr opened this issue Jan 6, 2024 · 0 comments · Fixed by #16285
Closed

ice: repr packed not a power of 2 #16284

matthiaskrgr opened this issue Jan 6, 2024 · 0 comments · Fixed by #16285
Labels
C-bug Category: bug I-panic

Comments

@matthiaskrgr
Copy link
Member

#[repr(packed(5))]
struct S 

rust-analyzer highlight < a.rs

thread 'main' panicked at crates/hir-def/src/data/adt.rs:131:56:
called `Result::unwrap()` on an `Err` value: `5` is not a power of 2
stack backtrace:
   0: rust_begin_unwind
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/595bc6f00369475047538fdae1ff8cea692ac385/library/core/src/result.rs:1649:5
   3: hir_def::data::adt::repr_from_value
   4: <hir_def::db::StructDataWithDiagnosticsQuery as salsa::plumbing::QueryFunction>::execute
   5: <salsa::derived::slot::Slot<hir_def::db::StructDataWithDiagnosticsQuery, salsa::derived::AlwaysMemoizeValue>>::execute
   6: <_ as hir_def::db::DefDatabase>::struct_data_with_diagnostics::__shim
   7: <ide_db::RootDatabase as hir_def::db::DefDatabase>::struct_data_with_diagnostics
   8: <salsa::derived::slot::Slot<hir_def::db::StructDataQuery, salsa::derived::AlwaysMemoizeValue>>::execute
   9: <_ as hir_def::db::DefDatabase>::struct_data::__shim
  10: <hir::Struct as hir::HasVisibility>::visibility
  11: <hir::Adt as hir::HasVisibility>::visibility
  12: <ide_db::defs::Definition>::visibility
  13: ide::syntax_highlighting::highlight::highlight_def
  14: ide::syntax_highlighting::highlight
  15: <ide::Analysis>::highlight_as_html
  16: <rust_analyzer::cli::flags::Highlight>::run
  17: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

rust-analyzer 1.77.0-nightly (595bc6f 2024-01-05)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug I-panic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants