-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Reduce the size of check_attrs.rs and move as much as possible into the attribute parsers. #153101
Copy link
Copy link
Open
Open
Cleanup
Copy link
Labels
A-ASTArea: ASTArea: ASTA-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.E-tediousCall for participation: An issue involves lots of work and is better handled as many small tasks.Call for participation: An issue involves lots of work and is better handled as many small tasks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-ASTArea: ASTArea: ASTA-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.E-tediousCall for participation: An issue involves lots of work and is better handled as many small tasks.Call for participation: An issue involves lots of work and is better handled as many small tasks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for Cleanup.
As part of the attribute parser rework initiative, i'd be nice to reduce the size of
check_attrs.rsand move as much of the code into the attribute parsers themselves. This is part of #131229.Mentor: @JonathanBrouwer
There is quite a lot of different checks in
check_attrs.rs, and the goal is to move as much as possible to the respective attribute parsers. A lot of things are not currently moveable because the right information is not available in the attribute parsers, and making this information available is difficultAll checks:
check_stability: easy (claimed by @josetorrs) refactor - movingcheck_stabilitycheck toparse_stability#154015check_align: easy (claimed by @JayanAXHF) refactor: movecheck_aligntoparse_alignment#153189check_custom_mir: easy (claimed by @JayanAXHF) refactor(attribute parser): move check_custom_mir to attribute parser #154126check_doc_attrs: 1, 3 (partially easy, for example moving the features check forrustc_logois possible)check_inline: 1, 3check_loop_match: 1check_const_continue: 1check_macro_only_attr: 2check_rustc_allow_const_fn_unstable: 1check_deprecated: 1check_target_feature: 2check_object_lifetime_default1check_rustc_pub_transparent: 2, 3check_naked: 1check_track_caller: 1,2check_non_exhaustive: 1check_ffi_pure: 2check_may_dangle: 1, 2check_sanitize: 3check_link: 1check_macro_export: 1check_rustc_legacy_const_generics: 1check_proc_macro: fundamentally impossible, requires type informationcheck_eii_impl: 1check_rustc_must_implement_one_of: 1check_do_not_recommend: 1check_diagnostic_on_unimplemented: 1check_diagnostic_on_const: 1check_diagnostic_on_move: 1Legend: