rollup merge of #18580 : hirschenberger/issue-17713

This commit is contained in:
Alex Crichton 2014-11-03 15:30:01 -08:00
commit 11790a545c
2 changed files with 40 additions and 40 deletions

View file

@ -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 }
}
};