diff options
Diffstat (limited to 'src/libsyntax/parse/lexer.rs')
| -rw-r--r-- | src/libsyntax/parse/lexer.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/parse/lexer.rs b/src/libsyntax/parse/lexer.rs index c78d2aaf3a7..5a7a816dbb3 100644 --- a/src/libsyntax/parse/lexer.rs +++ b/src/libsyntax/parse/lexer.rs @@ -589,13 +589,13 @@ fn scan_number(c: char, rdr: &mut StringReader) -> token::Token { bump(rdr); bump(rdr); check_float_base(rdr, start_bpos, rdr.last_pos, base); - return token::LIT_FLOAT(str_to_ident(num_str.into_owned()), + return token::LIT_FLOAT(str_to_ident(num_str.as_slice()), ast::TyF32); } else if c == '6' && n == '4' { bump(rdr); bump(rdr); check_float_base(rdr, start_bpos, rdr.last_pos, base); - return token::LIT_FLOAT(str_to_ident(num_str.into_owned()), + return token::LIT_FLOAT(str_to_ident(num_str.as_slice()), ast::TyF64); /* FIXME (#2252): if this is out of range for either a 32-bit or 64-bit float, it won't be noticed till the @@ -612,8 +612,7 @@ fn scan_number(c: char, rdr: &mut StringReader) -> token::Token { } if is_float { check_float_base(rdr, start_bpos, rdr.last_pos, base); - return token::LIT_FLOAT_UNSUFFIXED(str_to_ident( - num_str.into_owned())); + return token::LIT_FLOAT_UNSUFFIXED(str_to_ident(num_str.as_slice())); } else { if num_str.len() == 0u { fatal_span(rdr, start_bpos, rdr.last_pos, |
