summary refs log tree commit diff
path: root/compiler/rustc_traits/src
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2023-04-06 21:26:38 -0400
committerJack Huey <31162821+jackh726@users.noreply.github.com>2023-04-06 23:01:38 -0400
commit167b70692ba2a97521237d36b487fbfccd3fb72b (patch)
treecc20ab34ab1b6d63cff827cac33ba58b93b78b24 /compiler/rustc_traits/src
parent4646b3df6ad09f5cda12742ee98309b659006039 (diff)
downloadrust-167b70692ba2a97521237d36b487fbfccd3fb72b.tar.gz
rust-167b70692ba2a97521237d36b487fbfccd3fb72b.zip
Remove expect_anon and expect_anon_placeholder in favor of var
Diffstat (limited to 'compiler/rustc_traits/src')
-rw-r--r--compiler/rustc_traits/src/chalk/lowering.rs16
1 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_traits/src/chalk/lowering.rs b/compiler/rustc_traits/src/chalk/lowering.rs
index f7caf50c56a..c59e496eb0a 100644
--- a/compiler/rustc_traits/src/chalk/lowering.rs
+++ b/compiler/rustc_traits/src/chalk/lowering.rs
@@ -1168,13 +1168,12 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReverseParamsSubstitutor<'tcx> {
 
     fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
         match *t.kind() {
-            ty::Placeholder(ty::PlaceholderType {
-                universe: ty::UniverseIndex::ROOT,
-                bound: ty::BoundTy { kind: name, .. },
-            }) => match self.params.get(&name.expect_anon()) {
-                Some(&ty::ParamTy { index, name }) => self.tcx.mk_ty_param(index, name),
-                None => t,
-            },
+            ty::Placeholder(ty::PlaceholderType { universe: ty::UniverseIndex::ROOT, bound }) => {
+                match self.params.get(&bound.var.as_u32()) {
+                    Some(&ty::ParamTy { index, name }) => self.tcx.mk_ty_param(index, name),
+                    None => t,
+                }
+            }
 
             _ => t.super_fold_with(self),
         }
@@ -1202,8 +1201,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for PlaceholdersCollector {
     fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
         match t.kind() {
             ty::Placeholder(p) if p.universe == self.universe_index => {
-                self.next_ty_placeholder =
-                    self.next_ty_placeholder.max(p.bound.kind.expect_anon() as usize + 1);
+                self.next_ty_placeholder = self.next_ty_placeholder.max(p.bound.var.as_usize() + 1);
             }
 
             _ => (),