Skip to content

refactor: shrink check_attr by moving attribute checks to parsers#153845

Draft
herbenderbler wants to merge 1 commit intorust-lang:mainfrom
herbenderbler:ISSUE-153101/shrink-check-attrs
Draft

refactor: shrink check_attr by moving attribute checks to parsers#153845
herbenderbler wants to merge 1 commit intorust-lang:mainfrom
herbenderbler:ISSUE-153101/shrink-check-attrs

Conversation

@herbenderbler
Copy link

@herbenderbler herbenderbler commented Mar 14, 2026

Move check_custom_mir validation into rustc_attr_parsing (CustomMirParser).

Introduce late_validation with LateValidationContext and validators for:

  • #[deprecated], #[loop_match], #[const_continue]
  • diagnostic::on_unimplemented, diagnostic::on_const, diagnostic::do_not_recommend
  • #[link], #[macro_export]

Remove duplicated check_* logic from check_attr pass. Fix crate-root ICE
(opt_local_parent), CustomMir types, and directive/impl target handling.

Part of #153101.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 14, 2026
@herbenderbler herbenderbler force-pushed the ISSUE-153101/shrink-check-attrs branch 2 times, most recently from 7d4cf51 to b5ad742 Compare March 14, 2026 05:36
@rust-log-analyzer

This comment has been minimized.

Move check_custom_mir validation into rustc_attr_parsing (CustomMirParser).

Introduce late_validation with LateValidationContext and validators for:
- #[deprecated], #[loop_match], #[const_continue]
- diagnostic::on_unimplemented, diagnostic::on_const, diagnostic::do_not_recommend
- #[link], #[macro_export]

Remove duplicated check_* logic from check_attr pass. Fix crate-root ICE
(opt_local_parent), CustomMir types, and directive/impl target handling.

Part of rust-lang#153101.

Made-with: Cursor
@herbenderbler herbenderbler force-pushed the ISSUE-153101/shrink-check-attrs branch from b5ad742 to 1717ac5 Compare March 14, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

3 participants