1
Fork 0

Rollup merge of #132388 - frank-king:feature/where-cfg, r=petrochenkov

Implement `#[cfg]` in `where` clauses

This PR implements #115590, which supports `#[cfg]` attributes in `where` clauses.

The biggest change is, that it adds `AttrsVec` and  `NodeId` to the `ast::WherePredicate` and `HirId` to the `hir::WherePredicate`.
This commit is contained in:
Matthias Krüger 2025-03-03 10:40:56 +01:00 committed by GitHub
commit 2344a34241
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 3296 additions and 88 deletions

View file

@ -1728,6 +1728,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
fn lower_where_predicate(&mut self, pred: &WherePredicate) -> hir::WherePredicate<'hir> {
let hir_id = self.lower_node_id(pred.id);
let span = self.lower_span(pred.span);
self.lower_attrs(hir_id, &pred.attrs, span);
let kind = self.arena.alloc(match &pred.kind {
WherePredicateKind::BoundPredicate(WhereBoundPredicate {
bound_generic_params,