allow constant evaluation of function calls

This commit is contained in:
Oliver Schneider 2015-10-14 12:30:10 +02:00
parent 9ed32bba77
commit b4e30bd2a3
14 changed files with 155 additions and 52 deletions

View file

@ -120,7 +120,7 @@ impl LateLintPass for TypeLimits {
if let ast::LitInt(shift, _) = lit.node { shift >= bits }
else { false }
} else {
match eval_const_expr_partial(cx.tcx, &r, ExprTypeChecked) {
match eval_const_expr_partial(cx.tcx, &r, ExprTypeChecked, None) {
Ok(ConstVal::Int(shift)) => { shift as u64 >= bits },
Ok(ConstVal::Uint(shift)) => { shift >= bits },
_ => { false }
@ -674,4 +674,3 @@ impl LateLintPass for ImproperCTypes {
}
}
}