We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23773b7 commit 6369d43Copy full SHA for 6369d43
src/librustc/mir/tcx.rs
@@ -182,9 +182,8 @@ impl<'tcx> Rvalue<'tcx> {
182
if let ty::TyAdt(adt_def, _) = ty.sty {
183
adt_def.repr.discr_type().to_ty(tcx)
184
} else {
185
- // Undefined behaviour, bug for now; may want to return something for
186
- // the `discriminant` intrinsic later.
187
- bug!("Rvalue::Discriminant on Place of type {:?}", ty);
+ // This can only be `0`, for now, so `u8` will suffice.
+ tcx.types.u8
188
}
189
190
Rvalue::NullaryOp(NullOp::Box, t) => tcx.mk_box(t),
0 commit comments