mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Remove type overflow checks from check_const.rs, refs #4220
The checks are now handled by the linter
This commit is contained in:
parent
2ee72ba5c6
commit
be09626148
@ -199,21 +199,6 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
|
||||
}
|
||||
}
|
||||
}
|
||||
match e.node {
|
||||
ExprLit(@codemap::Spanned {node: lit_int(v, t), _}) => {
|
||||
if (v as u64) > ast_util::int_ty_max(
|
||||
if t == ty_i { sess.targ_cfg.int_type } else { t }) {
|
||||
sess.span_err(e.span, "literal out of range for its type");
|
||||
}
|
||||
}
|
||||
ExprLit(@codemap::Spanned {node: lit_uint(v, t), _}) => {
|
||||
if v > ast_util::uint_ty_max(
|
||||
if t == ty_u { sess.targ_cfg.uint_type } else { t }) {
|
||||
sess.span_err(e.span, "literal out of range for its type");
|
||||
}
|
||||
}
|
||||
_ => ()
|
||||
}
|
||||
visit::walk_expr(v, e, is_const);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user