Skip to content

Commit 2a787a2

Browse files
committed
Improve identifier defintion in the reference
Fixes rust-lang#28706
1 parent 3e6d724 commit 2a787a2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/doc/reference.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,13 @@ An identifier is any nonempty Unicode[^non_ascii_idents] string of the following
7676
[^non_ascii_idents]: Non-ASCII characters in identifiers are currently feature
7777
gated. This is expected to improve soon.
7878

79-
- The first character has property `XID_start`
80-
- The remaining characters have property `XID_continue`
79+
Either
80+
* The first character has property `XID_start`
81+
* The remaining characters have property `XID_continue`
82+
Or
83+
* The first character is `_`
84+
* The identifier is more than one character, `_` alone is not an identifier
85+
* The remaining characters have property `XID_continue`
8186

8287
that does _not_ occur in the set of [keywords][keywords].
8388

0 commit comments

Comments
 (0)