Open
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
Metadata
Metadata
Assignees
Labels
Blocker: Approved by a merged RFC but not yet implemented.Category: An issue tracking the progress of sth. like the implementation of an RFC`#![feature(where_clause_attrs)]`Status: The implementation is "complete" but it needs time to bake.Relevant to the language team, which will review and decide on the PR/issue.