Skip to content

Commit 0ff828b

Browse files
committed
rustc_const_eval: CallOn isn't needed, typeck/const-qualif handle those cases.
1 parent e22873d commit 0ff828b

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/librustc/middle/const_val.rs

-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ pub enum ErrKind<'tcx> {
8585
MissingStructField,
8686
NegateOn(ConstVal<'tcx>),
8787
NotOn(ConstVal<'tcx>),
88-
CallOn(ConstVal<'tcx>),
8988

9089
NonConstPath,
9190
UnimplementedConstVal(&'static str),
@@ -145,7 +144,6 @@ impl<'a, 'gcx, 'tcx> ConstEvalErr<'tcx> {
145144
CannotCast => simple!("can't cast this type"),
146145
NegateOn(ref const_val) => simple!("negate on {}", const_val.description()),
147146
NotOn(ref const_val) => simple!("not on {}", const_val.description()),
148-
CallOn(ref const_val) => simple!("call on {}", const_val.description()),
149147

150148
MissingStructField => simple!("nonexistent struct field"),
151149
NonConstPath => simple!("non-constant path in constant expression"),

src/librustc_const_eval/eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ fn eval_const_expr_partial<'a, 'tcx>(cx: &ConstContext<'a, 'tcx>,
354354
hir::ExprCall(ref callee, ref args) => {
355355
let (def_id, substs) = match cx.eval(callee)? {
356356
Function(def_id, substs) => (def_id, substs),
357-
callee => signal!(e, CallOn(callee)),
357+
_ => signal!(e, TypeckError),
358358
};
359359

360360
let body = if let Some(node_id) = tcx.hir.as_local_node_id(def_id) {

0 commit comments

Comments
 (0)