about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2017-04-19 15:15:12 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2017-04-23 11:11:56 +0300
commit0ff828baa06504c91e38dfda53ead61cc44ad171 (patch)
treeb394cd045984e3204614704a55b6cb97423dc1fe
parente22873d91206e11349da713017bd67d43d8d535d (diff)
downloadrust-0ff828baa06504c91e38dfda53ead61cc44ad171.tar.gz
rust-0ff828baa06504c91e38dfda53ead61cc44ad171.zip
rustc_const_eval: CallOn isn't needed, typeck/const-qualif handle those cases.
-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) {