about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/middle/const_val.rs2
-rw-r--r--src/librustc_const_eval/eval.rs2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/librustc/middle/const_val.rs b/src/librustc/middle/const_val.rs
index 50f34723d50..b65dbdbbcc2 100644
--- a/src/librustc/middle/const_val.rs
+++ b/src/librustc/middle/const_val.rs
@@ -85,7 +85,6 @@ pub enum ErrKind<'tcx> {
     MissingStructField,
     NegateOn(ConstVal<'tcx>),
     NotOn(ConstVal<'tcx>),
-    CallOn(ConstVal<'tcx>),
 
     NonConstPath,
     UnimplementedConstVal(&'static str),
@@ -145,7 +144,6 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
             CannotCast => simple!("can't cast this type"),
             NegateOn(ref const_val) => simple!("negate on {}", const_val.description()),
             NotOn(ref const_val) => simple!("not on {}", const_val.description()),
-            CallOn(ref const_val) => simple!("call on {}", const_val.description()),
 
             MissingStructField  => simple!("nonexistent struct field"),
             NonConstPath        => simple!("non-constant path in constant expression"),
diff --git a/src/librustc_const_eval/eval.rs b/src/librustc_const_eval/eval.rs
index 37395ca7871..5c421df92c7 100644
--- a/src/librustc_const_eval/eval.rs
+++ b/src/librustc_const_eval/eval.rs
@@ -354,7 +354,7 @@ fn eval_const_expr_partial<'a, 'tcx>(cx: &ConstContext<'a, 'tcx>,
       hir::ExprCall(ref callee, ref args) => {
           let (def_id, substs) = match cx.eval(callee)? {
               Function(def_id, substs) => (def_id, substs),
-              callee => signal!(e, CallOn(callee)),
+              _ => signal!(e, TypeckError),
           };
 
           let body = if let Some(node_id) = tcx.hir.as_local_node_id(def_id) {