about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_mir/transform/check_consts/ops.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_mir/transform/check_consts/ops.rs b/src/librustc_mir/transform/check_consts/ops.rs
index 950f48f03cd..acad56be604 100644
--- a/src/librustc_mir/transform/check_consts/ops.rs
+++ b/src/librustc_mir/transform/check_consts/ops.rs
@@ -52,7 +52,11 @@ pub trait NonConstOp: std::fmt::Debug {
 /// A `Downcast` projection.
 #[derive(Debug)]
 pub struct Downcast;
-impl NonConstOp for Downcast {}
+impl NonConstOp for Downcast {
+    fn feature_gate(tcx: TyCtxt<'_>) -> Option<bool> {
+        Some(tcx.features().const_if_match)
+    }
+}
 
 /// A function call where the callee is a pointer.
 #[derive(Debug)]