about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEllen <supbscripter@gmail.com>2021-09-07 00:06:44 +0100
committerEllen <supbscripter@gmail.com>2021-09-09 01:32:03 +0100
commit4cbcb0936a3ae16a99f977427a6a01646a1ed8dd (patch)
tree5e7ac4ad4b029d85c95228be52fac13eae1b5135
parentfc63e9a8fb619ad79d2d24db06078652a2a6c1ba (diff)
downloadrust-4cbcb0936a3ae16a99f977427a6a01646a1ed8dd.tar.gz
rust-4cbcb0936a3ae16a99f977427a6a01646a1ed8dd.zip
handle `ExprKind::NeverToAny`
-rw-r--r--compiler/rustc_trait_selection/src/traits/const_evaluatable.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
index 3e1719e08ac..21423d415e3 100644
--- a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
+++ b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
@@ -418,8 +418,6 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
                 let arg = self.recurse_build(source)?;
                 self.add_node(Node::Cast(arg, node.ty), node.span)
             },
-            // never can arise even without panic/fail to terminate
-            &ExprKind::NeverToAny { source } => todo!(),
 
             // FIXME(generic_const_exprs) we want to support these
             ExprKind::AddressOf { .. }
@@ -428,6 +426,7 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
             | ExprKind::Repeat { .. }
             | ExprKind::Array { .. }
             | ExprKind::Block { .. }
+            | ExprKind::NeverToAny { .. } // I dont think we can get this without adt construction
             | ExprKind::Tuple { .. }
             | ExprKind::Index { .. }
             | ExprKind::Field { .. }