1
Fork 0

rustc_const_eval: CallOn isn't needed, typeck/const-qualif handle those cases.

This commit is contained in:
Eduard-Mihai Burtescu 2017-04-19 15:15:12 +03:00
parent e22873d912
commit 0ff828baa0
2 changed files with 1 additions and 3 deletions

View file

@ -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"),

View file

@ -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) {