From be09626148fbc02a7949dfa6143c5923d764beba Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Tue, 29 Oct 2013 22:50:15 +0100 Subject: [PATCH] Remove type overflow checks from check_const.rs, refs #4220 The checks are now handled by the linter --- src/librustc/middle/check_const.rs | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/librustc/middle/check_const.rs b/src/librustc/middle/check_const.rs index d12808c3a4da..5f84f505b5ce 100644 --- a/src/librustc/middle/check_const.rs +++ b/src/librustc/middle/check_const.rs @@ -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); }