Explorar el Código

Remove dead code in HandleInterfaceWitnessAccess (#3928)

This is handled through constant logic, and seems to have been missed
during constant refactoring, so replacing with FatalErrorIfEncountered.
Jon Ross-Perkins hace 2 años
padre
commit
ecdecf4699
Se han modificado 1 ficheros con 3 adiciones y 7 borrados
  1. 3 7
      toolchain/lower/handle.cpp

+ 3 - 7
toolchain/lower/handle.cpp

@@ -507,14 +507,10 @@ auto HandleInterfaceWitness(FunctionContext& /*context*/,
   FatalErrorIfEncountered(inst);
   FatalErrorIfEncountered(inst);
 }
 }
 
 
-auto HandleInterfaceWitnessAccess(FunctionContext& context,
-                                  SemIR::InstId inst_id,
+auto HandleInterfaceWitnessAccess(FunctionContext& /*context*/,
+                                  SemIR::InstId /*inst_id*/,
                                   SemIR::InterfaceWitnessAccess inst) -> void {
                                   SemIR::InterfaceWitnessAccess inst) -> void {
-  // TODO: Add general constant lowering.
-  auto const_id = context.sem_ir().constant_values().Get(inst_id);
-  CARBON_CHECK(const_id.is_constant())
-      << "Lowering non-constant witness access " << inst;
-  context.SetLocal(inst_id, context.GetValue(const_id.inst_id()));
+  FatalErrorIfEncountered(inst);
 }
 }
 
 
 auto HandleNameRef(FunctionContext& context, SemIR::InstId inst_id,
 auto HandleNameRef(FunctionContext& context, SemIR::InstId inst_id,