Commit Graph

138948 Commits

Author SHA1 Message Date
flip1995 a6dd9b9606
Fix Clippy build and test 2021-02-25 11:25:45 +01:00
flip1995 81af3468fe
Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyup 2021-02-25 11:25:22 +01:00
bors 928e72dd10 Auto merge of #6789 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: None
2021-02-25 09:49:12 +00:00
flip1995 8f8c7c293c
Bump nightly version -> 2021-02-25 2021-02-25 10:40:24 +01:00
flip1995 c6408a47bd
Merge remote-tracking branch 'upstream/master' into rustup 2021-02-25 10:40:00 +01:00
bors ef41f2baf7 Auto merge of #6788 - matthiaskrgr:upper_case_acronyms, r=flip1995
move upper_case_acronyms back to style, but make the default behaviour less aggressive by default (can be unleashed via config option)

Previous discussion in the bi-weekly clippy meeting for reference: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Meeting.202021-02-23/near/227458019

Move the `upper_case_acronyms` lint back to the style group.
Only warn on fully-capitalized names by default.
Add add a clippy-config option `upper-case-acronyms-aggressive: true/false` to enabled more aggressive linting on
all substrings that could be capitalized acronyms.

---
changelog: reenable upper_case_acronyms by default but make the more aggressive linting opt-in via config option
2021-02-25 09:01:41 +00:00
Matthias Krüger 2a6b06108d run cargo dev update_lints
fix sentence / address review comments
2021-02-25 09:59:39 +01:00
bors 63bacf14cd Auto merge of #82162 - cuviper:flat-fold, r=Mark-Simulacrum
Expand FlattenCompat folds

The former `chain`+`chain`+`fold` implementation looked nice from a
functional-programming perspective, but it introduced unnecessary layers
of abstraction on every `flat_map`/`flatten` fold. It's straightforward
to just fold each part in turn, and this makes it look like a simplified
version of the existing `try_fold` implementation.

For the `iter::bench_flat_map*` benchmarks, I get a large improvement in
`bench_flat_map_chain_sum`, from 1,598,473 ns/iter to 499,889 ns/iter,
and the rest are unchanged.
2021-02-25 00:36:05 +00:00
bors 76a689d8c2 Auto merge of #6783 - avitex:add-opendns-ident, r=giraffate
Add OpenDNS to `doc-valid-idents`

changelog: This commit adds `"OpenDNS"` to doc-valid-idents to avoid `doc_markdown` false positives.
2021-02-25 00:22:39 +00:00
Matthias Krüger 913c71018c upper_case_acronyms: add io-toml tests and bless previous tests 2021-02-24 23:50:55 +01:00
Matthias Krüger 59750dceb8 upper_case_acronyms: add optional aggressive mode and relax default
Moves the lint back from pedantic to style group.
The lint default now only warns on names that are completely capitalized, like "WORD"
and only if the name is longer than 2 chars (so that names where each of the letter represents a word are still distinguishable).
For example: FP (false positive) would still be "valid" and not warned about (but EOF would warn).

A "upper_case_acronyms_aggressive: true/false" config option was added that restores the original lint behaviour to warn
on any kind of camel case name that had more than one capital letter following another capital letter.
2021-02-24 23:50:53 +01:00
avitex b0d18e93d6
add test coverage for all `doc-valid-idents` 2021-02-25 09:30:33 +11:00
avitex 72e3335684
Add OpenDNS to `doc-valid-idents` 2021-02-25 09:30:33 +11:00
bors 1fdadbf13a Auto merge of #82159 - BoxyUwU:uwu, r=varkor
Use correct param_env in conservative_is_privately_uninhabited

cc `@lcnr`
r? `@varkor` since this is your FIXME that was removed ^^
2021-02-24 21:54:52 +00:00
bors 454515040a Auto merge of #6786 - smoelius:move-conf-rs-back-into-clippy-lints, r=flip1995
Move conf.rs back into clippy_lints

This is an alternative solution to #6785 to fix the CI break caused by #6756.

changelog: none
2021-02-24 14:51:14 +00:00
bors a8486b64b0 Auto merge of #80914 - GuillaumeGomez:remove-is_spotlight, r=jyn514
Remove is_spotlight field from `Trait`

Small PR, only the last commit is relevant here. The rest is coming from #80883 because I need the `TyCtxt` stored inside `Cache`.

The point is to make ItemKind looks as close as possible to the compiler type so that it makes the switch simpler (which is why I make all these "small" PRs).

r? `@jyn514`
2021-02-24 14:46:18 +00:00
Samuel E. Moelius III 8047458f40 Move conf.rs back into clippy_lints 2021-02-24 06:21:46 -05:00
bors 489c4f00f9 Auto merge of #6756 - smoelius:clippy_utils, r=flip1995,obi-obk
Factor out `clippy_utils` crate

As discussed in https://github.com/rust-lang/rust-clippy/pull/6746, this PR factors out `clippy_lints::utils` as its own crate, `clippy_utils` .

This change will allow `clippy_utils` to be used in lints outside of Clippy.

There is no plan to publish this crate on `crates.io` (see https://github.com/rust-lang/rust-clippy/pull/6746#issuecomment-780747522). Dependent crates should obtain it from GitHub.

changelog: Factor out `clippy_utils` so it can be used by external tools (not published)
2021-02-24 09:43:23 +00:00
bors 045d3f34f8 Auto merge of #6782 - ojeda:readme-as-wrapper, r=flip1995
README: Add subsection on running Clippy as a rustc wrapper

This is useful for projects that do not use cargo.

changelog: README: Add subsection on running Clippy as a rustc wrapper
2021-02-24 09:31:26 +00:00
bors 6b56603e35 Auto merge of #80475 - simonvandel:fix-77355, r=oli-obk
New mir-opt pass to simplify gotos with const values (reopening #77486)

Reopening PR #77486

Fixes #77355

This pass optimizes the following sequence
```rust
bb2: {
    _2 = const true;
    goto -> bb3;
}

bb3: {
    switchInt(_2) -> [false: bb4, otherwise: bb5];
}
```
into
```rust
bb2: {
    _2 = const true;
    goto -> bb5;
}
```
2021-02-24 07:23:54 +00:00
bors 301ad8a4fa Auto merge of #80891 - cjgillot:noq, r=Mark-Simulacrum
Make the `Query` enum a simple struct.

A lot of code in `rustc_query_system` is generic over it, only to encode an exceptional error case: query cycles.
The delayed computations are now done at cycle detection.
2021-02-24 03:29:00 +00:00
Miguel Ojeda 6b8b43c0d1 README: Add subsection on running Clippy as a rustc wrapper
This is useful for projects that do not use cargo.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-02-24 01:54:42 +01:00
Samuel E. Moelius III ab7381f085 Move `declare_clippy_lint` back into clippy_lints 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III c7869b82a2 Update references in doc directory 2021-02-23 18:50:30 -05:00
Samuel E. Moelius 33ee598a9f Update clippy_utils/Cargo.toml
Co-authored-by: Philipp Krones <hello@philkrones.com>
2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 8500ad5d19 Typo 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 50e3ef9eb5 Remove file accidentally re-added during rebase 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 2c26c0f621 Update custom_ice_message.stderr 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III ce76fb3d09 Fix update_lints 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 979206f6b4 Fix doc test 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 964f2a0ef2 Bump clippy_utils version 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 1e7b1ccb2a Fix versioncheck test 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 5f04b50191 Fix one import 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III ff157ae1f4 Improve tests 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III b7f03c6697 Remove unused features 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 29b6570612 Remove unused dependencies 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 523de296cc Get tests to pass 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III c5b9d22b02 Update clippy_utils/src/lib.rs 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 8d2de8f256 Update clippy_lints/src/lib.rs 2021-02-23 18:50:30 -05:00
Samuel E. Moelius III 09bded4437 Factor out `clippy_utils` crate 2021-02-23 18:50:30 -05:00
Ellen 42cbfd6346 yeet 2021-02-23 23:35:59 +00:00
bors a2c25fa9f0 Auto merge of #6573 - Jarcho:option_match_map, r=llogiq
New lint: option_manual_map

fixes: #6
changelog: Added lint: `match_map`
2021-02-23 21:56:25 +00:00
Guillaume Gomez 33aaead6a1 Improve code readability 2021-02-23 22:13:48 +01:00
Guillaume Gomez 3c59e64abf * Fix some typo
* Improve documentation
* Add a test to ensure that spotlighted traits from dependencies are taken into account as expected
2021-02-23 21:58:17 +01:00
Guillaume Gomez b5c8eea55d Put clean::Trait extra information into a new struct to make it more coherent 2021-02-23 21:58:16 +01:00
Guillaume Gomez fa51c0f472 Use a qualified path to make it more clear where `list_contains_name` function comes from 2021-02-23 21:57:42 +01:00
Guillaume Gomez 58a34a4dde Remove is_spotlight field from `Trait` 2021-02-23 21:57:40 +01:00
bors fe1bf8e05c Auto merge of #82443 - Dylan-DPC:rollup-yni7uio, r=Dylan-DPC
Rollup of 10 pull requests

Successful merges:

 - #81629 (Point out implicit deref coercions in borrow)
 - #82113 (Improve non_fmt_panic lint.)
 - #82258 (Implement -Z hir-stats for nested foreign items)
 - #82296 (Support `pub` on `macro_rules`)
 - #82297 (Consider auto derefs before warning about write only fields)
 - #82305 (Remove many RefCells from DocContext)
 - #82308 (Lower condition of `if` expression before it's "then" block)
 - #82311 (Jsondocck improvements)
 - #82362 (Fix mir-cfg dumps)
 - #82391 (disable atomic_max/min tests in Miri)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-02-23 17:24:33 +00:00
Dylan DPC 51511c75b5
Rollup merge of #82391 - RalfJung:miri-atomic-minmax, r=dtolnay
disable atomic_max/min tests in Miri

Disable some tests that currently [fail in Miri](https://travis-ci.com/github/RalfJung/miri-test-libstd/builds/217788631).
2021-02-23 16:10:30 +01:00
Dylan DPC aa1405fff7
Rollup merge of #82362 - osa1:issue81918, r=oli-obk
Fix mir-cfg dumps

Fixes #81918
Fixes #82326 (duplicate)
Fixes #82325

---

r? ``@oli-obk``
2021-02-23 16:10:29 +01:00