Merge pull request #91 from alexcrichton/under
Parse `_` as an ident
diff --git a/src/stable.rs b/src/stable.rs
index a718db2..801a1df 100644
--- a/src/stable.rs
+++ b/src/stable.rs
@@ -787,8 +787,6 @@
let a = &input.rest[..end];
if a == "r#_" {
Err(LexError)
- } else if a == "_" {
- Ok((input.advance(end), Punct::new('_', Spacing::Alone).into()))
} else {
let ident = if raw {
::Ident::_new_raw(&a[2..], ::Span::call_site())
diff --git a/tests/test.rs b/tests/test.rs
index a3c53ec..673a35f 100644
--- a/tests/test.rs
+++ b/tests/test.rs
@@ -113,6 +113,7 @@
",
);
roundtrip("'a");
+ roundtrip("'_");
roundtrip("'static");
roundtrip("'\\u{10__FFFF}'");
roundtrip("\"\\u{10_F0FF__}foo\\u{1_0_0_0__}\"");