Skip to content

Commit

Permalink
Changes based on PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-scott-dev committed Apr 7, 2017
1 parent e753dfa commit c9932b3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/librustc_mir/transform/qualify_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,8 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
Rvalue::Cast(CastKind::ReifyFnPointer, ..) |
Rvalue::Cast(CastKind::UnsafeFnPointer, ..) |
Rvalue::Cast(CastKind::ClosureFnPointer, ..) |
Rvalue::Cast(CastKind::Unsize, ..) => {}
Rvalue::Cast(CastKind::Unsize, ..) |
Rvalue::Discriminant(..) => {}

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

Rvalue::Discriminant(..) => {
// FIXME implement discriminant const qualify
self.add(Qualif::NOT_CONST);
// Discriminants in consts will error elsewhere as an unimplemented expression type
}

Rvalue::Box(_) => {
self.add(Qualif::NOT_CONST);
if self.mode != Mode::Fn {
Expand Down

0 comments on commit c9932b3

Please sign in to comment.