Skip to content

Commit c9932b3

Browse files
Changes based on PR feedback
1 parent e753dfa commit c9932b3

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/librustc_mir/transform/qualify_consts.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
603603
Rvalue::Cast(CastKind::ReifyFnPointer, ..) |
604604
Rvalue::Cast(CastKind::UnsafeFnPointer, ..) |
605605
Rvalue::Cast(CastKind::ClosureFnPointer, ..) |
606-
Rvalue::Cast(CastKind::Unsize, ..) => {}
606+
Rvalue::Cast(CastKind::Unsize, ..) |
607+
Rvalue::Discriminant(..) => {}
607608

608609
Rvalue::Len(_) => {
609610
// Static lvalues in consts would have errored already,
@@ -721,12 +722,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
721722
}
722723
}
723724

724-
Rvalue::Discriminant(..) => {
725-
// FIXME implement discriminant const qualify
726-
self.add(Qualif::NOT_CONST);
727-
// Discriminants in consts will error elsewhere as an unimplemented expression type
728-
}
729-
730725
Rvalue::Box(_) => {
731726
self.add(Qualif::NOT_CONST);
732727
if self.mode != Mode::Fn {

0 commit comments

Comments
 (0)