Suggest underscore when using dashes in crate name#52740
Merged
bors merged 2 commits intorust-lang:masterfrom Jul 28, 2018
Merged
Suggest underscore when using dashes in crate name#52740bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
src/libsyntax/parse/parser.rs
Outdated
| let orig_name = self.parse_ident()?; | ||
| // Accept `extern crate name-like-this` for better diagnostics | ||
| let ident = self.parse_crate_name_with_dashes( | ||
| "crate name using dashes are not valid in `extern crate` statements", |
Contributor
There was a problem hiding this comment.
typo: name -> names
Nit 1: could you keep orig_name instead of ident, this is a point of confusion because the meaning of optional identifier in ItemKind::ExternCrate is a bit counter-intuitive.
Nit 2: The messages can be moved into parse_crate_name_with_dashes.
Contributor
|
r=me with comment addressed |
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
@bors r=petrochenkov rollup |
Collaborator
|
📌 Commit 647d295 has been approved by |
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Jul 28, 2018
Suggest underscore when using dashes in crate namet push fork Fix rust-lang#48437.
bors
added a commit
that referenced
this pull request
Jul 28, 2018
Rollup of 11 pull requests Successful merges: - #52702 (Suggest fix when encountering different mutability from impl to trait) - #52703 (Improve a few vectors - calculate capacity or build from iterators) - #52740 (Suggest underscore when using dashes in crate namet push fork) - #52759 (Impl Send & Sync for JoinHandle) - #52760 (rustc_metadata: test loading atoi instead of cos) - #52763 (Omit the vendor component in Fuchsia triple) - #52765 (Remove unused "-Zenable_nonzeroing_move_hints" flag) - #52769 (Incorporate a stray test) - #52777 (Fix doc comment for 'ptr::copy_to' method) - #52779 (revert accidental atty downgrade) - #52781 (Use a slice where a vector is not necessary) 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.
Fix #48437.