rollup merge of #18580 : hirschenberger/issue-17713
This commit is contained in:
commit
11790a545c
2 changed files with 40 additions and 40 deletions
|
|
@ -187,12 +187,12 @@ impl LintPass for TypeLimits {
|
|||
|
||||
if let Some(bits) = opt_ty_bits {
|
||||
let exceeding = if let ast::ExprLit(ref lit) = r.node {
|
||||
if let ast::LitInt(shift, _) = lit.node { shift > bits }
|
||||
if let ast::LitInt(shift, _) = lit.node { shift >= bits }
|
||||
else { false }
|
||||
} else {
|
||||
match eval_const_expr_partial(cx.tcx, &**r) {
|
||||
Ok(const_int(shift)) => { shift as u64 > bits },
|
||||
Ok(const_uint(shift)) => { shift > bits },
|
||||
Ok(const_int(shift)) => { shift as u64 >= bits },
|
||||
Ok(const_uint(shift)) => { shift >= bits },
|
||||
_ => { false }
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue