File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1451,11 +1451,10 @@ impl<'a> StringReader<'a> {
14511451 self . err_span_ (
14521452 start_with_quote,
14531453 self . pos ,
1454- "lifetimes can't start with a number" ,
1454+ "lifetimes cannot start with a number" ,
14551455 ) ;
14561456 }
14571457
1458-
14591458 return Ok ( token:: Lifetime ( ident) ) ;
14601459 }
14611460
@@ -1892,7 +1891,7 @@ fn ident_start(c: Option<char>) -> bool {
18921891 None => return false ,
18931892 } ;
18941893
1895- ( c. is_alphabetic ( ) || c == '_' || ( c > '\x7f' && c. is_xid_start ( ) ) )
1894+ ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || c == '_' || ( c > '\x7f' && c. is_xid_start ( ) )
18961895}
18971896
18981897fn ident_continue ( c : Option < char > ) -> bool {
@@ -1901,7 +1900,8 @@ fn ident_continue(c: Option<char>) -> bool {
19011900 None => return false ,
19021901 } ;
19031902
1904- ( c. is_alphabetic ( ) || c. is_numeric ( ) || c == '_' || ( c > '\x7f' && c. is_xid_continue ( ) ) )
1903+ ( c >= 'a' && c <= 'z' ) || ( c >= 'A' && c <= 'Z' ) || ( c >= '0' && c <= '9' ) || c == '_' ||
1904+ ( c > '\x7f' && c. is_xid_continue ( ) )
19051905}
19061906
19071907#[ inline]
Original file line number Diff line number Diff line change 11struct S < ' 1 > { s : & ' 1 usize }
2- //~^ ERROR lifetimes can't start with a number
3- //~| ERROR lifetimes can't start with a number
2+ //~^ ERROR lifetimes cannot start with a number
3+ //~| ERROR lifetimes cannot start with a number
44fn main ( ) {
55 // verify that the parse error doesn't stop type checking
66 let x: usize = "";
Original file line number Diff line number Diff line change 1- error: lifetimes can't start with a number
1+ error: lifetimes cannot start with a number
22 --> $DIR/numeric-lifetime.rs:1:10
33 |
44LL | struct S<'1> { s: &'1 usize }
55 | ^^
66
7- error: lifetimes can't start with a number
7+ error: lifetimes cannot start with a number
88 --> $DIR/numeric-lifetime.rs:1:20
99 |
1010LL | struct S<'1> { s: &'1 usize }
You can’t perform that action at this time.
0 commit comments