Skip to content

[ICE]: wrong meta list delimiters #154847

@matthiaskrgr

Description

@matthiaskrgr

Code

fn main() { let _ : fn(#[expect[]] i32); }

Meta

rustc --version --verbose:

rustc 1.96.0-nightly (e0e95a718 2026-04-04)
binary: rustc
commit-hash: e0e95a71872dfe9e15d22bddea9ac45c85ddda1a
commit-date: 2026-04-04
host: x86_64-unknown-linux-gnu
release: 1.96.0-nightly
LLVM version: 22.1.2

Error output

<output>
Backtrace

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: wrong meta list delimiters
 --> code.rs:1:32
  |
1 | fn main() { let _ : fn(#[expect[]] i32); }
  |                                ^^
  |
note: delayed at /rustc-dev/e0e95a71872dfe9e15d22bddea9ac45c85ddda1a/compiler/rustc_attr_parsing/src/parser.rs:144:54
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_errors::diagnostic::Diag>::delay_as_bug
         4: <rustc_attr_parsing::context::ShouldEmit>::emit_err
         5: <rustc_attr_parsing::parser::ArgParser>::from_attr_args
         6: <rustc_lint::levels::LintLevelsBuilder<rustc_lint::levels::TopDown>>::push
         7: <rustc_ast::ast::FnDecl as rustc_ast::visit::Walkable<rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedPreExpansionLintPass>>>::walk_ref
         8: rustc_ast::visit::walk_fn::<rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedPreExpansionLintPass>>
         9: rustc_ast::visit::walk_item_inner::<rustc_ast::ast::ItemKind, rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedPreExpansionLintPass>>
        10: rustc_interface::passes::configure_and_expand
        11: rustc_interface::passes::resolver_for_lowering_raw
        12: rustc_query_impl::query_impl::resolver_for_lowering_raw::invoke_provider_fn::__rust_begin_short_backtrace
        13: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 16]>>, false>
        14: rustc_query_impl::query_impl::resolver_for_lowering_raw::execute_query_non_incr::__rust_end_short_backtrace
        15: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
        16: std::sys::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<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
        17: <std::thread::lifecycle::spawn_unchecked<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        18: <std::sys::thread::unix::Thread>::new::thread_start
        19: <unknown>
        20: <unknown>

 --> code.rs:1:32
  |
1 | fn main() { let _ : fn(#[expect[]] i32); }
  |                                ^^
help: the delimiters should be `(` and `)`
  |
1 - fn main() { let _ : fn(#[expect[]] i32); }
1 + fn main() { let _ : fn(#[expect()] i32); }
  |

error: internal compiler error: wrong meta list delimiters
 --> code.rs:1:32
  |
1 | fn main() { let _ : fn(#[expect[]] i32); }
  |                                ^^
  |
note: delayed at /rustc-dev/e0e95a71872dfe9e15d22bddea9ac45c85ddda1a/compiler/rustc_attr_parsing/src/parser.rs:144:54
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_errors::diagnostic::Diag>::delay_as_bug
         4: <rustc_attr_parsing::context::ShouldEmit>::emit_err
         5: <rustc_attr_parsing::parser::ArgParser>::from_attr_args
         6: <rustc_lint::levels::LintLevelsBuilder<rustc_lint::levels::TopDown>>::push
         7: <rustc_ast::ast::FnDecl as rustc_ast::visit::Walkable<rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass>>>::walk_ref
         8: <rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass>>::with_lint_attrs::<<rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass> as rustc_ast::visit::Visitor>::visit_local::{closure#0}>::{closure#0}
         9: rustc_ast::visit::visit_stmts::<rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass>>
        10: rustc_ast::visit::walk_fn::<rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass>>
        11: rustc_ast::visit::walk_item_inner::<rustc_ast::ast::ItemKind, rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass>>
        12: <rustc_lint::early::EarlyContextAndPass<rustc_lint::BuiltinCombinedEarlyLintPass> as rustc_ast::visit::Visitor>::visit_item
        13: rustc_interface::passes::early_lint_checks
        14: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
        15: rustc_query_impl::query_impl::early_lint_checks::execute_query_non_incr::__rust_end_short_backtrace
        16: rustc_ast_lowering::lower_to_hir
        17: rustc_query_impl::query_impl::hir_crate::invoke_provider_fn::__rust_begin_short_backtrace
        18: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 8]>>, false>
        19: rustc_query_impl::query_impl::hir_crate::execute_query_non_incr::__rust_end_short_backtrace
        20: rustc_middle::hir::map::hir_crate_items
        21: rustc_query_impl::query_impl::hir_crate_items::invoke_provider_fn::__rust_begin_short_backtrace
        22: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 8]>>, false>
        23: rustc_query_impl::query_impl::hir_crate_items::execute_query_non_incr::__rust_end_short_backtrace
        24: rustc_interface::passes::analysis
        25: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
        26: rustc_query_impl::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
        27: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
        28: std::sys::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<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
        29: <std::thread::lifecycle::spawn_unchecked<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        30: <std::sys::thread::unix::Thread>::new::thread_start
        31: <unknown>
        32: <unknown>

 --> code.rs:1:32
  |
1 | fn main() { let _ : fn(#[expect[]] i32); }
  |                                ^^
help: the delimiters should be `(` and `)`
  |
1 - fn main() { let _ : fn(#[expect[]] i32); }
1 + fn main() { let _ : fn(#[expect()] i32); }
  |

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/matthias/vcs/github/CRED/rustc-ice-2026-04-05T12_49_36-4156850.txt` to your bug report

note: rustc 1.96.0-nightly (e0e95a718 2026-04-04) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions