-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-where_clause_attrs`#![feature(where_clause_attrs)]``#![feature(where_clause_attrs)]`S-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.Status: The implementation is "complete" but it needs time to bake.T-langRelevant to the language teamRelevant to the language team
Description
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
- Implement the RFC
- Adjust documentation (see instructions on rustc-dev-guide)
- Formatting for new syntax has been added to the Style Guide (nightly-style-procedure)
- Stabilization PR (see instructions on rustc-dev-guide)
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
mhnap, dzmitry-lahoda, recatek, jtojnar, StackOverflowExcept1on and 2 more
Metadata
Metadata
Assignees
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-where_clause_attrs`#![feature(where_clause_attrs)]``#![feature(where_clause_attrs)]`S-tracking-needs-to-bakeStatus: The implementation is "complete" but it needs time to bake.Status: The implementation is "complete" but it needs time to bake.T-langRelevant to the language teamRelevant to the language team