Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more line:
/// In addition to general identifier validity requirements, raw identifiers cannot be created for keywords usable in path segments (`self`, `super` and others).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That leaves me somewhat confused; what does "general identifier validity requirements" entail here? Surely
Ident::new_raw
has fewer restrictions thanIdent::new_raw
but your wording suggests it has more -- in particular, when willIdent::new_raw
panic?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"general identifier validity requirements" -> "general identifier validity requirements inherited from
Ident::new
".We can point to the reference or something that describes what is an identifier.
It does have more restrictions.
"raw identifiers cannot be created for" -> "this function will panic on attempts to create"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah!
$ident
accepts keywords as well whereas it does not acceptr#self
-- that's pretty counter-intuitive. I think amending the documentation offn new
would be good as well to note the fact that keywords are allowed.