Skip to content

Tracking Issue for attributes on where-clause bounds #115590

Open
@pnkfelix

Description

@pnkfelix

This is a tracking issue for the RFC "Allow cfg-attributes in where clauses" (rust-lang/rfcs#3399).
The feature gate for the issue is #![feature(where_clause_attrs)].

The intent, as described in the Guide-level explanation, is to enable cfg-attributes on where-clauses, like so:

impl<T> SomeTrait<T> for Thing
where
    #[cfg(something_a)] T: SomeRequirementA,
    #[cfg(something_b)] T: SomeRequirementB,
{}

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

  • should cfg-attributes be allowed to decorate individual bounds on the right hand side of the colon?
  • rustfmt is supposed to be able to format the where clause somehow, do we expect it to (try to) put the attribute on the same line, or would it always prefer the attribute on separate lines?

Implementation history

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-where_clause_attrs`#![feature(where_clause_attrs)]`S-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions