]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoMerge #3432
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>
5 years agoMerge #3435
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>
5 years agoremove unused allow() attributes, NFC
Matthias Krüger [Sat, 17 Nov 2018 12:47:27 +0000 (13:47 +0100)]
remove unused allow() attributes, NFC

5 years agoMerge #3431
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>
5 years agoAdd regression test
flip1995 [Thu, 15 Nov 2018 16:03:41 +0000 (17:03 +0100)]
Add regression test

5 years agoDon't emit suggestion when inside of a macro
flip1995 [Thu, 15 Nov 2018 16:03:17 +0000 (17:03 +0100)]
Don't emit suggestion when inside of a macro

5 years agorustup https://github.com/rust-lang/rust/pull/55852/
Matthias Krüger [Thu, 15 Nov 2018 15:50:28 +0000 (16:50 +0100)]
rustup https://github.com/rust-lang/rust/pull/55852/

5 years agoMerge #3419
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>
5 years agoMerge #3428
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>
5 years agoFix "too" -> "foo" typo in format.rs
Anton [Wed, 14 Nov 2018 13:08:52 +0000 (14:08 +0100)]
Fix "too" -> "foo" typo in format.rs

5 years agoMerge #3427
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>
5 years agoFix `use_self` violation
Michael Wright [Wed, 14 Nov 2018 06:43:35 +0000 (08:43 +0200)]
Fix `use_self` violation

5 years agoFix wrong suggestion for `redundant_closure_call`
Michael Wright [Wed, 14 Nov 2018 06:01:39 +0000 (08:01 +0200)]
Fix wrong suggestion for `redundant_closure_call`

Fixes #1684

5 years agoCheck for common metadata
Yusuf Simonson [Tue, 13 Nov 2018 13:43:30 +0000 (08:43 -0500)]
Check for common metadata

5 years agoMerge #3426
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>
5 years agoFix `use_self` false positive on `use` statements
Michael Wright [Tue, 13 Nov 2018 04:15:33 +0000 (06:15 +0200)]
Fix `use_self` false positive on `use` statements

5 years agoMerge #3423
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>
5 years agoFix `use_self` false positive
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.

5 years agoMerge #3407
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>
5 years agoRemove `+` from `has_unary_equivalent`
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!

5 years agoMerge branch 'master' into fix-missing-comma-fp
Michael Wright [Tue, 6 Nov 2018 05:00:54 +0000 (07:00 +0200)]
Merge branch 'master' into fix-missing-comma-fp

5 years agoMerge #3408
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>
5 years agoFix dogfood
Philipp Hansch [Mon, 5 Nov 2018 06:11:25 +0000 (07:11 +0100)]
Fix dogfood

5 years agoUpdate println! formatting
Philipp Krones [Sun, 4 Nov 2018 21:08:18 +0000 (22:08 +0100)]
Update println! formatting

Co-Authored-By: phansch <dev@phansch.net>
5 years agoFix false positive in check mode caused by `gen_deprecated`
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.

5 years agoRIIR update lints: Add check mode (update_lints.py rewrite complete)
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:

5 years agoMerge #3353
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>
5 years agoMerge #3411
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>
5 years agorustup https://github.com/rust-lang/rust/pull/55665 (pass contexts by reference)
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)

5 years agochanged into_iter to iter and fixed a lint check
Maxwell Anderson [Sun, 4 Nov 2018 17:39:54 +0000 (10:39 -0700)]
changed into_iter to iter and fixed a lint check

5 years agoFix `collapsible_if` error
Michael Wright [Sun, 4 Nov 2018 08:48:24 +0000 (10:48 +0200)]
Fix `collapsible_if` error

5 years agoFix `possible_missing_comma` false positives
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.

5 years agoMerge #3399
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>
5 years agoMerge pull request #3404 from matthiaskrgr/rustup
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/

5 years agorustup 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/

5 years agoFix typo
Philipp Hansch [Sat, 3 Nov 2018 17:48:39 +0000 (18:48 +0100)]
Fix typo

5 years agoImprove clippy_dev help text
Philipp Hansch [Sat, 3 Nov 2018 11:59:40 +0000 (12:59 +0100)]
Improve clippy_dev help text

5 years agoRIIR update lints: Generate lint group registrations
Philipp Hansch [Sat, 3 Nov 2018 11:59:13 +0000 (12:59 +0100)]
RIIR update lints: Generate lint group registrations

5 years agoTest clippy_dev on CI and fix test
Philipp Hansch [Sat, 3 Nov 2018 09:58:45 +0000 (10:58 +0100)]
Test clippy_dev on CI and fix test

5 years agoMerge #3400
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>
5 years agoMerge #3123
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>
5 years agoRIIR update lints: Generate modules section
Philipp Hansch [Thu, 1 Nov 2018 19:16:38 +0000 (20:16 +0100)]
RIIR update lints: Generate modules section

5 years agoUpdate stderr
flip1995 [Fri, 2 Nov 2018 12:43:16 +0000 (13:43 +0100)]
Update stderr

5 years agoRename test files
flip1995 [Thu, 1 Nov 2018 19:17:04 +0000 (20:17 +0100)]
Rename test files

5 years agoAlso lint cfg_attr(.., rustfmt::skip)
flip1995 [Thu, 1 Nov 2018 19:06:59 +0000 (20:06 +0100)]
Also lint cfg_attr(.., rustfmt::skip)

5 years agoAdd tests from rustfmt::skip test file
flip1995 [Thu, 1 Nov 2018 19:06:25 +0000 (20:06 +0100)]
Add tests from rustfmt::skip test file

5 years agoRun update_lints.py script
flip1995 [Mon, 15 Oct 2018 13:18:26 +0000 (15:18 +0200)]
Run update_lints.py script

5 years agoAdd test for non-crate-level inner attributes
flip1995 [Tue, 18 Sep 2018 09:36:59 +0000 (11:36 +0200)]
Add test for non-crate-level inner attributes

5 years agoDiffer between inner and outer attributes
flip1995 [Tue, 18 Sep 2018 09:35:53 +0000 (11:35 +0200)]
Differ between inner and outer attributes

5 years agoAdd tests
flip1995 [Mon, 3 Sep 2018 13:34:33 +0000 (15:34 +0200)]
Add tests

5 years agoAdd cfg_attr(rustfmt) lint
flip1995 [Mon, 3 Sep 2018 13:34:12 +0000 (15:34 +0200)]
Add cfg_attr(rustfmt) lint

5 years agoMerge #3344
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>
5 years agoAddressed comments.
kennytm [Tue, 23 Oct 2018 17:50:18 +0000 (01:50 +0800)]
Addressed comments.

5 years agoFix dogfood error.
kennytm [Mon, 22 Oct 2018 03:44:09 +0000 (11:44 +0800)]
Fix dogfood error.

5 years agoAdded lints `into_iter_on_ref` and `into_iter_on_array`. Fix #1565.
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.

5 years agoMerge #3161
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>
5 years agoAllow single_match_else
flip1995 [Fri, 2 Nov 2018 13:00:46 +0000 (14:00 +0100)]
Allow single_match_else

5 years agoUpdate stderr
flip1995 [Fri, 2 Nov 2018 11:58:16 +0000 (12:58 +0100)]
Update stderr

5 years agoAdd copyright statement©
flip1995 [Thu, 1 Nov 2018 20:02:15 +0000 (21:02 +0100)]
Add copyright statement©

5 years agoFix typos
flip1995 [Thu, 1 Nov 2018 19:37:13 +0000 (20:37 +0100)]
Fix typos

5 years agoFix dogfood error
flip1995 [Thu, 13 Sep 2018 08:54:02 +0000 (10:54 +0200)]
Fix dogfood error

5 years agoFix typo and indentation
flip1995 [Mon, 10 Sep 2018 15:52:44 +0000 (17:52 +0200)]
Fix typo and indentation

5 years agorun update_lints script
flip1995 [Mon, 10 Sep 2018 15:26:48 +0000 (17:26 +0200)]
run update_lints script

5 years agoAdd tests for unknwon_clippy_lints lint
flip1995 [Mon, 10 Sep 2018 15:21:50 +0000 (17:21 +0200)]
Add tests for unknwon_clippy_lints lint

5 years agoAdd new lint: unknwon_clippy_lintsg
flip1995 [Mon, 10 Sep 2018 15:09:15 +0000 (17:09 +0200)]
Add new lint: unknwon_clippy_lintsg

5 years agoMerge #3402
bors[bot] [Fri, 2 Nov 2018 11:30:03 +0000 (11:30 +0000)]
Merge #3402

3402: clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase r=oli-obk a=matthiaskrgr

Turn on pedantic lints in dogfood and base tests.

needless_bool: fix clippy::items-after-statements
redundant_pattern_matching: fix clippy::similar-names
mods.rs: fix clippy::explicit-iter-loop
returns.rs: allow clippy::cast-possible-wrap

Fixes #3172

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoclippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
Matthias Krüger [Fri, 2 Nov 2018 11:12:14 +0000 (12:12 +0100)]
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.

Turn on pedantic lints in dogfood and base tests.

needless_bool: fix clippy::items-after-statements
redundant_pattern_matching: fix clippy::similar-names
mods.rs: fix clippy::explicit-iter-loop
returns.rs: allow clippy::cast-possible-wrap

Fixes #3172

5 years agoMerge #3387
bors[bot] [Fri, 2 Nov 2018 07:58:00 +0000 (07:58 +0000)]
Merge #3387

3387: Replace big if/else expression with match r=flip1995 a=mikerite

Co-authored-by: Michael Wright <mikerite@lavabit.com>
5 years agoMerge #3397 #3398
bors[bot] [Fri, 2 Nov 2018 07:34:38 +0000 (07:34 +0000)]
Merge #3397 #3398

3397: UI test cleanup: Extract expect_fun_call tests r=matthiaskrgr a=phansch

Note that the new stderr file does not include a `shadow-unrelated`
error, because the new UI test file does not use `#![warn(clippy::all)]`

cc #2038

3398: UI test cleanup: Extract match_overlapping_arm tests r=matthiaskrgr a=phansch

cc #2038

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoFix a false-positive of needless_borrow
Shotaro Yamada [Fri, 2 Nov 2018 06:56:47 +0000 (15:56 +0900)]
Fix a false-positive of needless_borrow

5 years agoMerge #3388
bors[bot] [Fri, 2 Nov 2018 06:29:40 +0000 (06:29 +0000)]
Merge #3388

3388: RIIR update lints: Generate deprecated lints r=phansch a=phansch

The update script now also generates the 'register_removed' section in
`clippy_lints/src/lib.rs`.

Also, instead of using `let mut store ...`, I added a new identifier
line so that the replacement will continue to work in case `let mut
store ...` ever changes.

cc #2882

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoUI test cleanup: Extract match_overlapping_arm tests
Philipp Hansch [Tue, 30 Oct 2018 20:36:52 +0000 (21:36 +0100)]
UI test cleanup: Extract match_overlapping_arm tests

5 years agoUI test cleanup: Extract expect_fun_call tests
Philipp Hansch [Tue, 30 Oct 2018 20:21:23 +0000 (21:21 +0100)]
UI test cleanup: Extract expect_fun_call tests

Note that the new stderr file does not include a `shadow-unrelated`
error, because the new UI test file does not use `#![warn(clippy::all)]`

5 years agoMerge #3389
bors[bot] [Fri, 2 Nov 2018 05:49:49 +0000 (05:49 +0000)]
Merge #3389

3389: ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time on ci. r=phansch a=matthiaskrgr

the compiletime optimizations probably take longer than the speedup we get when executing the optimized binary vs debug build.

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoformat code
Maxwell Anderson [Thu, 1 Nov 2018 21:43:40 +0000 (15:43 -0600)]
format code

5 years agoMerge remote-tracking branch 'upstream/master'
Maxwell Anderson [Thu, 1 Nov 2018 21:26:38 +0000 (15:26 -0600)]
Merge remote-tracking branch 'upstream/master'

5 years agoMerge pull request #3395 from phansch/add_missing_coc_file
Manish Goregaokar [Thu, 1 Nov 2018 21:24:36 +0000 (14:24 -0700)]
Merge pull request #3395 from phansch/add_missing_coc_file

Add missing code of conduct file

5 years agoMerge pull request #3394 from phansch/rustup
Manish Goregaokar [Thu, 1 Nov 2018 20:57:27 +0000 (13:57 -0700)]
Merge pull request #3394 from phansch/rustup

Fix clippy build failure on latest master

5 years agoAdd missing code of conduct file
Philipp Hansch [Thu, 1 Nov 2018 20:31:05 +0000 (21:31 +0100)]
Add missing code of conduct file

We are already using the Rust code of conduct, this just ticks off an
additional checkbox [here][community].

This version is taken from [rustfmt][rustfmt].

[community]: https://github.com/rust-lang-nursery/rust-clippy/community
[rustfmt]: https://github.com/rust-lang-nursery/rustfmt

5 years agoFix clippy build failure on latest master
Philipp Hansch [Thu, 1 Nov 2018 19:35:23 +0000 (20:35 +0100)]
Fix clippy build failure on latest master

5 years agofix comment spacing
Maxwell Anderson [Thu, 1 Nov 2018 18:35:01 +0000 (12:35 -0600)]
fix comment spacing

5 years agoUse slice patterns instead of padding
Michael Wright [Thu, 1 Nov 2018 05:06:47 +0000 (07:06 +0200)]
Use slice patterns instead of padding

5 years agochange single char str to char
Maxwell Anderson [Thu, 1 Nov 2018 00:09:56 +0000 (18:09 -0600)]
change single char str to char

5 years agoMerge remote-tracking branch 'upstream/master'
Maxwell Anderson [Wed, 31 Oct 2018 22:48:47 +0000 (16:48 -0600)]
Merge remote-tracking branch 'upstream/master'

5 years agoadd lint to lintarray macro
Maxwell Anderson [Wed, 31 Oct 2018 22:48:24 +0000 (16:48 -0600)]
add lint to lintarray macro

5 years agoRevert "small fix"
Maxwell Anderson [Wed, 31 Oct 2018 22:39:12 +0000 (16:39 -0600)]
Revert "small fix"

This reverts commit b1abc81a60e05bb2cf46850b977b7fa4ba34a6de.

5 years agoMerge #3392
bors[bot] [Wed, 31 Oct 2018 21:08:34 +0000 (21:08 +0000)]
Merge #3392

3392: UI test cleanup: Extract for_loop_over_x tests r=matthiaskrgr a=phansch

cc #2038

Co-authored-by: Philipp Hansch <dev@phansch.net>
5 years agoFix dogfood and pedantic lints
Philipp Hansch [Wed, 31 Oct 2018 20:54:30 +0000 (21:54 +0100)]
Fix dogfood and pedantic lints

5 years agoMerge #3368
bors[bot] [Wed, 31 Oct 2018 10:21:51 +0000 (10:21 +0000)]
Merge #3368

3368: added downsides to "known problems" for get_unwrap lint r=flip1995 a=humean

As a beginner I found this lint to be confusing because I was not sure how the `Option` type disappeared as conceptually I know that my `.get()` and Index could fail. Initially I thought maybe the compiler or clippy was smart enough to understand that it was impossible for my `.get()` to fail in this particular case, but it was explained to me that using the Index syntax is just shorthand for directly unwrapping the value:

https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#1547

For beginners or users trying to iterate quickly it seems common to litter your code with `unwrap` or `except` as placeholders for where some explicit error handling might need to take place. I think it should be warned that using Index is merely more concise, but doesn't at all reduce the risk of panics and might in fact cause you to miss handling them in a future refactor.

Co-authored-by: Michael Rutter <michael.john.rutter@gmail.com>
Co-authored-by: Michael Rutter <humean@users.noreply.github.com>
5 years agoci: when installing rust-toolchain-installer-master, install it in debug mode to...
Matthias Krüger [Wed, 31 Oct 2018 10:18:20 +0000 (11:18 +0100)]
ci: when installing rust-toolchain-installer-master, install it in debug mode to save some time in ci.

the compiletime optimizations probably take longer than the speedup we get when executing the optimized binary vs debug build.

5 years agoMerge #3378
bors[bot] [Wed, 31 Oct 2018 07:18:42 +0000 (07:18 +0000)]
Merge #3378

3378: Fix lint_without_lint_pass r=phansch a=mikerite

Co-authored-by: Michael Wright <mikerite@lavabit.com>
Co-authored-by: flip1995 <hello@philkrones.com>
5 years agoRIIR update lints: Generate deprecated lints
Philipp Hansch [Wed, 31 Oct 2018 07:03:50 +0000 (08:03 +0100)]
RIIR update lints: Generate deprecated lints

The update script now also generates the 'register_removed' section in
`clippy_lints/src/lib.rs`.

Also, instead of using `let mut store ...`, I added a new identifier
line so that the replacement will continue to work in case `let mut
store ...` ever changes.

5 years agoMerge #3370
bors[bot] [Wed, 31 Oct 2018 06:48:49 +0000 (06:48 +0000)]
Merge #3370

3370: bool_comparison triggers 3 times on same code r=phansch a=mrbuzz

Fix #3335

Co-authored-by: Giorgio Gambino <gambnio.giorgio@gmail.com>
5 years agoMerge #3386
bors[bot] [Wed, 31 Oct 2018 06:03:33 +0000 (06:03 +0000)]
Merge #3386

3386: docs: use_self: hightlight the "should be" code sample as rust code as well. r=phansch a=matthiaskrgr

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoReplace big if/else expression with match
Michael Wright [Wed, 31 Oct 2018 04:26:29 +0000 (06:26 +0200)]
Replace big if/else expression with match

5 years agoMerge #3384
bors[bot] [Wed, 31 Oct 2018 01:29:36 +0000 (01:29 +0000)]
Merge #3384

3384: make ci use master rustc instead of nightly r=flip1995 a=matthiaskrgr

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
5 years agoRevert "travis: work around temporary test failure due to rustc crashing on hyper."
Matthias Krüger [Tue, 30 Oct 2018 14:58:35 +0000 (15:58 +0100)]
Revert "travis: work around temporary test failure due to rustc crashing on hyper."

This reverts commit 326270ad1221b54028f9d029881fa0b1fb742db9.

5 years agoRevert "appveyor: use rustc nightly instead of master"
Matthias Krüger [Tue, 30 Oct 2018 14:42:15 +0000 (15:42 +0100)]
Revert "appveyor: use rustc nightly instead of master"

This reverts commit 3f0161918871403b4e0547191a93f395b8bf5b35.

5 years agoRevert "Disable rust master toolchain build temporarily"
Matthias Krüger [Tue, 30 Oct 2018 14:41:59 +0000 (15:41 +0100)]
Revert "Disable rust master toolchain build temporarily"

This reverts commit 0d899562cd805bd4335d6ee8d88e2bf1f743f000.

5 years agodocs: use_self: hightlight the "should be" code sample as rust code as well.
Matthias Krüger [Wed, 31 Oct 2018 00:42:17 +0000 (01:42 +0100)]
docs: use_self: hightlight the "should be" code sample as rust code as well.