-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
(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", |
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.
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
.
r=me with comment addressed |
This comment has been minimized.
This comment has been minimized.
@bors r=petrochenkov rollup |
📌 Commit 647d295 has been approved by |
Suggest underscore when using dashes in crate namet push fork Fix rust-lang#48437.
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
Fix #48437.