From 715cd9945004c6746b21fa509072ae2e4a9a9cbf Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 10 Jul 2023 17:44:00 -0300 Subject: [PATCH] Make Placeholder, GeneratorWitness*, Infer and Error unreachable on SMIR rustc_ty_to_ty --- compiler/rustc_smir/src/rustc_smir/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_smir/src/rustc_smir/mod.rs b/compiler/rustc_smir/src/rustc_smir/mod.rs index 85d5bb00c4e..1f020dc8a9d 100644 --- a/compiler/rustc_smir/src/rustc_smir/mod.rs +++ b/compiler/rustc_smir/src/rustc_smir/mod.rs @@ -101,12 +101,9 @@ impl<'tcx> Tables<'tcx> { ty::Ref(_, _, _) => todo!(), ty::FnDef(_, _) => todo!(), ty::FnPtr(_) => todo!(), - ty::Placeholder(..) => todo!(), ty::Dynamic(_, _, _) => todo!(), ty::Closure(_, _) => todo!(), ty::Generator(_, _, _) => todo!(), - ty::GeneratorWitness(_) => todo!(), - ty::GeneratorWitnessMIR(_, _) => todo!(), ty::Never => todo!(), ty::Tuple(fields) => TyKind::RigidTy(RigidTy::Tuple( fields.iter().map(|ty| self.intern_ty(ty)).collect(), @@ -114,8 +111,13 @@ impl<'tcx> Tables<'tcx> { ty::Alias(_, _) => todo!(), ty::Param(_) => todo!(), ty::Bound(_, _) => todo!(), - ty::Infer(_) => todo!(), - ty::Error(_) => todo!(), + ty::Placeholder(..) + | ty::GeneratorWitness(_) + | ty::GeneratorWitnessMIR(_, _) + | ty::Infer(_) + | ty::Error(_) => { + unreachable!(); + } } }