Skip to content

Commit 3a736a7

Browse files
committed
Exhaustively match on ty::Const::kind
1 parent 9b8e3eb commit 3a736a7

File tree

1 file changed

+12
-1
lines changed
  • compiler/rustc_smir/src/rustc_smir

1 file changed

+12
-1
lines changed

compiler/rustc_smir/src/rustc_smir/mod.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,18 @@ impl<'tcx> Stable<'tcx> for ty::Const<'tcx> {
10951095
}
10961096
ty::ParamCt(param) => stable_mir::ty::ConstantKind::ParamCt(opaque(&param)),
10971097
ty::ErrorCt(_) => unreachable!(),
1098-
_ => unimplemented!(),
1098+
ty::InferCt(_) => unreachable!(),
1099+
ty::BoundCt(_, _) => unimplemented!(),
1100+
ty::PlaceholderCt(_) => unimplemented!(),
1101+
ty::Unevaluated(uv) => {
1102+
stable_mir::ty::ConstantKind::Unevaluated(stable_mir::ty::UnevaluatedConst {
1103+
ty: tables.intern_ty(self.ty()),
1104+
def: tables.const_def(uv.def),
1105+
args: uv.args.stable(tables),
1106+
promoted: None,
1107+
})
1108+
}
1109+
ty::ExprCt(_) => unimplemented!(),
10991110
},
11001111
}
11011112
}

0 commit comments

Comments
 (0)