]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #3693 - phansch:rustup, r=matthiaskrgr
bors [Thu, 24 Jan 2019 19:40:31 +0000 (19:40 +0000)]
Auto merge of #3693 - phansch:rustup, r=matthiaskrgr

Rustup

Due to https://github.com/rust-lang/rust/pull/51285

5 years agoRustup
Philipp Hansch [Thu, 24 Jan 2019 19:32:18 +0000 (20:32 +0100)]
Rustup

Due to https://github.com/rust-lang/rust/pull/51285

5 years agoAuto merge of #3582 - Arkweid:add-lints-aseert-checks, r=flip1995
bors [Wed, 23 Jan 2019 17:42:30 +0000 (17:42 +0000)]
Auto merge of #3582 - Arkweid:add-lints-aseert-checks, r=flip1995

Add assert(true) and assert(false) lints

This PR add two lints on assert!(true) and assert!(false).
#3575

5 years agoallow assertions_on_constants for collapsible_if and missing_test_files
A.A.Abroskin [Wed, 23 Jan 2019 08:49:02 +0000 (11:49 +0300)]
allow assertions_on_constants for collapsible_if and missing_test_files

5 years agoMerge branch 'master' into add-lints-aseert-checks
A.A.Abroskin [Wed, 23 Jan 2019 08:36:12 +0000 (11:36 +0300)]
Merge branch 'master' into add-lints-aseert-checks

* master: (58 commits)
  Rustfmt all the things
  Don't make decisions on values that don't represent the decision
  Improving comments.
  Rustup
  Added rustfix to the test.
  Improve span shortening.
  Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
  Actually check for constants.
  Fixed potential mistakes with nesting. Added tests.
  formatting fix
  Update clippy_lints/src/needless_bool.rs
  formatting fix
  Fixing typo in CONTRIBUTING.md
  Fix breakage due to rust-lang/rust#57651
  needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement
  Fix automatic suggestion on `use_self`.
  Remove negative integer literal checks.
  Fix `implicit_return` false positives.
  Run rustfmt
  Fixed breakage due to rust-lang/rust#57489
  ...

5 years agoAuto merge of #3684 - g-bartoszek:sugg-snippet-modifications, r=phansch
bors [Tue, 22 Jan 2019 20:18:11 +0000 (20:18 +0000)]
Auto merge of #3684 - g-bartoszek:sugg-snippet-modifications, r=phansch

"make_return" and "blockify" convenience methods, fixes #3683

…ed them in "needless_bool".

5 years agoAuto merge of #3679 - daxpedda:use_self, r=phansch
bors [Tue, 22 Jan 2019 19:18:39 +0000 (19:18 +0000)]
Auto merge of #3679 - daxpedda:use_self, r=phansch

Fix automatic suggestion on `use_self`.

In an example like this:
```rust
impl Example {
    fn fun_1() { }
    fn fun_2() {
        Example::fun_1();
    }
}
```
Clippy tries to replace `Example::fun_1` with `Self`, loosing `::fun_1` in the process, it should rather try to replace `Example` with `Self`.

**Question**
- There may be other paths that need the same treatment, but I'm not sure I understand them fully:
  - https://github.com/rust-lang/rust-clippy/blob/e648adf0866a1cea7db6ce2d33ea86e442f25377/clippy_lints/src/use_self.rs#L94-L96
  - https://github.com/rust-lang/rust-clippy/blob/e648adf0866a1cea7db6ce2d33ea86e442f25377/clippy_lints/src/use_self.rs#L225-L229

5 years agoAuto merge of #3685 - rust-lang:rustup, r=flip1995
bors [Tue, 22 Jan 2019 16:07:32 +0000 (16:07 +0000)]
Auto merge of #3685 - rust-lang:rustup, r=flip1995

Rustup

5 years agoRustfmt all the things
Oliver Scherer [Tue, 22 Jan 2019 15:27:42 +0000 (16:27 +0100)]
Rustfmt all the things

5 years agoDon't make decisions on values that don't represent the decision
Oliver Scherer [Tue, 22 Jan 2019 14:28:51 +0000 (15:28 +0100)]
Don't make decisions on values that don't represent the decision

5 years agoImproving comments.
daxpedda [Tue, 22 Jan 2019 14:23:45 +0000 (15:23 +0100)]
Improving comments.

5 years agoRustup
Oliver Scherer [Tue, 22 Jan 2019 14:17:05 +0000 (15:17 +0100)]
Rustup

5 years agoAdded rustfix to the test.
daxpedda [Tue, 22 Jan 2019 14:16:54 +0000 (15:16 +0100)]
Added rustfix to the test.

5 years agoImprove span shortening.
Philipp Krones [Tue, 22 Jan 2019 13:43:59 +0000 (14:43 +0100)]
Improve span shortening.

Co-Authored-By: daxpedda <1645124+daxpedda@users.noreply.github.com>
5 years agoAdded "make_return" and "blockify" convenience methods in Sugg and used them in ...
Grzegorz Bartoszek [Tue, 22 Jan 2019 11:33:47 +0000 (12:33 +0100)]
Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".

5 years agoAuto merge of #3677 - daxpedda:integer_arithmetic, r=oli-obk
bors [Mon, 21 Jan 2019 15:07:22 +0000 (15:07 +0000)]
Auto merge of #3677 - daxpedda:integer_arithmetic, r=oli-obk

Remove negative integer literal checks.

Fixes #3678.

5 years agoActually check for constants.
daxpedda [Mon, 21 Jan 2019 12:59:49 +0000 (13:59 +0100)]
Actually check for constants.

5 years agoAuto merge of #3676 - daxpedda:implicit_return, r=oli-obk
bors [Mon, 21 Jan 2019 12:25:45 +0000 (12:25 +0000)]
Auto merge of #3676 - daxpedda:implicit_return, r=oli-obk

Fix `implicit_return` false positives.

Fixes the following false positives:
- linting on `if let` without `else` in a `loop` even with a present `return`
- linting on `unreachable!()`

5 years agoFixed potential mistakes with nesting. Added tests.
daxpedda [Mon, 21 Jan 2019 12:06:32 +0000 (13:06 +0100)]
Fixed potential mistakes with nesting. Added tests.

5 years agoAuto merge of #3680 - g-bartoszek:needless-bool-else-if-brackets, r=oli-obk
bors [Mon, 21 Jan 2019 11:47:06 +0000 (11:47 +0000)]
Auto merge of #3680 - g-bartoszek:needless-bool-else-if-brackets, r=oli-obk

needless bool lint suggestion is wrapped in brackets if it is an "els…

…e" clause of an "if-else" statement

5 years agoformatting fix
Grzegorz Bartoszek [Mon, 21 Jan 2019 11:04:15 +0000 (12:04 +0100)]
formatting fix

5 years agoUpdate clippy_lints/src/needless_bool.rs
Oliver Scherer [Mon, 21 Jan 2019 10:41:33 +0000 (11:41 +0100)]
Update clippy_lints/src/needless_bool.rs

Co-Authored-By: g-bartoszek <grzegorz.bartoszek@thaumatec.com>
5 years agoformatting fix
Grzegorz Bartoszek [Mon, 21 Jan 2019 10:14:34 +0000 (11:14 +0100)]
formatting fix

5 years agoAuto merge of #3681 - rmcteggart-r7:master, r=matthiaskrgr
bors [Sun, 20 Jan 2019 22:21:00 +0000 (22:21 +0000)]
Auto merge of #3681 - rmcteggart-r7:master, r=matthiaskrgr

Fixing typo in CONTRIBUTING.md

Noticed small typo in CONTRIBUTING readme when working on another issue

5 years agoAuto merge of #3675 - mikerite:fix-build-20190120, r=matthiaskrgr
bors [Sun, 20 Jan 2019 21:52:18 +0000 (21:52 +0000)]
Auto merge of #3675 - mikerite:fix-build-20190120, r=matthiaskrgr

Fix build 20190120

5 years agoFixing typo in CONTRIBUTING.md
rmcteggart-r7 [Sun, 20 Jan 2019 21:25:36 +0000 (21:25 +0000)]
Fixing typo in CONTRIBUTING.md

5 years agoFix breakage due to rust-lang/rust#57651
Michael Wright [Sun, 20 Jan 2019 20:54:04 +0000 (22:54 +0200)]
Fix breakage due to rust-lang/rust#57651

5 years agoneedless bool lint suggestion is wrapped in brackets if it is an "else" clause of...
Grzegorz Bartoszek [Sun, 20 Jan 2019 15:15:00 +0000 (16:15 +0100)]
needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement

5 years agoFix automatic suggestion on `use_self`.
daxpedda [Sun, 20 Jan 2019 13:50:26 +0000 (14:50 +0100)]
Fix automatic suggestion on `use_self`.

5 years agoRemove negative integer literal checks.
daxpedda [Sun, 20 Jan 2019 13:18:31 +0000 (14:18 +0100)]
Remove negative integer literal checks.

5 years agoFix `implicit_return` false positives.
daxpedda [Sun, 20 Jan 2019 12:45:22 +0000 (13:45 +0100)]
Fix `implicit_return` false positives.

5 years agoRun rustfmt
Michael Wright [Sun, 20 Jan 2019 10:49:45 +0000 (12:49 +0200)]
Run rustfmt

5 years agoFixed breakage due to rust-lang/rust#57489
Michael Wright [Sun, 20 Jan 2019 10:21:30 +0000 (12:21 +0200)]
Fixed breakage due to rust-lang/rust#57489

5 years agoFix breakage due to rust-lang/rust#57755
Michael Wright [Sun, 20 Jan 2019 08:14:23 +0000 (10:14 +0200)]
Fix breakage due to rust-lang/rust#57755

5 years agoAuto merge of #3674 - sinkuu:fmt_rustup, r=oli-obk
bors [Sat, 19 Jan 2019 12:40:46 +0000 (12:40 +0000)]
Auto merge of #3674 - sinkuu:fmt_rustup, r=oli-obk

Catch up with `format_args` change

Catches up with a change in rust-lang/rust#57537. (Since the optimization is optional, this clippy PR can be merged before the rustc PR.)

Happened to fix a bug in `expect_fun_call`, that is the lint ignores more than
one arguments to `format`.

```
warning: use of `expect` followed by a function call
 --> src/main.rs:2:17
  |
2 |     Some("foo").expect(format!("{} {}", 1, 2).as_ref());
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{} {}", 1))`
  |
```

5 years agoCatch up with `format_args` change
Shotaro Yamada [Sat, 19 Jan 2019 12:13:06 +0000 (21:13 +0900)]
Catch up with `format_args` change

Catches up with a change in rust-lang/rust#57537

Happened to fix a bug in `expect_fun_call`, that is the lint ignores more than
one arguments to `format`.

5 years agoAuto merge of #3672 - mikerite:fix-3670, r=oli-obk
bors [Sat, 19 Jan 2019 11:12:03 +0000 (11:12 +0000)]
Auto merge of #3672 - mikerite:fix-3670, r=oli-obk

Fix bad `while_let_on_iterator` suggestion.

Don't suggest a `for` loop if the iterator is used inside the `while` loop.

Closes #3670

5 years agoAuto merge of #3671 - matthiaskrgr:rustup, r=oli-obk
bors [Sat, 19 Jan 2019 10:46:32 +0000 (10:46 +0000)]
Auto merge of #3671 - matthiaskrgr:rustup, r=oli-obk

rustup https://github.com/rust-lang/rust/pull/57747

5 years agoFix bad `while_let_on_iterator` suggestion.
Michael Wright [Sat, 19 Jan 2019 09:36:27 +0000 (11:36 +0200)]
Fix bad `while_let_on_iterator` suggestion.

Don't suggest a `for` loop if the iterator is used inside the `while` loop.

Closes #3670

5 years agorustup https://github.com/rust-lang/rust/pull/57747
Matthias Krüger [Sat, 19 Jan 2019 08:27:45 +0000 (09:27 +0100)]
rustup https://github.com/rust-lang/rust/pull/57747

5 years agoAuto merge of #3669 - avborhanian:extra_results_files, r=oli-obk
bors [Fri, 18 Jan 2019 08:27:06 +0000 (08:27 +0000)]
Auto merge of #3669 - avborhanian:extra_results_files, r=oli-obk

Check for results files missing tests

Addresses #3572.

Basically iterates over all the files, and if it sees any files that don't have a matching rs file, it throws an error.

5 years agoAuto merge of #3668 - phansch:remove_bors_toml, r=flip1995
bors [Fri, 18 Jan 2019 07:44:17 +0000 (07:44 +0000)]
Auto merge of #3668 - phansch:remove_bors_toml, r=flip1995

Remove bors.toml

This file was only needed for bors-ng, but now we use the default
rust-lang bors fork.

5 years agoFixing issues pointed out by dogfood tests.
Unknown [Fri, 18 Jan 2019 05:12:35 +0000 (00:12 -0500)]
Fixing issues pointed out by dogfood tests.

5 years agoUpdate to collect all the files then throw the error.
Unknown [Fri, 18 Jan 2019 04:50:30 +0000 (23:50 -0500)]
Update to collect all the files then throw the error.

5 years agoAdding a test for checking if test files are missing.
Unknown [Fri, 18 Jan 2019 04:19:51 +0000 (23:19 -0500)]
Adding a test for checking if test files are missing.

5 years agoRemove bors.toml
Philipp Hansch [Thu, 17 Jan 2019 17:50:24 +0000 (18:50 +0100)]
Remove bors.toml

This file was only needed for bors-ng, but now we use the default
rust-lang bors fork.

5 years agoAuto merge of #3667 - euclio:applicability, r=phansch
bors [Thu, 17 Jan 2019 16:26:50 +0000 (16:26 +0000)]
Auto merge of #3667 - euclio:applicability, r=phansch

add applicability to lint name suggestion

5 years agoadd applicability to lint name suggestion
Andy Russell [Wed, 16 Jan 2019 20:27:43 +0000 (15:27 -0500)]
add applicability to lint name suggestion

5 years agoAuto merge of #3662 - mikerite:fix-498, r=oli-obk
bors [Tue, 15 Jan 2019 09:04:09 +0000 (09:04 +0000)]
Auto merge of #3662 - mikerite:fix-498, r=oli-obk

Fix `map_clone` bad suggestion

`cloned` requires that the elements of the iterator must be references. This
change determines if that is the case by examining the type of the closure
argument and suggesting `.cloned` only if it is a reference. When the closure
argument is not a reference, it suggests removing the `map` call instead.

A minor problem with this change is that the new check sometimes overlaps
with the `clone_on_copy` lint.

Fixes #498

5 years agoReally fix issue number in `map_clone` test
Michael Wright [Tue, 15 Jan 2019 06:36:56 +0000 (08:36 +0200)]
Really fix issue number in `map_clone` test

5 years agoFix issue number in `map_clone` test
Michael Wright [Tue, 15 Jan 2019 06:17:55 +0000 (08:17 +0200)]
Fix issue number in `map_clone` test

5 years agoRemove `map_clone` fixed known problem
Michael Wright [Tue, 15 Jan 2019 06:15:12 +0000 (08:15 +0200)]
Remove `map_clone` fixed known problem

5 years agoFix `map_clone` bad suggestion
Michael Wright [Tue, 15 Jan 2019 06:09:47 +0000 (08:09 +0200)]
Fix `map_clone` bad suggestion

`cloned` requires that the elements of the iterator must be references. This
change determines if that is the case by examining the type of the closure
argument and suggesting `.cloned` only if it is a reference. When the closure
argument is not a reference, it suggests removing the `map` call instead.

A minor problem with this change is that the new check sometimes overlaps
with the `clone_on_copy` lint.

Fixes #498

5 years agoAuto merge of #3657 - roblabla:bugfix-missing-docs-global-asm, r=phansch
bors [Mon, 14 Jan 2019 14:50:27 +0000 (14:50 +0000)]
Auto merge of #3657 - roblabla:bugfix-missing-docs-global-asm, r=phansch

Missing docs: don't require documenting Global Asm items.

global_asm! items cannot be documented, the lint still gets triggered after adding documentation to the macro invocation. Furthermore, even if we could add documentation to the AST node, rustdoc doesn't render it anyways.

Playground example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5182df182f0ffbbab4c3107e43368ac3

5 years agoAuto merge of #3653 - gendx:master, r=phansch
bors [Mon, 14 Jan 2019 09:16:20 +0000 (09:16 +0000)]
Auto merge of #3653 - gendx:master, r=phansch

Fix typos in clippy_lints/src/len_zero.rs

Some comments in the len_zero lint had typos.

5 years agoAuto merge of #3658 - detrumi:add-several-run-rustfix-annotations, r=phansch
bors [Mon, 14 Jan 2019 08:16:51 +0000 (08:16 +0000)]
Auto merge of #3658 - detrumi:add-several-run-rustfix-annotations, r=phansch

Add several run rustfix annotations

Adds `run-rustfix` to 18 of the tests from the tracking issue #3630.
Each test has its own commit, to make reviewing easier (hopefully this is easier to review than 18 separate PRs).

## Changes
- `cfg_attr_rustfmt`: Custom inner attributes are unstable. Let's disable the lint for inner attributes until [#54726](https://github.com/rust-lang/rust/issues/54726) stabilizes
- `collapsible_if`: unrelated cyclomatic_complexity warning that can be ignored
- `duration_subsec`: Simply needed `#![allow(dead_code)]`
- `excessive_precision`: Fixed by `#!allow(dead_code,unused_variables)`
- `explicit_write`: Fixed by `#![allow(unused_imports)]`
- `inconsistent_digit_grouping`: Avoid triggering `clippy::excessive_precision` lint
- `infallible_destructuring_match`: Fixed by `#![allow(dead_code, unreachable_code, unused_variables)]`
- `into_iter_on_ref`: Triggered unrelated `clippy::useless_vec` lint
- `large_digit_groups`: Avoid triggering `clippy::excessive_precision` lint
- `map_clone`: Fixed by `#![allow(clippy::iter_cloned_collect)]`
- `mem_replace`: Suggestion causes import to be unused, fixed by `#![allow(unused_imports)]`
- `precedence`: Allow some unrelated lints, and change out-of-range `0b1111_1111i8` literal
- `redundant_field_names`: Allow dead code, and remove stabilized feature toggles
- `replace_consts`: Fixed by `#![allow(unused_variables)]`
- `starts_ends_with`: Fixed by `#![allow(unused_must_use)]`
- `types`: Fixed by `#![allow(dead_code, unused_variables)]`
- `unit_arg`: Fixed by `#[allow(unused_must_use)]`
- `unnecessary_fold`: Fixed by adding type annotations and adding `#![allow(dead_code)]`

5 years agoAdd run-rustfix to unnecessary_fold
Wilco Kusee [Sun, 13 Jan 2019 19:03:22 +0000 (20:03 +0100)]
Add run-rustfix to unnecessary_fold

5 years agoAdd run-rustfix to unit_arg test
Wilco Kusee [Sun, 13 Jan 2019 18:59:00 +0000 (19:59 +0100)]
Add run-rustfix to unit_arg test

5 years agoAdd run-rustfix for types test
Wilco Kusee [Sun, 13 Jan 2019 18:57:19 +0000 (19:57 +0100)]
Add run-rustfix for types test

5 years agoAdd run-rustfix to starts_ends_with
Wilco Kusee [Sun, 13 Jan 2019 18:40:14 +0000 (19:40 +0100)]
Add run-rustfix to starts_ends_with

5 years agoAdd run-rustfix to replace_const test
Wilco Kusee [Sun, 13 Jan 2019 18:38:43 +0000 (19:38 +0100)]
Add run-rustfix to replace_const test

5 years agoAdd run-rustfix to redundant_field_names
Wilco Kusee [Sun, 13 Jan 2019 17:48:54 +0000 (18:48 +0100)]
Add run-rustfix to redundant_field_names

5 years agoMissing docs: don't require documenting Global Asm items.
roblabla [Sun, 13 Jan 2019 16:09:58 +0000 (16:09 +0000)]
Missing docs: don't require documenting Global Asm items.

global_asm! items cannot be documented, the lint still gets triggered
after adding documentation to the macro invocation. Furthermore, even
if we could add documentation to the AST node, rustdoc doesn't render
it anyways.

Playground example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5182df182f0ffbbab4c3107e43368ac3

5 years agoAdd run-rustfix for precedence test
Wilco Kusee [Sun, 13 Jan 2019 13:24:21 +0000 (14:24 +0100)]
Add run-rustfix for precedence test

5 years agoAdd run-rustfix to mem_replace test
Wilco Kusee [Sun, 13 Jan 2019 12:55:26 +0000 (13:55 +0100)]
Add run-rustfix to mem_replace test

5 years agoAdd run-rustfix to map_clone test
Wilco Kusee [Sun, 13 Jan 2019 12:10:25 +0000 (13:10 +0100)]
Add run-rustfix to map_clone test

5 years agoAdd run-rustfix to large_digit_groups
Wilco Kusee [Sun, 13 Jan 2019 11:57:13 +0000 (12:57 +0100)]
Add run-rustfix to large_digit_groups

5 years agoAdd run-rustfix to into_iter_on_ref
Wilco Kusee [Sun, 13 Jan 2019 11:52:51 +0000 (12:52 +0100)]
Add run-rustfix to into_iter_on_ref

5 years agoAdd run-rustfix to infallible_destructuring_match
Wilco Kusee [Sun, 13 Jan 2019 11:49:54 +0000 (12:49 +0100)]
Add run-rustfix to infallible_destructuring_match

5 years agoAdd rustfix to inconsistent_digit_grouping test
Wilco Kusee [Sun, 13 Jan 2019 11:43:10 +0000 (12:43 +0100)]
Add rustfix to inconsistent_digit_grouping test

5 years agoAdd run-rustfix to explicit_write test
Wilco Kusee [Sun, 13 Jan 2019 11:22:59 +0000 (12:22 +0100)]
Add run-rustfix to explicit_write test

5 years agoAuto merge of #3655 - manaskarekar:patch-1, r=flip1995
bors [Sun, 13 Jan 2019 11:21:24 +0000 (11:21 +0000)]
Auto merge of #3655 - manaskarekar:patch-1, r=flip1995

Update Readme for (arguably) better readability

Move final instruction to run clippy into a third step in the Readme so it's easier to spot at a quick glance.

5 years agoAdd run-rustfix to excessive_precision test
Wilco Kusee [Sun, 13 Jan 2019 11:09:30 +0000 (12:09 +0100)]
Add run-rustfix to excessive_precision test

5 years agoAdd run-rustfix to duration_subsec test
Wilco Kusee [Sun, 13 Jan 2019 11:06:28 +0000 (12:06 +0100)]
Add run-rustfix to duration_subsec test

5 years agoDisable deprecated_cfg_attr lint for inner attributes
Wilco Kusee [Sun, 13 Jan 2019 10:53:43 +0000 (11:53 +0100)]
Disable deprecated_cfg_attr lint for inner attributes

5 years agoAdd run-rustfix to collapsible_if test
Wilco Kusee [Sun, 13 Jan 2019 10:44:45 +0000 (11:44 +0100)]
Add run-rustfix to collapsible_if test

5 years agoUpdate Readme
Manas Karekar [Sun, 13 Jan 2019 01:24:52 +0000 (20:24 -0500)]
Update Readme

Move instruction to the correct step for installing Clippy.

5 years agoUpdate Readme for (arguably) better readability
Manas Karekar [Sun, 13 Jan 2019 00:42:36 +0000 (19:42 -0500)]
Update Readme for (arguably) better readability

Move final instruction to run clippy into a third step in the Readme so it's easier to spot at a quick glance.

5 years agoAuto merge of #3654 - matthiaskrgr:rustup, r=phansch
bors [Sat, 12 Jan 2019 15:33:08 +0000 (15:33 +0000)]
Auto merge of #3654 - matthiaskrgr:rustup, r=phansch

rustup: the features if_while_or_patterns has been stabilized

5 years agorustup: the features if_while_or_patterns has been stabilized
Matthias Krüger [Sat, 12 Jan 2019 15:11:17 +0000 (16:11 +0100)]
rustup: the features if_while_or_patterns has been stabilized

5 years agoAuto merge of #3646 - matthiaskrgr:travis, r=phansch
bors [Fri, 11 Jan 2019 01:11:34 +0000 (01:11 +0000)]
Auto merge of #3646 - matthiaskrgr:travis, r=phansch

readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com

5 years agoFix comments in clippy_lints/src/len_zero.rs
Guillaume Endignoux [Thu, 10 Jan 2019 21:48:40 +0000 (22:48 +0100)]
Fix comments in clippy_lints/src/len_zero.rs

5 years agoAuto merge of #3645 - phansch:remove_copyright_headers, r=oli-obk
bors [Wed, 9 Jan 2019 21:53:55 +0000 (21:53 +0000)]
Auto merge of #3645 - phansch:remove_copyright_headers, r=oli-obk

Remove all copyright license headers

Discussion previously happened in https://github.com/rust-lang/rust/pull/43498 and here: https://github.com/rust-lang/rust-clippy/pull/3642#issuecomment-452251727

5 years agorun ./util/dev update_lints
A.A.Abroskin [Wed, 9 Jan 2019 18:31:29 +0000 (21:31 +0300)]
run ./util/dev update_lints

5 years agoadd assert(true/false, some message) tests
A.A.Abroskin [Wed, 9 Jan 2019 18:30:47 +0000 (21:30 +0300)]
add assert(true/false, some message) tests

5 years agoMerge branch 'master' into add-lints-aseert-checks
Abroskin Alexander [Wed, 9 Jan 2019 10:49:40 +0000 (13:49 +0300)]
Merge branch 'master' into add-lints-aseert-checks

5 years agochange assert_checks to assertions_on_constants
A.A.Abroskin [Wed, 9 Jan 2019 10:38:38 +0000 (13:38 +0300)]
change assert_checks to assertions_on_constants

5 years agoreadme: update travis badge to reflect migration from travis-ci.org to travis-ci.com
Matthias Krüger [Tue, 8 Jan 2019 23:50:32 +0000 (00:50 +0100)]
readme: update travis badge to reflect migration from travis-ci.org to travis-ci.com

5 years agoRemove all copyright license headers
Philipp Hansch [Mon, 7 Jan 2019 21:33:18 +0000 (22:33 +0100)]
Remove all copyright license headers

Discussion previously happened in https://github.com/rust-lang/rust/pull/43498

5 years agoAuto merge of #3640 - detrumi:nested_use_self, r=flip1995
bors [Mon, 7 Jan 2019 18:54:28 +0000 (18:54 +0000)]
Auto merge of #3640 - detrumi:nested_use_self, r=flip1995

Restrict `use_self` on nested items

Fixes #3637
Fixes #3463

These changes make it so that nested items aren't visited any more by the `use_self` lint.

I think visiting nested items should be possible (so that it uses a different `item_path` for the nested item), but I'm not sure whether it's viable and what the best approach would be.
- Can `item_path` be changed to a new `Self` path before visiting the item, and then changing it back afterwards?
- Alternatively, could a new visitor be created, re-using `check_trait_method_impl_decl`?

5 years agoAuto merge of #3600 - xfix:cast-ref-to-mut, r=flip1995
bors [Mon, 7 Jan 2019 18:30:53 +0000 (18:30 +0000)]
Auto merge of #3600 - xfix:cast-ref-to-mut, r=flip1995

cast_ref_to_mut lint

I see this pattern way too often, and it's completely wrong. In fact, due to how common this incorrect pattern is, [the Rustonomicon specifically points this out](https://doc.rust-lang.org/nomicon/transmutes.html).

> - Transmuting an & to &mut is UB
>   - Transmuting an & to &mut is always UB
>   - No you can't do it
>   - No you're not special

This is my first lint.

5 years agoAuto merge of #3641 - hellow554:patch-1, r=flip1995
bors [Mon, 7 Jan 2019 17:50:48 +0000 (17:50 +0000)]
Auto merge of #3641 - hellow554:patch-1, r=flip1995

Add missing ` in default lint

5 years agoMove cast_ref_to_mut list to correctness group
Konrad Borowski [Mon, 7 Jan 2019 13:39:56 +0000 (14:39 +0100)]
Move cast_ref_to_mut list to correctness group

5 years agoRustftmt
Wilco Kusee [Mon, 7 Jan 2019 13:38:01 +0000 (14:38 +0100)]
Rustftmt

5 years agoDon't import ty::Ref in cast_ref_to_mut lint
Konrad Borowski [Sun, 30 Dec 2018 12:12:28 +0000 (13:12 +0100)]
Don't import ty::Ref in cast_ref_to_mut lint

5 years agoMove a hint to an error message in cast_ref_to_mut lint
Konrad Borowski [Sun, 30 Dec 2018 12:11:53 +0000 (13:11 +0100)]
Move a hint to an error message in cast_ref_to_mut lint

This matches mem::transmute::<&T, &mut T> lint in rustc.

5 years agoAdd a note to cast_ref_to_mut lint
Konrad Borowski [Sun, 30 Dec 2018 12:06:37 +0000 (13:06 +0100)]
Add a note to cast_ref_to_mut lint

5 years agoUse ty::Ref instead of ty::TyKind::Ref
Konrad Borowski [Sun, 30 Dec 2018 12:02:58 +0000 (13:02 +0100)]
Use ty::Ref instead of ty::TyKind::Ref

5 years agocast_ref_to_mut lint
Konrad Borowski [Sat, 29 Dec 2018 18:25:27 +0000 (19:25 +0100)]
cast_ref_to_mut lint

5 years agoAdd missing ` in default lint
Marcel Hellwig [Mon, 7 Jan 2019 13:32:32 +0000 (14:32 +0100)]
Add missing ` in default lint