allow constant evaluation of function calls
This commit is contained in:
parent
9ed32bba77
commit
b4e30bd2a3
14 changed files with 155 additions and 52 deletions
|
|
@ -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 {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue