Merged
Conversation
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
9955e2c to
538437e
Compare
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit f60a873 has been approved by |
llogiq
reviewed
Sep 25, 2019
|
|
||
| /// Generates an appropriate parsing failure message. For EOF, this is "unexpected end...". For | ||
| /// other tokens, this is "unexpected token...". | ||
| fn parse_failure_msg(tok: &Token) -> String { |
Contributor
There was a problem hiding this comment.
why not
fn parse_failure_msg(tok: &Token) -> String {
if let token::Eof = tok.kind {
return "unexpected end of macro invocation".to_string();
}
format!("no rules expected the token `{}`", pprust::token_to_string(tok))
}
Contributor
Author
There was a problem hiding this comment.
I just haven't looked into the function body at all :-) I think that the best way to format it would probably be
fn parse_failure_msg(tok: &Token) -> String {
match tok.kind {
token::Eof => "unexpected end of macro invocation".to_string(),
_ => format!("no rules expected the token `{}`", pprust::token_to_string(tok)),
}
}Not a fan of if let with an else case
Centril
added a commit
to Centril/rust
that referenced
this pull request
Sep 25, 2019
Refactor mbe a tiny bit
bors
added a commit
that referenced
this pull request
Sep 25, 2019
Rollup of 6 pull requests Successful merges: - #62975 (Almost fully deprecate hir::map::Map.hir_to_node_id) - #64386 (use `sign` variable in abs and wrapping_abs methods) - #64508 (or-patterns: Push `PatKind/PatternKind::Or` at top level to HIR & HAIR) - #64738 (Add const-eval support for SIMD types, insert, and extract) - #64759 (Refactor mbe a tiny bit) - #64764 (Master is now 1.40 ) Failed merges: r? @ghost
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.