From 9e3d0b002a5c2e81d43351c9b8550a3f4ccfb8f9 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 21 Apr 2014 17:58:52 -0400 Subject: librustc: Remove the fallback to `int` from typechecking. This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change] --- src/libsyntax/parse/token.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 8e36339b0e5..9549d5b8389 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -212,10 +212,8 @@ pub fn to_str(t: &Token) -> String { res.push_char('\''); res } - LIT_INT(i, t) => ast_util::int_ty_to_str(t, Some(i), - ast_util::ForceSuffix), - LIT_UINT(u, t) => ast_util::uint_ty_to_str(t, Some(u), - ast_util::ForceSuffix), + LIT_INT(i, t) => ast_util::int_ty_to_str(t, Some(i)), + LIT_UINT(u, t) => ast_util::uint_ty_to_str(t, Some(u)), LIT_INT_UNSUFFIXED(i) => { (i as u64).to_str() } LIT_FLOAT(s, t) => { let mut body = String::from_str(get_ident(s).get()); -- cgit 1.4.1-3-g733a5 From 5ccf056a024b0769d7adc22f57eda8d75ae07a58 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 23 Jun 2014 17:50:40 -0700 Subject: Make parse_expr_res public --- src/libsyntax/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index e1319304e04..1cb09bb8d89 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2721,7 +2721,7 @@ impl<'a> Parser<'a> { } // parse an expression, subject to the given restriction - fn parse_expr_res(&mut self, r: restriction) -> Gc { + pub fn parse_expr_res(&mut self, r: restriction) -> Gc { let old = self.restriction; self.restriction = r; let e = self.parse_assign_expr(); -- cgit 1.4.1-3-g733a5