about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-03-28 21:18:30 +0100
committerGitHub <noreply@github.com>2025-03-28 21:18:30 +0100
commit52aed95060e1fa12373ee7f3f391178afa57fe14 (patch)
tree1804bd511bc3e431f66748c248c2ecead7b17569 /compiler
parent660e8633f337438ed014adac12cbcab78b7d9b06 (diff)
parent7a295d1be07d191527dfcdf4613ced7ab6fa9676 (diff)
downloadrust-52aed95060e1fa12373ee7f3f391178afa57fe14.tar.gz
rust-52aed95060e1fa12373ee7f3f391178afa57fe14.zip
Rollup merge of #139063 - fmease:fix-tait-atpit-gating, r=oli-obk
Fix TAIT & ATPIT feature gating in the presence of anon consts

Fixes #139055 (https://github.com/rust-lang/rust/issues/119924#issuecomment-1928659690).

r? oli-obk or anybody else
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ast_passes/src/feature_gate.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs
index 31ff102c127..a3fcc110a16 100644
--- a/compiler/rustc_ast_passes/src/feature_gate.rs
+++ b/compiler/rustc_ast_passes/src/feature_gate.rs
@@ -99,6 +99,13 @@ impl<'a> PostExpansionVisitor<'a> {
                 }
                 visit::walk_ty(self, ty);
             }
+
+            fn visit_anon_const(&mut self, _: &ast::AnonConst) -> Self::Result {
+                // We don't walk the anon const because it crosses a conceptual boundary: We're no
+                // longer "inside" the original type.
+                // Brittle: We assume that the callers of `check_impl_trait` will later recurse into
+                // the items found in the AnonConst to look for nested TyAliases.
+            }
         }
         ImplTraitVisitor { vis: self, in_associated_ty }.visit_ty(ty);
     }