]>
git.lizzy.rs Git - rust.git/log
flip1995 [Tue, 20 Nov 2018 09:33:40 +0000 (10:33 +0100)]
Introduce snippet_with_applicability and hir_with_applicability functions
Philipp Krones [Mon, 26 Nov 2018 13:31:48 +0000 (14:31 +0100)]
Merge pull request #3412 from matthiaskrgr/readme_2
readme: tell how to install clippy on travis from git if it is not shipped with a nightly.
Matthias Krüger [Sun, 4 Nov 2018 23:12:42 +0000 (00:12 +0100)]
readme: tell how to install clippy on travis from git if it is not shipped with a nightly.
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Mon, 26 Nov 2018 12:37:46 +0000 (13:37 +0100)]
Merge pull request #3365 from gnieto/lint/slow-initialization
Add slow vector initializations lint
Philipp Hansch [Mon, 26 Nov 2018 06:19:14 +0000 (07:19 +0100)]
Merge pull request #3456 from matthiaskrgr/builtin
constants: add u128 i128 builtin types and fix outdated url
Matthias Krüger [Mon, 26 Nov 2018 00:12:12 +0000 (01:12 +0100)]
constants: add u128 i128 builtin types and fix outdated url
Guillem Nieto [Sun, 25 Nov 2018 22:36:04 +0000 (14:36 -0800)]
Update lints
Guillem Nieto [Sun, 18 Nov 2018 22:45:53 +0000 (23:45 +0100)]
Lint only the first statment/expression after alloc
Instead of searching for all the successive expressions after a vector
allocation, check only the first expression.
This is done to minimize the amount of false positives of the lint.
Guillem Nieto [Mon, 5 Nov 2018 21:46:07 +0000 (22:46 +0100)]
Fix some warnings related to Self
Guillem Nieto [Tue, 30 Oct 2018 20:47:15 +0000 (21:47 +0100)]
Rename some symbols
Renamed some symbols in order to make them a little bit more accurate.
Guillem Nieto [Mon, 29 Oct 2018 23:25:05 +0000 (00:25 +0100)]
Split lint into slow and unsafe vector initalization
Guillem Nieto [Fri, 26 Oct 2018 20:35:16 +0000 (22:35 +0200)]
Add unsafe set_len initialization
Guillem Nieto [Thu, 18 Oct 2018 23:15:48 +0000 (01:15 +0200)]
Add slow zero-filled vector initialization lint
Add lint to detect slow zero-filled vector initialization. It detects
when a vector is zero-filled with extended with `repeat(0).take(len)`
or `resize(len, 0)`.
This zero-fillings are usually slower than simply using `vec![0; len]`.
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Sat, 24 Nov 2018 09:16:38 +0000 (10:16 +0100)]
Merge pull request #3439 from dtolnay/npbv
Downgrade needless_pass_by_value to allow by default
Philipp Hansch [Fri, 23 Nov 2018 21:13:50 +0000 (22:13 +0100)]
Merge pull request #3453 from phansch/remove_sudo_false
Travis: Remove `sudo: false`
Philipp Hansch [Fri, 23 Nov 2018 20:47:02 +0000 (21:47 +0100)]
Travis: Remove `sudo: false`
Philipp Hansch [Fri, 23 Nov 2018 09:38:20 +0000 (10:38 +0100)]
Merge pull request #3452 from matthiaskrgr/rustup
rustup https://github.com/rust-lang/rust/pull/54071/
Matthias Krüger [Fri, 23 Nov 2018 09:05:51 +0000 (10:05 +0100)]
rustup https://github.com/rust-lang/rust/pull/54071/
Philipp Hansch [Thu, 22 Nov 2018 17:54:09 +0000 (18:54 +0100)]
Merge pull request #3449 from matthiaskrgr/dep
dependencies: update pulldown-cmark from 0.1 to 0.2
Matthias Krüger [Thu, 22 Nov 2018 17:04:34 +0000 (18:04 +0100)]
dependencies: update pulldown-cmark from 0.1 to 0.2
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Thu, 22 Nov 2018 14:08:13 +0000 (15:08 +0100)]
Merge pull request #3447 from phansch/small_rename
s/file_map/source_map
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Thu, 22 Nov 2018 09:46:08 +0000 (10:46 +0100)]
Merge pull request #3442 from rust-lang/version_ids
Enable rustup clippy to refer to the correct documentation
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Thu, 22 Nov 2018 09:22:25 +0000 (10:22 +0100)]
Merge branch 'master' into version_ids
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Thu, 22 Nov 2018 08:38:56 +0000 (09:38 +0100)]
Merge pull request #3446 from matthiaskrgr/url_update
update urls (rust-lang-nursery => rust-lang)
Philipp Hansch [Thu, 22 Nov 2018 06:53:59 +0000 (07:53 +0100)]
s/file_map/source_map
Matthias Krüger [Thu, 22 Nov 2018 03:50:00 +0000 (04:50 +0100)]
missed another one in the README
Matthias Krüger [Thu, 22 Nov 2018 03:43:33 +0000 (04:43 +0100)]
run "util/dev update_lints"
Matthias Krüger [Thu, 22 Nov 2018 03:40:09 +0000 (04:40 +0100)]
rust-lang-nursery/rust-clippy => rust-lang/rust-clippy
bors[bot] [Wed, 21 Nov 2018 15:04:11 +0000 (15:04 +0000)]
Merge #3437
3437: issue #3318 Run trivially_copy_pass_by_ref for traits r=flip1995 a=waynr
Addresses #3318
Co-authored-by: Wayne Warren <wayne.warren.s@gmail.com>
Co-authored-by: Philipp Krones <hello@philkrones.com>
bors[bot] [Wed, 21 Nov 2018 14:11:24 +0000 (14:11 +0000)]
Merge #3443
3443: Document how to lint local Clippy changes with locally built Clippy r=flip1995 a=waynr
Co-authored-by: Wayne Warren <wayne.warren.s@gmail.com>
Wayne Warren [Wed, 21 Nov 2018 12:05:52 +0000 (06:05 -0600)]
Address 'clippy::single-match' dogfood lint
Philipp Krones [Wed, 21 Nov 2018 12:08:33 +0000 (06:08 -0600)]
Fix nit
Co-Authored-By: waynr <wayne.warren.s@gmail.com>
Wayne Warren [Wed, 21 Nov 2018 03:21:07 +0000 (21:21 -0600)]
Address travis CI lint failure
Wayne Warren [Wed, 21 Nov 2018 01:59:02 +0000 (19:59 -0600)]
Update trivially_copy_pass_by_ref with Trait stderr output
Wayne Warren [Wed, 21 Nov 2018 00:49:15 +0000 (18:49 -0600)]
issue#3318 run trivially_copy_pass_by_ref for traits
Wayne Warren [Wed, 21 Nov 2018 01:57:53 +0000 (19:57 -0600)]
Update trivially_copy_pass_by_ref with Trait examples
Wayne Warren [Wed, 21 Nov 2018 13:16:03 +0000 (07:16 -0600)]
Fix awkward wording
Wayne Warren [Wed, 21 Nov 2018 13:12:00 +0000 (07:12 -0600)]
Document how to lint local Clippy changes with locally built Clippy
bors[bot] [Wed, 21 Nov 2018 12:42:57 +0000 (12:42 +0000)]
Merge #3441
3441: rustup https://github.com/rust-lang/rust/pull/52591 r=flip1995 a=matthiaskrgr
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Oliver Scherer [Wed, 21 Nov 2018 12:33:42 +0000 (13:33 +0100)]
Enable rustup clippy to refer to the correct documentation
Matthias Krüger [Wed, 21 Nov 2018 12:29:23 +0000 (13:29 +0100)]
rustup https://github.com/rust-lang/rust/pull/52591
David Tolnay [Wed, 21 Nov 2018 09:58:27 +0000 (01:58 -0800)]
Downgrade needless_pass_by_value to allow by default
I noticed that I suppress this lint in many of my projects.
https://github.com/search?q=needless_pass_by_value+user%3Adtolnay&type=Code
https://github.com/search?q=needless_pass_by_value+user%3Aserde-rs&type=Code
Upon further inspection, this lint has a *long* history of false
positives (and several remaining).
Generally I feel that this lint is the definition of pedantic and should
not be linted by default.
#[derive(Debug)]
enum How {
ThisWay,
ThatWay,
}
// Are we really better off forcing the call sites to write f(&_)...?
fn f(how: How) {
println!("You want to do it {:?}", how);
}
fn main() {
f(How::ThatWay);
}
bors[bot] [Mon, 19 Nov 2018 21:07:49 +0000 (21:07 +0000)]
Merge #3432
3432: match_ref_pats: don't emit suggestions inside of a macro r=Manishearth a=flip1995
Fixes #2636
Co-authored-by: flip1995 <hello@philkrones.com>
bors[bot] [Sat, 17 Nov 2018 15:24:10 +0000 (15:24 +0000)]
Merge #3435
3435: remove unused allow() attributes, NFC r=flip1995 a=matthiaskrgr
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Matthias Krüger [Sat, 17 Nov 2018 12:47:27 +0000 (13:47 +0100)]
remove unused allow() attributes, NFC
bors[bot] [Thu, 15 Nov 2018 16:10:48 +0000 (16:10 +0000)]
Merge #3431
3431: rustup https://github.com/rust-lang/rust/pull/55852/ r=flip1995 a=matthiaskrgr
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
flip1995 [Thu, 15 Nov 2018 16:03:41 +0000 (17:03 +0100)]
Add regression test
flip1995 [Thu, 15 Nov 2018 16:03:17 +0000 (17:03 +0100)]
Don't emit suggestion when inside of a macro
Matthias Krüger [Thu, 15 Nov 2018 15:50:28 +0000 (16:50 +0100)]
rustup https://github.com/rust-lang/rust/pull/55852/
bors[bot] [Thu, 15 Nov 2018 14:18:12 +0000 (14:18 +0000)]
Merge #3419
3419: Linter to check that all common metadata is included r=flip1995 a=ysimonson
Addresses https://github.com/rust-lang-nursery/rust-clippy/issues/1793
This is not ready to be merged yet. First the associated changes to `cargo_metadata` need to be merged: https://github.com/oli-obk/cargo_metadata/pull/55
Co-authored-by: Yusuf Simonson <simonson@gmail.com>
bors[bot] [Wed, 14 Nov 2018 13:24:45 +0000 (13:24 +0000)]
Merge #3428
3428: Typo "too" -> "foo" in format.rs r=matthiaskrgr a=ama0
Co-authored-by: Anton <ama0@users.noreply.github.com>
Anton [Wed, 14 Nov 2018 13:08:52 +0000 (14:08 +0100)]
Fix "too" -> "foo" typo in format.rs
bors[bot] [Wed, 14 Nov 2018 08:57:32 +0000 (08:57 +0000)]
Merge #3427
3427: Fix wrong suggestion for `redundant_closure_call` r=oli-obk a=mikerite
Fixes #1684
Co-authored-by: Michael Wright <mikerite@lavabit.com>
Michael Wright [Wed, 14 Nov 2018 06:43:35 +0000 (08:43 +0200)]
Fix `use_self` violation
Michael Wright [Wed, 14 Nov 2018 06:01:39 +0000 (08:01 +0200)]
Fix wrong suggestion for `redundant_closure_call`
Fixes #1684
Yusuf Simonson [Tue, 13 Nov 2018 13:43:30 +0000 (08:43 -0500)]
Check for common metadata
bors[bot] [Tue, 13 Nov 2018 12:57:20 +0000 (12:57 +0000)]
Merge #3426
3426: Fix `use_self` false positive on `use` statements r=flip1995 a=mikerite
Fixes #3425
Co-authored-by: Michael Wright <mikerite@lavabit.com>
Michael Wright [Tue, 13 Nov 2018 04:15:33 +0000 (06:15 +0200)]
Fix `use_self` false positive on `use` statements
bors[bot] [Sat, 10 Nov 2018 13:16:35 +0000 (13:16 +0000)]
Merge #3423
3423: Fix `use_self` false positive r=flip1995 a=mikerite
This fixes the first error reported in issue #3410.
Co-authored-by: Michael Wright <mikerite@lavabit.com>
Michael Wright [Sat, 10 Nov 2018 08:46:21 +0000 (10:46 +0200)]
Fix `use_self` false positive
This fixes the first error reported in issue #3410.
bors[bot] [Wed, 7 Nov 2018 07:16:43 +0000 (07:16 +0000)]
Merge #3407
3407: Fix `possible_missing_comma` false positives r=oli-obk a=mikerite
`possible_missing_comma` should only trigger when the binary operator has
unary equivalent. Otherwise, it's not possible to insert a comma without
breaking compilation. The operators identified were `+`, `&`, `*` and `-`.
This fixes the specific examples given in issues #3244 and #3396
but doesn't address the conflict this lint has with the style of starting
a line with a binary operator.
Co-authored-by: Michael Wright <mikerite@lavabit.com>
Michael Wright [Tue, 6 Nov 2018 05:05:13 +0000 (07:05 +0200)]
Remove `+` from `has_unary_equivalent`
Rust doesn't has a unary + operator!
Michael Wright [Tue, 6 Nov 2018 05:00:54 +0000 (07:00 +0200)]
Merge branch 'master' into fix-missing-comma-fp
bors[bot] [Mon, 5 Nov 2018 09:02:11 +0000 (09:02 +0000)]
Merge #3408
3408: RIIR update lints: Add check mode (update_lints.py rewrite complete) r=oli-obk a=phansch
This finishes up the rewrite of `update_lints.py` in Rust. More
specifically, this
* adds the `--check` flag and handling to clippy_dev
* tracks file changes over the different calls to `replace_region_in_file`
* only writes changes to files if the `--check` flag is *not* used
* runs `./util/dev update_lints --check` on CI instead of the old script
* replaces usage of the `update_lints.py` script with an error
`./util/dev update_lints` behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
`clippy_lints/src/lib.rs` because underscores seem to be sorted
differently in Rust and in Python.
:checkered_flag:
cc #2882
Co-authored-by: Philipp Hansch <dev@phansch.net>
Co-authored-by: Philipp Krones <hello@philkrones.com>
Philipp Hansch [Mon, 5 Nov 2018 06:11:25 +0000 (07:11 +0100)]
Fix dogfood
Philipp Krones [Sun, 4 Nov 2018 21:08:18 +0000 (22:08 +0100)]
Update println! formatting
Co-Authored-By: phansch <dev@phansch.net>
Philipp Hansch [Sun, 4 Nov 2018 21:05:12 +0000 (22:05 +0100)]
Fix false positive in check mode caused by `gen_deprecated`
`gen_deprecated` should never have created the string with linebreaks.
Using a single string broke the check because the changed lines were
different.
Philipp Hansch [Sun, 4 Nov 2018 08:41:28 +0000 (09:41 +0100)]
RIIR update lints: Add check mode (update_lints.py rewrite complete)
This finishes up the rewrite of `update_lints.py` in Rust. More
specifically, this
* adds the `--check` flag and handling to clippy_dev
* tracks file changes over the different calls to `replace_region_in_file`
* only writes changes to files if the `--check` flag is *not* used
* runs `./util/dev update_lints --check` on CI instead of the old script
* replaces usage of the `update_lints.py` script with an error
`./util/dev update_lints` behaves 99% the same as the python script.
The only difference that I'm aware of is an ordering change to
`clippy_lints/src/lib.rs` because underscores seem to be sorted
differently in Rust and in Python.
:checkered_flag:
bors[bot] [Mon, 5 Nov 2018 03:58:15 +0000 (03:58 +0000)]
Merge #3353
3353: float support added for mistyped_literal_suffixes lint r=mikerite a=Maxgy
I implemented the mistyped_literal_suffixes lint for float literals.
```
#![allow(unused_variables)]
fn main() {
let x = 1E2_32;
let x = 75.22_64;
}
```
Given the above, the additional check suggests the variables to be written as `let x = 1E2_f32` and `let x = 75.22_f64`.
Fixes #3167
Co-authored-by: Maxwell Anderson <maxwell.brayden.anderson@gmail.com>
bors[bot] [Sun, 4 Nov 2018 22:22:03 +0000 (22:22 +0000)]
Merge #3411
3411: rustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference) r=matthiaskrgr a=matthiaskrgr
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Matthias Krüger [Sun, 4 Nov 2018 21:47:20 +0000 (22:47 +0100)]
rustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference)
Maxwell Anderson [Sun, 4 Nov 2018 17:39:54 +0000 (10:39 -0700)]
changed into_iter to iter and fixed a lint check
Michael Wright [Sun, 4 Nov 2018 08:48:24 +0000 (10:48 +0200)]
Fix `collapsible_if` error
Michael Wright [Sun, 4 Nov 2018 08:02:49 +0000 (10:02 +0200)]
Fix `possible_missing_comma` false positives
`possible_missing_comma` should only trigger when the binary operator has
unary equivalent. Otherwise, it's not possible to insert a comma without
breaking compilation. The operators identified were `+`, `&`, `*` and `-`.
This fixes the specific examples given in issues #3244 and #3396
but doesn't address the conflict this lint has with the style of starting
a line with a binary operator.
bors[bot] [Sat, 3 Nov 2018 19:11:35 +0000 (19:11 +0000)]
Merge #3399
3399: RIIR update lints: Generate modules section and lint group sections r=flip1995 a=phansch
This adds the last missing parts of the generating code.
cc #2882
Co-authored-by: Philipp Hansch <dev@phansch.net>
Philipp Hansch [Sat, 3 Nov 2018 19:06:48 +0000 (20:06 +0100)]
Merge pull request #3404 from matthiaskrgr/rustup
rustup https://github.com/rust-lang/rust/pull/55330/
Matthias Krüger [Sat, 3 Nov 2018 17:50:23 +0000 (18:50 +0100)]
rustup https://github.com/rust-lang/rust/pull/55330/
Philipp Hansch [Sat, 3 Nov 2018 17:48:39 +0000 (18:48 +0100)]
Fix typo
Philipp Hansch [Sat, 3 Nov 2018 11:59:40 +0000 (12:59 +0100)]
Improve clippy_dev help text
Philipp Hansch [Sat, 3 Nov 2018 11:59:13 +0000 (12:59 +0100)]
RIIR update lints: Generate lint group registrations
Philipp Hansch [Sat, 3 Nov 2018 09:58:45 +0000 (10:58 +0100)]
Test clippy_dev on CI and fix test
bors[bot] [Sat, 3 Nov 2018 08:34:13 +0000 (08:34 +0000)]
Merge #3400
3400: Fix a false-positive of needless_borrow r=phansch a=sinkuu
Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
bors[bot] [Sat, 3 Nov 2018 08:12:10 +0000 (08:12 +0000)]
Merge #3123
3123: Lint #[cfg_attr(rustfmt, rustfmt_skip)] and suggest #[rustfmt::skip] r=phansch a=flip1995
Closes #3121
Co-authored-by: flip1995 <9744647+flip1995@users.noreply.github.com>
Co-authored-by: flip1995 <hello@philkrones.com>
Philipp Hansch [Thu, 1 Nov 2018 19:16:38 +0000 (20:16 +0100)]
RIIR update lints: Generate modules section
flip1995 [Fri, 2 Nov 2018 12:43:16 +0000 (13:43 +0100)]
Update stderr
flip1995 [Thu, 1 Nov 2018 19:17:04 +0000 (20:17 +0100)]
Rename test files
flip1995 [Thu, 1 Nov 2018 19:06:59 +0000 (20:06 +0100)]
Also lint cfg_attr(.., rustfmt::skip)
flip1995 [Thu, 1 Nov 2018 19:06:25 +0000 (20:06 +0100)]
Add tests from rustfmt::skip test file
flip1995 [Mon, 15 Oct 2018 13:18:26 +0000 (15:18 +0200)]
Run update_lints.py script
flip1995 [Tue, 18 Sep 2018 09:36:59 +0000 (11:36 +0200)]
Add test for non-crate-level inner attributes
flip1995 [Tue, 18 Sep 2018 09:35:53 +0000 (11:35 +0200)]
Differ between inner and outer attributes
flip1995 [Mon, 3 Sep 2018 13:34:33 +0000 (15:34 +0200)]
Add tests
flip1995 [Mon, 3 Sep 2018 13:34:12 +0000 (15:34 +0200)]
Add cfg_attr(rustfmt) lint
bors[bot] [Fri, 2 Nov 2018 15:08:38 +0000 (15:08 +0000)]
Merge #3344
3344: Added lints `into_iter_on_ref` and `into_iter_on_array`. r=phansch a=kennytm
Fixes #1565.
`into_iter_on_array` is a correctness lint against `into_iter()` on `[T; n]` and `PathBuf` (please provide a concise noun that covers both types 🙃).
`into_iter_on_ref` is a style lint against `into_iter()` on `&C` where `C` is `[T]`, `Vec<T>`, `BTreeSet<T>` etc.
Both suggests replacing the `into_iter()` with `iter()` or `iter_mut()`.
`into_iter_on_array` is a correctness lint since it is very likely the standard library would provide an `into_iter()` method for `[T; n]` (rust-lang/rust#25725) and existing type inference of `[a, b, c].into_iter()` will be broken. `PathBuf` is also placed under this lint since `PathBuf::into_iter` currently doesn't exist and it makes some sense to implement `IntoIterator` on it yielding `OsString`s.
Co-authored-by: kennytm <kennytm@gmail.com>
kennytm [Tue, 23 Oct 2018 17:50:18 +0000 (01:50 +0800)]
Addressed comments.
kennytm [Mon, 22 Oct 2018 03:44:09 +0000 (11:44 +0800)]
Fix dogfood error.
kennytm [Sat, 20 Oct 2018 20:03:38 +0000 (04:03 +0800)]
Added lints `into_iter_on_ref` and `into_iter_on_array`. Fix #1565.
bors[bot] [Fri, 2 Nov 2018 13:17:59 +0000 (13:17 +0000)]
Merge #3161
3161: New lint: Unknown clippy lints r=phansch a=flip1995
This is the Clippy version of the `rustc` lint `unknown_lints`. The behavior of this lint is pretty much the same.
Before this is merged a small change in the compiler needs to be done: `CheckLintNameResult` needs to be public. See rust-lang/rust#54106
Co-authored-by: flip1995 <9744647+flip1995@users.noreply.github.com>
Co-authored-by: flip1995 <hello@philkrones.com>
flip1995 [Fri, 2 Nov 2018 13:00:46 +0000 (14:00 +0100)]
Allow single_match_else
flip1995 [Fri, 2 Nov 2018 11:58:16 +0000 (12:58 +0100)]
Update stderr