diff options
| author | Frank King <frankking1729@gmail.com> | 2025-02-05 18:58:29 +0800 |
|---|---|---|
| committer | Frank King <frankking1729@gmail.com> | 2025-03-01 22:02:46 +0800 |
| commit | 42f51d4fd42c95e0c51c3f8742d63db0548cd5a0 (patch) | |
| tree | 754318d4e5ccbdb944dc38741039989a48d124e4 /compiler/rustc_resolve/src/def_collector.rs | |
| parent | 30508faeb3248d399079513b6e0107af30a43948 (diff) | |
| download | rust-42f51d4fd42c95e0c51c3f8742d63db0548cd5a0.tar.gz rust-42f51d4fd42c95e0c51c3f8742d63db0548cd5a0.zip | |
Implment `#[cfg]` and `#[cfg_attr]` in `where` clauses
Diffstat (limited to 'compiler/rustc_resolve/src/def_collector.rs')
| -rw-r--r-- | compiler/rustc_resolve/src/def_collector.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index 75972a71c8e..42f8424c76a 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -285,6 +285,14 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> { }); } + fn visit_where_predicate(&mut self, pred: &'a WherePredicate) { + if pred.is_placeholder { + self.visit_macro_invoc(pred.id) + } else { + visit::walk_where_predicate(self, pred) + } + } + fn visit_variant_data(&mut self, data: &'a VariantData) { // The assumption here is that non-`cfg` macro expansion cannot change field indices. // It currently holds because only inert attributes are accepted on fields, |
