]> git.lizzy.rs Git - rust.git/commitdiff
Squash closure cast error into fn ptr cast error
authorOliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer <github35764891676564198441@oli-obk.de>
Wed, 17 Oct 2018 07:04:10 +0000 (09:04 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Oct 2018 07:04:10 +0000 (09:04 +0200)
src/librustc_mir/transform/qualify_min_const_fn.rs

index c9d48f5f6adb2cab03dc557d9cbd386c94784b11..52c557b83d5916979301d743b5f8aa2b4a6091bf 100644 (file)
@@ -164,14 +164,11 @@ fn check_rvalue(
             }
         }
         Rvalue::Cast(CastKind::UnsafeFnPointer, _, _) |
+        Rvalue::Cast(CastKind::ClosureFnPointer, _, _) |
         Rvalue::Cast(CastKind::ReifyFnPointer, _, _) => Err((
             span,
             "function pointer casts are not allowed in const fn".into(),
         )),
-        Rvalue::Cast(CastKind::ClosureFnPointer, _, _) => Err((
-            span,
-            "closures are not allowed in const fn".into(),
-        )),
         Rvalue::Cast(CastKind::Unsize, _, _) => Err((
             span,
             "unsizing casts are not allowed in const fn".into(),