Skip to content

Commit be09626

Browse files
committed
Remove type overflow checks from check_const.rs, refs #4220
The checks are now handled by the linter
1 parent 2ee72ba commit be09626

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

src/librustc/middle/check_const.rs

-15
Original file line numberDiff line numberDiff line change
@@ -199,21 +199,6 @@ pub fn check_expr(v: &mut CheckCrateVisitor,
199199
}
200200
}
201201
}
202-
match e.node {
203-
ExprLit(@codemap::Spanned {node: lit_int(v, t), _}) => {
204-
if (v as u64) > ast_util::int_ty_max(
205-
if t == ty_i { sess.targ_cfg.int_type } else { t }) {
206-
sess.span_err(e.span, "literal out of range for its type");
207-
}
208-
}
209-
ExprLit(@codemap::Spanned {node: lit_uint(v, t), _}) => {
210-
if v > ast_util::uint_ty_max(
211-
if t == ty_u { sess.targ_cfg.uint_type } else { t }) {
212-
sess.span_err(e.span, "literal out of range for its type");
213-
}
214-
}
215-
_ => ()
216-
}
217202
visit::walk_expr(v, e, is_const);
218203
}
219204

0 commit comments

Comments
 (0)