Skip to content
Permalink
Browse files

review comments

  • Loading branch information...
estebank committed Mar 8, 2019
1 parent 0a505a7 commit f690821d58650358f536606722a8f5531c8a6b84
@@ -1451,11 +1451,10 @@ impl<'a> StringReader<'a> {
self.err_span_(
start_with_quote,
self.pos,
"lifetimes can't start with a number",
"lifetimes cannot start with a number",
);
}


return Ok(token::Lifetime(ident));
}

@@ -1892,7 +1891,7 @@ fn ident_start(c: Option<char>) -> bool {
None => return false,
};

(c.is_alphabetic() || c == '_' || (c > '\x7f' && c.is_xid_start()))
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || (c > '\x7f' && c.is_xid_start())
}

fn ident_continue(c: Option<char>) -> bool {
@@ -1901,7 +1900,8 @@ fn ident_continue(c: Option<char>) -> bool {
None => return false,
};

(c.is_alphabetic() || c.is_numeric() || c == '_' || (c > '\x7f' && c.is_xid_continue()))
(c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_' ||
(c > '\x7f' && c.is_xid_continue())
}

#[inline]
@@ -1,6 +1,6 @@
struct S<'1> { s: &'1 usize }
//~^ ERROR lifetimes can't start with a number
//~| ERROR lifetimes can't start with a number
//~^ ERROR lifetimes cannot start with a number
//~| ERROR lifetimes cannot start with a number
fn main() {
// verify that the parse error doesn't stop type checking
let x: usize = "";
@@ -1,10 +1,10 @@
error: lifetimes can't start with a number
error: lifetimes cannot start with a number
--> $DIR/numeric-lifetime.rs:1:10
|
LL | struct S<'1> { s: &'1 usize }
| ^^

error: lifetimes can't start with a number
error: lifetimes cannot start with a number
--> $DIR/numeric-lifetime.rs:1:20
|
LL | struct S<'1> { s: &'1 usize }

0 comments on commit f690821

Please sign in to comment.
You can’t perform that action at this time.