-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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.
Description
As part of the attribute parser rework initiative, i'd be nice to reduce the size of check_attrs.rs and 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 difficult
All checks:
-
check_stability: easy (claimed by @josetorrs) refactor - movingcheck_stabilitycheck toparse_stability#154015 -
check_align: easy (claimed by @JayanAXHF) refactor: movecheck_aligntoparse_alignment#153189 -
check_custom_mir: easy (claimed by @JayanAXHF) refactor(attribute parser): move check_custom_mir to attribute parser #154126 -
check_doc_attrs: 1, 3 (partially easy, for example moving the features check forrustc_logois possible) -
check_inline: 1, 3 -
check_loop_match: 1 -
check_const_continue: 1 -
check_macro_only_attr: 2 -
check_rustc_allow_const_fn_unstable: 1 -
check_deprecated: 1 -
check_target_feature: 2 -
check_object_lifetime_default1 -
check_rustc_pub_transparent: 2, 3 -
check_naked: 1 -
check_track_caller: 1,2 -
check_non_exhaustive: 1 -
check_ffi_pure: 2 -
check_may_dangle: 1, 2 -
check_sanitize: 3 -
check_link: 1 -
check_macro_export: 1 -
check_rustc_legacy_const_generics: 1 -
check_proc_macro: fundamentally impossible, requires type information -
check_eii_impl: 1 -
check_rustc_must_implement_one_of: 1 -
check_do_not_recommend: 1 -
check_diagnostic_on_unimplemented: 1 -
check_diagnostic_on_const: 1
Legend:
- Requires detailed target information: Requires a way for the target checking to know more about the target than currently available to the attribute parsers. Ideally, we should pass information from either the AST or the HIR down, not sure which is easier.
- Requires other attrs: These checks check the presence or absence of other attributes. We need to find a nice way to represent this. (claimed by @rperier)
- The allowed targets depend on the arguments passed to the attribute, we need to find a way to allow target checking to depend on arguments
Reactions are currently unavailable
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.