Auto merge of #22466 - Kimundi:str_pattern_ai_safe, r=aturon

This is not a complete implementation of the RFC:

- only existing methods got updated, no new ones added
- doc comments are not extensive enough yet
- optimizations got lost and need to be reimplemented

See https://github.com/rust-lang/rfcs/pull/528

Technically a

[breaking-change]
This commit is contained in:
bors 2015-02-22 22:45:46 +00:00
commit 67eb38ee4c
20 changed files with 1076 additions and 350 deletions

View file

@ -2496,7 +2496,7 @@ impl<'a> Parser<'a> {
let fstr = n.as_str();
self.span_err(last_span,
&format!("unexpected token: `{}`", n.as_str()));
if fstr.chars().all(|x| "0123456789.".contains_char(x)) {
if fstr.chars().all(|x| "0123456789.".contains(x)) {
let float = match fstr.parse::<f64>().ok() {
Some(f) => f,
None => continue,