Fix naming conventions for new lints#50879
Merged
bors merged 1 commit intorust-lang:masterfrom May 25, 2018
Merged
Conversation
Contributor
|
(rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
This also needs to be backported to beta. |
Collaborator
|
☔ The latest upstream changes (presumably #50763) made this pull request unmergeable. Please resolve the merge conflicts. |
Contributor
|
Sigh, good catch. Also, it's sort of odd that we always have lints available without feature gates. @bors r+ |
Collaborator
|
📌 Commit 253948c has been approved by |
Contributor
Author
|
Hm, this actually needs a rebase. |
Contributor
Author
|
@bors r=nikomatsakis |
Collaborator
|
📌 Commit e60eaf5 has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
May 25, 2018
Fix naming conventions for new lints We actually have an RFC from Oct 2014 specifying naming conventions for lints that is still relevant - https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#lints. Unfortunately, human memory doesn't work for such prolonged periods of time, so a number of recently added edition-related lints don't follow the conventions. This PR fixes names for those lints. Unstable lints, simply renamed: - `unused_lifetime` -> `unused_lifetimes` - `absolute_path_not_starting_with_crate` -> `absolute_paths_not_starting_with_crate` - `unnecessary_extern_crate` -> `unnecessary_extern_crates` New lints stabilized in the last couple of releases, registered as renamed (old names still work with a warning): - `single_use_lifetime` -> `single_use_lifetimes` - `elided_lifetime_in_path` -> `elided_lifetimes_in_paths` - `bare_trait_object` -> `bare_trait_objects` - `unstable_name_collision` -> `unstable_name_collisions` - `unused_doc_comment` -> `unused_doc_comments` NOT changed, too old to rename: - `const_err` -> `const_errors` - `unused_allocation` -> `unused_allocations` NOT changed, deprecation lints, no need to rename, they are going to be removed anyway: - `invalid_type_param_default` -> `invalid_type_param_defaults` - `missing_fragment_specifier` -> `missing_fragment_specifiers` - `tyvar_behind_raw_pointer` -> `tyvars_behind_raw_pointer` - `illegal_floating_point_literal_pattern` -> `illegal_floating_point_literal_patterns`
Collaborator
|
☀️ Test successful - status-appveyor, status-travis |
This was referenced May 25, 2018
4 tasks
bors
added a commit
that referenced
this pull request
Jun 1, 2018
[beta] Process backports Merged and approved: * #50812: Fix issue #50811 (`NaN > NaN` was true). * #50827: Update LLVM to `56c931901cfb85cd6f7ed44c7d7520a8de1edf97` * #50879: Fix naming conventions for new lints * #51011: rustdoc: hide macro export statements from docs * #51051: prohibit turbofish in `impl Trait` methods * #51052: restore emplacement syntax (obsolete) * #51146: typeck: Do not pass the field check on field error * #51235: remove notion of Implicit derefs from mem-cat r? @ghost
bors
added a commit
that referenced
this pull request
Jun 3, 2018
[beta] Process backports Merged and approved: * #50812: Fix issue #50811 (`NaN > NaN` was true). * #50879: Fix naming conventions for new lints * #51011: rustdoc: hide macro export statements from docs * #51051: prohibit turbofish in impl Trait methods * #51052: restore emplacement syntax (obsolete) * #51146: typeck: Do not pass the field check on field error * #51235: remove notion of Implicit derefs from mem-cat r? @ghost
zackmdavis
added a commit
to zackmdavis/rust
that referenced
this pull request
Jul 15, 2018
It's only with reluctance and sadness that we rename a lint that has already been renamed once (rust-lang#50879), but it seems worth it to pick the best name now because since the lint is relatively new and has heretofore been allow-by-default, the ecosystem breakage should be minimal. (And—also sadly—the fact that the original implementation was so buggy for so long testifies that not very many people are tuning up the allow-by-default lints. Also, as always, lint capping prevents lint changes from spreading contagiously to dependencies.) The rationales here are that— • "hidden" is less potentially ambiguous than "elided", because this lint is specifically about angle-bracketed lifetime parameters, whereas the term "elided" has a strong precedent for also encompassing omitted lifetime names in reference ('&') types, which is not the concern of this lint, and • "types" is a more specific description of where the lint fires than "paths" (indeed, previous implementations of the lint used to fire on non-type paths in ways that proved to be erroneous false-positives, as evidenced by applications of the suggestion to use an anonymous lifetime (`'_`) resulting in code that didn't even parse) This comes from discussion on rust-lang#52069.
bors
added a commit
that referenced
this pull request
Jul 22, 2018
…_re-pub-lic, r=nikomatsakis add structured suggestions and fix false-positive for elided-lifetimes-in-paths lint This adds structured suggestions to the elided-lifetimes-in-paths lint (introduced in Nov. 2017's #46254), prevents it from emitting a false-positive on anonymous (underscore) lifetimes (!), and adds it to the idioms-2018 group (#52041). ~~As an aside, "elided-lifetimes-in-paths" seems like an unfortunate name, because it's not clear exactly what "elided" means. The motivation for this lint (see original issue #45992, and [RFC 2115](https://github.com/rust-lang/rfcs/blob/e978a8d3017a01d632f916140c98802505cd1324/text/2115-argument-lifetimes.md#motivation)) seems to be specifically about not supplying angle-bracketed lifetime arguments to non-`&` types, but (1) the phrase "lifetime elision" has historically also referred to the ability to not supply a lifetime name to `&` references, and (2) an `is_elided` method in the HIR returns true for anoymous/underscore lifetimes, which is _not_ what we're trying to lint here. (That naming confusion is almost certainly what led to the false positive addressed here.) Given that the lint is relatively new and is allow-by-default, is it too late to rename it ... um, _again_ (#50879)?~~ ~~This does _not_ address a couple of other false positives discovered in #52041 (comment)  r? @nikomatsakis cc @nrc @petrochenkov
hcpl
added a commit
to hcpl/serde_mtproto
that referenced
this pull request
Aug 6, 2018
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.
We actually have an RFC from Oct 2014 specifying naming conventions for lints that is still relevant - https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#lints.
Unfortunately, human memory doesn't work for such prolonged periods of time, so a number of recently added edition-related lints don't follow the conventions.
This PR fixes names for those lints.
Unstable lints, simply renamed:
unused_lifetime->unused_lifetimesabsolute_path_not_starting_with_crate->absolute_paths_not_starting_with_crateunnecessary_extern_crate->unnecessary_extern_cratesNew lints stabilized in the last couple of releases, registered as renamed (old names still work with a warning):
single_use_lifetime->single_use_lifetimeselided_lifetime_in_path->elided_lifetimes_in_pathsbare_trait_object->bare_trait_objectsunstable_name_collision->unstable_name_collisionsunused_doc_comment->unused_doc_commentsNOT changed, too old to rename:
const_err->const_errorsunused_allocation->unused_allocationsNOT changed, deprecation lints, no need to rename, they are going to be removed anyway:
invalid_type_param_default->invalid_type_param_defaultsmissing_fragment_specifier->missing_fragment_specifierstyvar_behind_raw_pointer->tyvars_behind_raw_pointerillegal_floating_point_literal_pattern->illegal_floating_point_literal_patterns