File tree 3 files changed +8
-8
lines changed
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> {
1451
1451
self . err_span_ (
1452
1452
start_with_quote,
1453
1453
self . pos ,
1454
- "lifetimes can't start with a number" ,
1454
+ "lifetimes cannot start with a number" ,
1455
1455
) ;
1456
1456
}
1457
1457
1458
-
1459
1458
return Ok ( token:: Lifetime ( ident) ) ;
1460
1459
}
1461
1460
@@ -1892,7 +1891,7 @@ fn ident_start(c: Option<char>) -> bool {
1892
1891
None => return false ,
1893
1892
} ;
1894
1893
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 ( ) )
1896
1895
}
1897
1896
1898
1897
fn ident_continue ( c : Option < char > ) -> bool {
@@ -1901,7 +1900,8 @@ fn ident_continue(c: Option<char>) -> bool {
1901
1900
None => return false ,
1902
1901
} ;
1903
1902
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 ( ) )
1905
1905
}
1906
1906
1907
1907
#[ inline]
Original file line number Diff line number Diff line change 1
1
struct 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
4
4
fn main ( ) {
5
5
// verify that the parse error doesn't stop type checking
6
6
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
2
2
--> $DIR/numeric-lifetime.rs:1:10
3
3
|
4
4
LL | struct S<'1> { s: &'1 usize }
5
5
| ^^
6
6
7
- error: lifetimes can't start with a number
7
+ error: lifetimes cannot start with a number
8
8
--> $DIR/numeric-lifetime.rs:1:20
9
9
|
10
10
LL | struct S<'1> { s: &'1 usize }
You can’t perform that action at this time.
0 commit comments