Skip to content

Commit 51577c2

Browse files
authored
Merge pull request #91 from alexcrichton/under
Parse `_` as an ident
2 parents ca3dcad + f5479a9 commit 51577c2

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/stable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,6 @@ fn symbol(input: Cursor) -> PResult<TokenTree> {
787787
let a = &input.rest[..end];
788788
if a == "r#_" {
789789
Err(LexError)
790-
} else if a == "_" {
791-
Ok((input.advance(end), Punct::new('_', Spacing::Alone).into()))
792790
} else {
793791
let ident = if raw {
794792
::Ident::_new_raw(&a[2..], ::Span::call_site())

tests/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ fn roundtrip() {
113113
",
114114
);
115115
roundtrip("'a");
116+
roundtrip("'_");
116117
roundtrip("'static");
117118
roundtrip("'\\u{10__FFFF}'");
118119
roundtrip("\"\\u{10_F0FF__}foo\\u{1_0_0_0__}\"");

0 commit comments

Comments
 (0)