Skip to content

Allow compilation recovery after emitting lint attr parsing error#154911

Closed
Bryntet wants to merge 3 commits intorust-lang:mainfrom
Bryntet:fix-error-emission-ice
Closed

Allow compilation recovery after emitting lint attr parsing error#154911
Bryntet wants to merge 3 commits intorust-lang:mainfrom
Bryntet:fix-error-emission-ice

Conversation

@Bryntet
Copy link
Copy Markdown
Contributor

@Bryntet Bryntet commented Apr 6, 2026

Fixes #154800 and adds regression test

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 6, 2026

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 6, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 6, 2026

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 10 candidates

@Bryntet
Copy link
Copy Markdown
Contributor Author

Bryntet commented Apr 6, 2026

adding the dependency from rustc_lint to rustc_parse shouldn't affect anything since rustc_parse is already a dep of rustc_attr_parsing

@rust-log-analyzer

This comment has been minimized.

@Bryntet Bryntet force-pushed the fix-error-emission-ice branch from ac3e190 to 9a2d310 Compare April 6, 2026 19:40
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failed to process buffered lint here (dummy = true)
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_lint::early::check_ast_node::<rustc_lint::BuiltinCombinedEarlyLintPass, (&rustc_ast::ast::Crate, &[rustc_ast::ast::Attribute])>
   3: rustc_interface::passes::early_lint_checks
      [... omitted 1 frame ...]
   4: rustc_ast_lowering::lower_to_hir
      [... omitted 1 frame ...]
   5: rustc_middle::hir::map::hir_crate_items
      [... omitted 1 frame ...]
   6: rustc_passes::hir_id_validator::check_crate
   7: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
   8: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
   9: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  10: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  11: rustc_span::create_session_globals_then::<(), 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#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: please attach the file at `/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/syn-2.0.87/rustc-ice-2026-04-07T18_35_36-29751.txt` to your bug report

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

note: compiler flags: --crate-type lib -C embed-bitcode=no -Z binary-dep-depinfo -Z on-broken-pipe=kill -Z allow-features=binary-dep-depinfo,proc_macro_span,proc_macro_span_shrink,proc_macro_diagnostic

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

query stack during panic:
#0 [early_lint_checks] perform lints prior to AST lowering
#1 [hir_crate] getting the crate HIR
#2 [hir_crate_items] getting HIR crate items
#3 [analysis] running analysis passes on crate `syn`
end of query stack
[RUSTC-TIMING] syn test:false 0.518
error: could not compile `syn` (lib)

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name syn --edition=2021 /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/syn-2.0.87/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("clone-impls", "default", "derive", "extra-traits", "fold", "full", "parsing", "printing", "proc-macro", "test", "visit", "visit-mut"))' -C metadata=c2c5a4152451e9fe -C extra-filename=-c321b268773f077a --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps --extern proc_macro2=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libproc_macro2-e84b3afd97ba1e0d.rmeta --extern quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libquote-14d2c5c577271fc0.rmeta --extern unicode_ident=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libunicode_ident-625858bb9072c24d.rmeta --cap-lints allow -Z binary-dep-depinfo` (exit status: 101)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] generic_array test:false 1.087
[RUSTC-TIMING] aho_corasick test:false 2.421
[RUSTC-TIMING] regex_syntax test:false 2.157
Bootstrap failed while executing `clippy ci --stage 2`

@JohnTitor
Copy link
Copy Markdown
Member

@rustbot reroll

@rustbot rustbot assigned mati865 and unassigned JohnTitor Apr 9, 2026
@JonathanBrouwer JonathanBrouwer added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Apr 9, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 10, 2026

☔ The latest upstream changes (presumably #155056) made this pull request unmergeable. Please resolve the merge conflicts.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

This PR should be integrated in the new attribute lint port attempt, rather than being a separate PR

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ICE]: malformed lint attributes

6 participants