]> git.lizzy.rs Git - rust.git/commitdiff
Changes based on PR feedback
authorRyan Scott <ryan@ryan-scott.me>
Fri, 7 Apr 2017 03:20:37 +0000 (12:20 +0900)
committerRyan Scott <ryan@ryan-scott.me>
Fri, 7 Apr 2017 03:20:37 +0000 (12:20 +0900)
src/librustc_mir/transform/qualify_consts.rs

index cdbc0bd8858a52683eacbab37e8092e3fd0f0b86..8eabe92fb98c005a7a4beec26e456b02e9791f47 100644 (file)
@@ -603,7 +603,8 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
             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,
@@ -721,12 +722,6 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
                 }
             }
 
-            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 {