From 41f11d95c70cc2f65ee9f068d46a7a6de8f911b3 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 24 Feb 2016 16:07:31 +0100 Subject: [PATCH] don't guess const fn argument types --- src/librustc/middle/const_eval.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/librustc/middle/const_eval.rs b/src/librustc/middle/const_eval.rs index bc8dfd6c7b0..993c59a5f2c 100644 --- a/src/librustc/middle/const_eval.rs +++ b/src/librustc/middle/const_eval.rs @@ -854,24 +854,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>, let mut call_args = NodeMap(); for (arg, arg_expr) in decl.inputs.iter().zip(args.iter()) { - let arg_hint = match ty_hint { - ExprTypeChecked => ExprTypeChecked, - UncheckedExprNoHint | UncheckedExprHint(_) => { - if let Some(hint) = tcx.ast_ty_to_ty_cache.borrow().get(&arg.ty.id) { - let mut new_ty_hint = UncheckedExprHint(hint); - for t in hint.walk() { - if let ty::TypeVariants::TyParam(_) = t.sty { - // found a generic argument, but we are in typeck - new_ty_hint = UncheckedExprNoHint; - break; - } - } - new_ty_hint - } else { - UncheckedExprNoHint - } - }, - }; + let arg_hint = ty_hint.erase_hint(); let arg_val = try!(eval_const_expr_partial( tcx, arg_expr,