Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest underscore when using dashes in crate name #52740

Merged
merged 2 commits into from
Jul 28, 2018

Conversation

estebank
Copy link
Contributor

Fix #48437.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2018
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@petrochenkov
Copy link
Contributor

r=me with comment addressed

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2018
@rust-highfive

This comment has been minimized.

@estebank
Copy link
Contributor Author

@bors r=petrochenkov rollup

@bors
Copy link
Contributor

bors commented Jul 27, 2018

📌 Commit 647d295 has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 27, 2018
@estebank estebank changed the title Suggest underscore when using dashes in crate namet push fork Suggest underscore when using dashes in crate name Jul 27, 2018
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
@bors bors merged commit 647d295 into rust-lang:master Jul 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants