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: unrecognized representation hint #118334

Closed
matthiaskrgr opened this issue Nov 26, 2023 · 1 comment · Fixed by #118366
Closed

ICE: unrecognized representation hint #118334

matthiaskrgr opened this issue Nov 26, 2023 · 1 comment · Fixed by #118366
Assignees
Labels
A-attributes Area: #[attributes(..)] 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

@matthiaskrgr
Copy link
Member

snippet:

#[repr(Rust(16))]
fn main() {}

Version information

rustc 1.76.0-nightly (3bb017199 2023-11-26)
binary: rustc
commit-hash: 3bb0171999a65b0650d9405a7b2e8e7dc3476dec
commit-date: 2023-11-26
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: unrecognized representation hint
 --> /tmp/icemaker_global_tempdir.JyumvzAaUw4r/rustc_testrunner_tmpdir_reporting.9MA7E5rCByd0/mvce.rs:1:8
  |
1 | #[repr(Rust(16))]
  |        ^^^^^^^^
  |
note: delayed at compiler/rustc_attr/src/builtin.rs:1065:32
         0: <rustc_errors::HandlerInner>::emit_diagnostic
         1: rustc_attr::builtin::parse_repr_attr
         2: <rustc_lint::BuiltinCombinedEarlyLintPass as rustc_lint::passes::EarlyLintPass>::check_item
         3: <rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass> as rustc_ast::visit::Visitor>::visit_item
         4: rustc_interface::passes::early_lint_checks
         5: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::early_lint_checks::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
         6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
         7: rustc_query_impl::query_impl::early_lint_checks::get_query_non_incr::__rust_end_short_backtrace
         8: rustc_ast_lowering::lower_to_hir
         9: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        11: rustc_query_impl::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
        12: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::hir_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        13: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_hir::hir_id::OwnerId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        14: rustc_query_impl::query_impl::hir_attrs::get_query_non_incr::__rust_end_short_backtrace
        15: <rustc_middle::hir::map::Map>::attrs
        16: rustc_passes::entry::entry_fn
        17: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::entry_fn::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 12]>>
        18: <rustc_query_impl::query_impl::entry_fn::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, ())>>::call_once
        19: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 12]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        20: rustc_query_impl::query_impl::entry_fn::get_query_non_incr::__rust_end_short_backtrace
        21: rustc_interface::passes::analysis
        22: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        24: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        25: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        26: std::sys_common::backtrace::__rust_begin_short_backtrace::<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#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        27: <<std::thread::Builder>::spawn_unchecked_<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#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        28: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/3bb0171999a65b0650d9405a7b2e8e7dc3476dec/library/alloc/src/boxed.rs:2007:9
        29: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/3bb0171999a65b0650d9405a7b2e8e7dc3476dec/library/alloc/src/boxed.rs:2007:9
        30: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/3bb0171999a65b0650d9405a7b2e8e7dc3476dec/library/std/src/sys/unix/thread.rs:108:17
        31: <unknown>
        32: <unknown>
 --> /tmp/icemaker_global_tempdir.JyumvzAaUw4r/rustc_testrunner_tmpdir_reporting.9MA7E5rCByd0/mvce.rs:1:8
  |
1 | #[repr(Rust(16))]
  |        ^^^^^^^^

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.76.0-nightly (3bb017199 2023-11-26) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 2 previous errors


@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Nov 26, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 26, 2023
@fmease fmease added A-attributes Area: #[attributes(..)] and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 26, 2023
@fmease fmease self-assigned this Nov 26, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2023-08-26

#114201

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 27, 2023
…t-repr, r=compiler-errors

Detect and reject malformed `repr(Rust)` hints

Fixes rust-lang#118334.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Nov 27, 2023
…t-repr, r=compiler-errors

Detect and reject malformed `repr(Rust)` hints

Fixes rust-lang#118334.
@bors bors closed this as completed in 903789d Nov 28, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 28, 2023
Rollup merge of rust-lang#118366 - fmease:detect-reject-malformed-rust-repr, r=compiler-errors

Detect and reject malformed `repr(Rust)` hints

Fixes rust-lang#118334.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: #[attributes(..)] 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.

3 participants