]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agosimplify the code
rail [Fri, 2 Oct 2020 01:04:46 +0000 (14:04 +1300)]
simplify the code

3 years agodocument `MinifyingSugg` and `Offset`
rail [Fri, 2 Oct 2020 00:30:50 +0000 (13:30 +1300)]
document `MinifyingSugg` and `Offset`

...and also swap their position

3 years agosplit up the `manual_memcpy` test
rail [Sun, 27 Sep 2020 13:43:45 +0000 (02:43 +1300)]
split up the `manual_memcpy` test

3 years agoUse the `From` trait to make `MinifyingSugg`
rail [Sun, 27 Sep 2020 13:27:55 +0000 (02:27 +1300)]
Use the `From` trait to make `MinifyingSugg`

3 years agoUse the spans of the entire `for` loops for suggestions
rail [Sun, 27 Sep 2020 03:38:41 +0000 (16:38 +1300)]
Use the spans of the entire `for` loops for suggestions

3 years agoPrevent unnecessary lints from triggering
rail [Sun, 27 Sep 2020 01:52:06 +0000 (14:52 +1300)]
Prevent unnecessary lints from triggering

3 years agoReplace `snippet_opt` + `unwrap_or_else` with `snippet`
rail [Sun, 27 Sep 2020 01:19:43 +0000 (14:19 +1300)]
Replace `snippet_opt` + `unwrap_or_else` with `snippet`

3 years agoReflect the changes that has been made and fmt
rail [Sun, 16 Aug 2020 02:01:56 +0000 (14:01 +1200)]
Reflect the changes that has been made and fmt

3 years agouse `#[derive]` instead of the manual implementation
rail [Wed, 1 Jul 2020 00:22:16 +0000 (12:22 +1200)]
use `#[derive]` instead of the manual implementation

3 years agomake clippy happy (`needless_pass_by_value`, `filter_map` and `find_map`)
rail [Sat, 27 Jun 2020 06:56:38 +0000 (18:56 +1200)]
make clippy happy (`needless_pass_by_value`, `filter_map` and `find_map`)

3 years agoUse operator overloading instead of direct calls of `make_binop`
rail [Wed, 24 Jun 2020 00:41:46 +0000 (12:41 +1200)]
Use operator overloading instead of direct calls of `make_binop`

3 years agofix the multiple counters test
rail [Tue, 23 Jun 2020 23:33:49 +0000 (11:33 +1200)]
fix the multiple counters test

3 years agofmt
rail [Tue, 23 Jun 2020 10:37:36 +0000 (22:37 +1200)]
fmt

3 years agomake use of macros in operator overloading
rail [Tue, 23 Jun 2020 06:51:05 +0000 (18:51 +1200)]
make use of macros in operator overloading

3 years agoAdd tests for bitwise operations
rail [Thu, 18 Jun 2020 00:31:13 +0000 (12:31 +1200)]
Add tests for bitwise operations

3 years agoUpdate `manual_memcpy.stderr` to reflect additional parentheses
rail [Wed, 17 Jun 2020 22:48:44 +0000 (10:48 +1200)]
Update `manual_memcpy.stderr` to reflect additional parentheses

3 years agoAdd the tests for `manual_memcpy` with loop counters
rail [Wed, 10 Jun 2020 23:19:44 +0000 (11:19 +1200)]
Add the tests for `manual_memcpy` with loop counters

3 years agoRename `get_offset` and its private items
rail [Wed, 17 Jun 2020 22:24:12 +0000 (10:24 +1200)]
Rename `get_offset` and its private items

3 years agofmt
rail [Thu, 11 Jun 2020 00:11:06 +0000 (12:11 +1200)]
fmt

3 years agoImplement building the `manual_memcpy` sugggestion with loop counters
rail [Wed, 10 Jun 2020 23:06:13 +0000 (11:06 +1200)]
Implement building the `manual_memcpy` sugggestion with loop counters

3 years agoImplement detecting `manual_memcpy` with loop counters
rail [Wed, 10 Jun 2020 03:58:12 +0000 (15:58 +1200)]
Implement detecting `manual_memcpy` with loop counters

3 years agoIntroduce Start and StartKind
rail [Wed, 10 Jun 2020 03:51:23 +0000 (15:51 +1200)]
Introduce Start and StartKind

3 years agoRename a struct and variables
rail [Wed, 10 Jun 2020 03:32:24 +0000 (15:32 +1200)]
Rename a struct and variables

3 years agoRename variables
rail [Wed, 10 Jun 2020 03:15:20 +0000 (15:15 +1200)]
Rename variables

3 years agoGeneralise `InitializeVisitor`
rail [Wed, 10 Jun 2020 03:14:57 +0000 (15:14 +1200)]
Generalise `InitializeVisitor`

3 years agoSplit VarState
rail [Wed, 10 Jun 2020 03:05:51 +0000 (15:05 +1200)]
Split VarState

3 years agoadd concinient methods to Increment/InitializeVisitor
rail [Wed, 10 Jun 2020 02:48:26 +0000 (14:48 +1200)]
add concinient methods to Increment/InitializeVisitor

3 years agoCheck if it's after the loop earlier
rail [Wed, 10 Jun 2020 02:41:09 +0000 (14:41 +1200)]
Check if it's after the loop earlier

3 years agoUse else blocks instead of return statements in Increment/InitializeVisitor
rail [Wed, 10 Jun 2020 02:25:06 +0000 (14:25 +1200)]
Use else blocks instead of return statements in Increment/InitializeVisitor

3 years agoUse if_chain in Increment/InitializeVisitor
rail [Wed, 10 Jun 2020 02:21:58 +0000 (14:21 +1200)]
Use if_chain in Increment/InitializeVisitor

3 years agoAuto merge of #6077 - ebroto:revert_or_fun_call_const, r=matthiaskrgr
bors [Thu, 24 Sep 2020 14:14:53 +0000 (14:14 +0000)]
Auto merge of #6077 - ebroto:revert_or_fun_call_const, r=matthiaskrgr

Revert: or_fun_call should lint calls to `const fn`s with no args

The changes in #5889 and #5984 were done under the incorrect assumption that a `const fn` with no args was guaranteed to be evaluated at compile time.  A `const fn` is only guaranteed to be evaluated at compile time if it's inside a const context (the initializer of a `const` or a `static`).

See this [zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Common.20misconception.3A.20.60const.20fn.60.20and.20its.20effect.20on.20codegen/near/208059113) for more details on this common misconception.

Given that none of the linted methods by `or_fun_call` can be called in const contexts, the lint should make no exceptions.

changelog: [`or_fun_call`] lints again calls to `const fn` with no args

3 years agoAuto merge of #6076 - rail-rain:fix_fp_explicit_counter_loop, r=matthiaskrgr
bors [Thu, 24 Sep 2020 13:45:24 +0000 (13:45 +0000)]
Auto merge of #6076 - rail-rain:fix_fp_explicit_counter_loop, r=matthiaskrgr

Fix a FP in `explicit_counter_loop`

Fixes #4677 and #6074

Fix a false positive in `explicit_counter_loop` where the loop counter is used after incremented, adjust the test so that counters are incremented at the end of the loop and add the test for this false positive.

---

changelog: Fix a false positive in `explicit_counter_loop` where the loop counter is used after incremented

3 years agoAuto merge of #6044 - rschoon:rc-buffer, r=yaahc
bors [Wed, 23 Sep 2020 18:35:08 +0000 (18:35 +0000)]
Auto merge of #6044 - rschoon:rc-buffer, r=yaahc

Add `rc_buffer` lint for checking Rc<String> and friends

Fixes #2623

This is a bit different from the original PR attempting to implement this type of lint.   Rather than linting against converting into the unwanted types, this PR lints against declaring the unwanted type in a struct or function definition.

I'm reasonably happy with what I have here, although I used the fully qualified type names for the Path and OsString suggestions, and I'm not sure if I should have just used the short versions instead, even if they might not have been declared via use.

Also, I don't know if "buffer type" is the best way to put it or not.  Alternatively I could call it a "growable type" or "growable buffer type", but I was thinking of PathBuf when I started making the lint.

changelog: Add `rc_buffer` lint

3 years agoSatisfy rc_buffer lint in Constant::Binary byte string by copying data
Robin Schoonover [Wed, 23 Sep 2020 02:34:38 +0000 (20:34 -0600)]
Satisfy rc_buffer lint in Constant::Binary byte string by copying data

We can avoid the data copy again by fixing rustc_ast::ast::LitKind
later.

3 years agoRevert "Avoid or_fun_call for const_fn with no args"
Eduardo Broto [Tue, 22 Sep 2020 22:39:00 +0000 (00:39 +0200)]
Revert "Avoid or_fun_call for const_fn with no args"

This reverts commit 5d66bd7bb3fd701d70ec11217e3f89fabe5cb0a7.

3 years agoRevert "or_fn_call: ignore nullary associated const fns"
Eduardo Broto [Tue, 22 Sep 2020 22:34:56 +0000 (00:34 +0200)]
Revert "or_fn_call: ignore nullary associated const fns"

This reverts commit 7a66e6502dc3c7085b3f4078c01d4957d96175ed.

3 years agoFix a FP in `explicit_counter_loop`
rail [Wed, 10 Jun 2020 02:05:32 +0000 (14:05 +1200)]
Fix a FP in `explicit_counter_loop`

Fix a false positive in `explicit_counter_loop` where the loop counter is used after incremented,
adjust the test so that counters are incremented at the end of the loop
and add the test for this false positive.

3 years agoAuto merge of #6069 - alex-700:redundant-pattern-matching-in-macro, r=Manishearth
bors [Tue, 22 Sep 2020 16:01:39 +0000 (16:01 +0000)]
Auto merge of #6069 - alex-700:redundant-pattern-matching-in-macro, r=Manishearth

Forbid redundant_pattern_matching triggering in macros

fixes #6065

changelog: forbid redundant_pattern_matching triggering in macros

3 years agoForbid redundant_pattern_matching triggering in macros
Aleksei Latyshev [Sun, 20 Sep 2020 09:38:23 +0000 (12:38 +0300)]
Forbid redundant_pattern_matching triggering in macros

- remove ice-2636 test

3 years agoAuto merge of #6071 - ebroto:rustup, r=ebroto
bors [Mon, 21 Sep 2020 13:43:01 +0000 (13:43 +0000)]
Auto merge of #6071 - ebroto:rustup, r=ebroto

Rustup

r? `@ghost`

changelog: none

3 years agoSplit redundant_pattern_matching tests
Eduardo Broto [Mon, 21 Sep 2020 13:32:26 +0000 (15:32 +0200)]
Split redundant_pattern_matching tests

This is to avoid the 200 lines stderr file limit

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
Eduardo Broto [Mon, 21 Sep 2020 13:11:24 +0000 (15:11 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoRemove `can_suggest` from Clippy.
Christiaan Dirkx [Sun, 20 Sep 2020 22:00:33 +0000 (00:00 +0200)]
Remove `can_suggest` from Clippy.

Removes `can_suggest` from as it is no longer used.
Reverts rust-clippy#5724.

3 years agoUpdate Clippy testcases
Christiaan Dirkx [Sun, 20 Sep 2020 21:59:34 +0000 (23:59 +0200)]
Update Clippy testcases

Update the test `redundant_pattern_matching`: check if `is_some` and `is_none` are suggested within const contexts.

3 years agoAuto merge of #76136 - CDirkx:const-result, r=dtolnay
bors [Sun, 20 Sep 2020 13:07:11 +0000 (13:07 +0000)]
Auto merge of #76136 - CDirkx:const-result, r=dtolnay

Stabilize some Result methods as const

Stabilize the following methods of Result as const:
 - `is_ok`
 - `is_err`
 - `as_ref`

A test is also included, analogous to the test for `const_option`.

These methods are currently const under the unstable feature `const_result` (tracking issue: #67520).
I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](https://github.com/rust-lang/rust/pull/75463) and [PR#76135](https://github.com/rust-lang/rust/pull/76135).

Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature.

Related: #76225

3 years agoUpdate src/tools/clippy/clippy_lints/src/matches.rs
CDirkx [Sun, 20 Sep 2020 10:21:23 +0000 (12:21 +0200)]
Update src/tools/clippy/clippy_lints/src/matches.rs

Co-authored-by: Ralf Jung <post@ralfj.de>
3 years agoRemove `can_suggest` check for `is_ok` and `is_err`.
Christiaan Dirkx [Sun, 20 Sep 2020 08:46:30 +0000 (10:46 +0200)]
Remove `can_suggest` check for `is_ok` and `is_err`.

`is_ok` and `is_err` are stabilized as const and can thus always be suggested.

3 years agoUpdate Clippy testcases
Christiaan Dirkx [Sun, 20 Sep 2020 01:32:36 +0000 (03:32 +0200)]
Update Clippy testcases

Update the test `redundant_pattern_matching`: check if `is_ok` and `is_err` are suggested within const contexts.
Also removes the `redundant_pattern_matching_const_result` test, as it is no longer needed.

3 years agoAuto merge of #6046 - rail-rain:change_criteria_non_copy_const, r=flip1995
bors [Fri, 18 Sep 2020 14:34:04 +0000 (14:34 +0000)]
Auto merge of #6046 - rail-rain:change_criteria_non_copy_const, r=flip1995

Change the criteria of `interior_mutable_const`

This implements my suggestion [here](https://github.com/rust-lang/rust-clippy/issues/5050#issuecomment-680310889), and so hopefully fixes #5050.

* stop linting associated types and generic type parameters
* start linting ones in trait impls
  whose corresponding definitions in the traits are generic
* remove the `is_copy` check
  as presumably the only purpose of it is to allow
  generics with `Copy` bounds as `Freeze` is internal
  and generics are no longer linted
* remove the term 'copy' from the tests
  as being `Copy` no longer have meaning

---

changelog: Change the criteria of `declare_interior_mutable_const` and `borrow_interior_mutable_const` to narrow the lints to only lint things that defenitly is a interior mutable type, not potentially.

3 years agoadd `WRAPPED_SELF: Option<Self>` in the test
rail [Thu, 17 Sep 2020 09:14:14 +0000 (21:14 +1200)]
add `WRAPPED_SELF: Option<Self>` in the test

3 years agorewrite the test and fix a minor fp
rail [Thu, 17 Sep 2020 07:37:42 +0000 (19:37 +1200)]
rewrite the test and fix a minor fp

* rewrite the test for `declare_interior_mutable_const from scratch`

* fix a minor false positive where `Cell<"const T>` gets linted twice

3 years agoChange the criteria of `interior_mutable_const`
rail [Tue, 25 Aug 2020 03:13:40 +0000 (15:13 +1200)]
Change the criteria of `interior_mutable_const`

* stop linting associated types and generic type parameters
* start linting ones in trait impls
  whose corresponding definitions in the traits are generic
* remove the `is_copy` check
  as presumably the only purpose of it is to allow
  generics with `Copy` bounds as `Freeze` is internal
  and generics are no longer linted
* remove the term 'copy' from the tests
  as being `Copy` no longer have meaning

3 years agoMove rc_buffer lint into perf category
Robin Schoonover [Wed, 16 Sep 2020 23:19:35 +0000 (17:19 -0600)]
Move rc_buffer lint into perf category

3 years agoAuto merge of #6034 - rail-rain:fix_fp_in_indexing_slicing, r=flip1995
bors [Wed, 16 Sep 2020 22:45:36 +0000 (22:45 +0000)]
Auto merge of #6034 - rail-rain:fix_fp_in_indexing_slicing, r=flip1995

Treat refs to arrays the same as owned arrays in `indexing_slicing` and `out_of_bounds_indexing`

Fixes #6021

...and remove `walk_ptrs_ty` in favour of `peel_refs`, which came in 2019.

---

changelog: Fix a false positive in `indexing_slicing` and `out_of_bounds_indexing` where references to arrays weren't treated as arrays.

3 years agoreplace `walk_ptrs_ty` with `peel_refs`
rail [Fri, 11 Sep 2020 03:06:49 +0000 (15:06 +1200)]
replace `walk_ptrs_ty` with `peel_refs`

3 years agofix a FP in `indexing_slicing`
rail [Fri, 11 Sep 2020 02:41:54 +0000 (14:41 +1200)]
fix a FP in `indexing_slicing`

treat refs to arrays the same as arrays
in `indexing_slicing` and `out_of_bounds_indexing`

3 years agoAuto merge of #5937 - montrivo:option_if_let_else, r=flip1995
bors [Wed, 16 Sep 2020 19:36:49 +0000 (19:36 +0000)]
Auto merge of #5937 - montrivo:option_if_let_else, r=flip1995

option_if_let_else - distinguish pure from impure else expressions

Addresses partially #5821.

changelog: improve the lint `option_if_let_else`. Suggest `map_or` or `map_or_else` based on the else expression purity.

3 years agoAuto merge of #6025 - thomcc:compare_exchange_atomics, r=flip1995
bors [Wed, 16 Sep 2020 18:33:38 +0000 (18:33 +0000)]
Auto merge of #6025 - thomcc:compare_exchange_atomics, r=flip1995

Extend invalid_atomic_ordering for compare_exchange{,_weak} and fetch_update

changelog: The invalid_atomic_ordering lint can now detect misuse of `compare_exchange`, `compare_exchange_weak`, and `fetch_update`.

---

I was surprised not to find an issue or existing support here, since these are the functions which are always hardest to get the ordering right on for me (as the allowed orderings for `fail` depend on the `success` parameter).

I believe this lint now covers all atomic methods which care about their ordering now, but I could be wrong.

Hopefully I didn't forget to do anything for the PR!

3 years agoAuto merge of #6038 - mikerite:lint-5734, r=matthiaskrgr
bors [Wed, 16 Sep 2020 18:13:36 +0000 (18:13 +0000)]
Auto merge of #6038 - mikerite:lint-5734, r=matthiaskrgr

Add `manual-strip` lint

Add `manual-strip` lint.

changelog: Add `manual-strip` lint

3 years agooption_if_let_else - change misleading test file section
Tim Nielens [Wed, 16 Sep 2020 17:59:51 +0000 (19:59 +0200)]
option_if_let_else - change misleading test file section

3 years agoAuto merge of #6048 - giraffate:add_note_to_shadow_unrelated, r=matthiaskrgr
bors [Wed, 16 Sep 2020 17:52:40 +0000 (17:52 +0000)]
Auto merge of #6048 - giraffate:add_note_to_shadow_unrelated, r=matthiaskrgr

Add note to `shadow_unrelated`

Fix #5455.

This lint can be disabled at function level.

changelog: none

3 years agoAuto merge of #6042 - euclio:println-empty, r=flip1995
bors [Wed, 16 Sep 2020 17:16:07 +0000 (17:16 +0000)]
Auto merge of #6042 - euclio:println-empty, r=flip1995

{print,write}-with-newline: do not suggest empty format string

changelog: do not suggest empty format strings in `print-with-newline` and `write-with-newline`

3 years agoAuto merge of #6057 - giraffate:update_doc_about_moving_to_zulip, r=flip1995
bors [Wed, 16 Sep 2020 15:39:39 +0000 (15:39 +0000)]
Auto merge of #6057 - giraffate:update_doc_about_moving_to_zulip, r=flip1995

Update documentation about moving from Discord to Zulip

Moving from Discord to Zulip was discussed at https://github.com/rust-lang/rust-clippy/issues/5943 and new stream in Zulip was created at https://github.com/rust-lang/rust-clippy/issues/5943#issuecomment-691984366.

changelog: none

3 years ago{print,write}-with-newline: do not suggest empty format string
Andy Russell [Mon, 14 Sep 2020 18:58:39 +0000 (14:58 -0400)]
{print,write}-with-newline: do not suggest empty format string

3 years agoUpdate documentation about moving from Discord to Zulip
Takayuki Nakata [Wed, 16 Sep 2020 15:06:43 +0000 (00:06 +0900)]
Update documentation about moving from Discord to Zulip

3 years agoAuto merge of #6056 - rust-lang:flip1995/triagebot, r=flip1995
bors [Wed, 16 Sep 2020 14:40:43 +0000 (14:40 +0000)]
Auto merge of #6056 - rust-lang:flip1995/triagebot, r=flip1995

Add S-* label modifier to triagebot

changelog: none

3 years agoAdd S-* label modifier to triagebot
Philipp Krones [Wed, 16 Sep 2020 14:38:58 +0000 (16:38 +0200)]
Add S-* label modifier to triagebot

3 years agoAuto merge of #6055 - lzutao:bump-cmark, r=phansch
bors [Wed, 16 Sep 2020 05:26:30 +0000 (05:26 +0000)]
Auto merge of #6055 - lzutao:bump-cmark, r=phansch

Bump pulldown-cmark v0.8

Closes  #6054

changelog: none

3 years agobump pulldown-cmark v0.8
Lzu Tao [Wed, 16 Sep 2020 05:09:57 +0000 (12:09 +0700)]
bump pulldown-cmark v0.8

3 years agoExtend testing of rc_buffer lint
Robin Schoonover [Wed, 16 Sep 2020 03:10:50 +0000 (21:10 -0600)]
Extend testing of rc_buffer lint

3 years agooption_if_let_else - distinguish pure from impure else expressions
Tim Nielens [Fri, 21 Aug 2020 22:43:04 +0000 (00:43 +0200)]
option_if_let_else - distinguish pure from impure else expressions

3 years agomanual-strip: Fix formatting
Michael Wright [Tue, 15 Sep 2020 19:25:03 +0000 (21:25 +0200)]
manual-strip: Fix formatting

3 years agomanual-strip: Add additional test
Michael Wright [Tue, 15 Sep 2020 19:30:01 +0000 (21:30 +0200)]
manual-strip: Add additional test

3 years agoMerge branch 'master' into lint-5734
Michael Wright [Tue, 15 Sep 2020 19:21:35 +0000 (21:21 +0200)]
Merge branch 'master' into lint-5734

3 years agoAuto merge of #6043 - HaramanJohal:margin_of_error, r=matthiaskrgr
bors [Tue, 15 Sep 2020 17:17:31 +0000 (17:17 +0000)]
Auto merge of #6043 - HaramanJohal:margin_of_error, r=matthiaskrgr

clarify margin of error in wording of float comparison operator lint messages

fixes #6040

changelog: change wording of float comparison operator to make margin of error less ambiguous

3 years agoAuto merge of #6049 - flip1995:rustup, r=flip1995
bors [Tue, 15 Sep 2020 16:46:41 +0000 (16:46 +0000)]
Auto merge of #6049 - flip1995:rustup, r=flip1995

Fix clippy hard-code slice::Iter path

r? `@ghost`

changelog: none

3 years agoupdate lint docs
Haraman Johal [Tue, 15 Sep 2020 16:29:41 +0000 (17:29 +0100)]
update lint docs

3 years agoAdd note to `shadow_unrelated`
Takayuki Nakata [Tue, 15 Sep 2020 15:25:00 +0000 (00:25 +0900)]
Add note to `shadow_unrelated`

This lint can be disabled at function level.

3 years agoAuto merge of #6045 - giraffate:remove_extra_blank_line, r=flip1995
bors [Tue, 15 Sep 2020 12:26:25 +0000 (12:26 +0000)]
Auto merge of #6045 - giraffate:remove_extra_blank_line, r=flip1995

Remove an extra blank line in `shadow_same`

It seems to be an extra blank line in doc example.

changelog: none

<img width="1143" alt="スクリーンショット 2020-09-15 8 50 30" src="https://user-images.githubusercontent.com/17407489/93149409-369df080-f731-11ea-9a39-d8bbc72b61ee.png">

3 years agoFix clippy hard-code slice::Iter path
Lzu Tao [Tue, 15 Sep 2020 10:21:40 +0000 (10:21 +0000)]
Fix clippy hard-code slice::Iter path

3 years agoAuto merge of #6013 - ebroto:diagnostic_item_restriction, r=flip1995
bors [Tue, 15 Sep 2020 09:30:54 +0000 (09:30 +0000)]
Auto merge of #6013 - ebroto:diagnostic_item_restriction, r=flip1995

Internal lint: suggest `is_type_diagnostic_item` over `match_type` where applicable

changelog: none

3 years agoFix usage of backquotes in suggestion
Eduardo Broto [Tue, 15 Sep 2020 08:31:50 +0000 (10:31 +0200)]
Fix usage of backquotes in suggestion

3 years agoMisc doc updates
Eduardo Broto [Sun, 6 Sep 2020 21:57:24 +0000 (23:57 +0200)]
Misc doc updates

3 years agoFix dogfood after MatchTypeOnDiagItem
Eduardo Broto [Sun, 6 Sep 2020 21:48:04 +0000 (23:48 +0200)]
Fix dogfood after MatchTypeOnDiagItem

3 years agoAdd internal lint MatchTypeOnDiagItem
Eduardo Broto [Sun, 6 Sep 2020 21:32:48 +0000 (23:32 +0200)]
Add internal lint MatchTypeOnDiagItem

3 years agoRemove an extra blank line in `shadow_same`
Takayuki Nakata [Mon, 14 Sep 2020 23:51:52 +0000 (08:51 +0900)]
Remove an extra blank line in `shadow_same`

3 years agoclarify margin of error in wording of float comparison operator lint messages
Haraman Johal [Mon, 14 Sep 2020 23:20:31 +0000 (00:20 +0100)]
clarify margin of error in wording of float comparison operator lint messages

3 years agoApply rc_buffer lint to Arc<T>
Robin Schoonover [Mon, 14 Sep 2020 04:17:10 +0000 (22:17 -0600)]
Apply rc_buffer lint to Arc<T>

3 years agoAdd rc_buffer lint for Rc<String> and other buffer types
Robin Schoonover [Mon, 14 Sep 2020 03:52:25 +0000 (21:52 -0600)]
Add rc_buffer lint for Rc<String> and other buffer types

3 years agoAuto merge of #5998 - deg4uss3r:master, r=yaahc
bors [Mon, 14 Sep 2020 19:56:47 +0000 (19:56 +0000)]
Auto merge of #5998 - deg4uss3r:master, r=yaahc

Add map_err_ignore lint

In a large code base a lot of times errors are ignored by using something like:

```rust
foo.map_err(|_| Some::Enum)?;
```

This drops the original error in favor of a enum that will not have the original error's context. This lint helps catch throwing away the original error in favor of an enum without its context.

---

*Please keep the line below*
changelog: Added map_err_ignore lint

3 years agoFix `manual-strip` dogfood errors
Michael Wright [Mon, 14 Sep 2020 04:11:35 +0000 (06:11 +0200)]
Fix `manual-strip` dogfood errors

3 years agoNew lint: `manual-strip`
Michael Wright [Mon, 14 Sep 2020 04:11:35 +0000 (06:11 +0200)]
New lint: `manual-strip`

Add a new lint, `manual-strip`, that suggests using the `str::strip_prefix`
and `str::strip_suffix` methods introduced in Rust 1.45 when the same
functionality is performed 'manually'.

Closes #5734

3 years agoAuto merge of #6035 - matthiaskrgr:try_into_show_type, r=flip1995
bors [Sun, 13 Sep 2020 18:57:55 +0000 (18:57 +0000)]
Auto merge of #6035 - matthiaskrgr:try_into_show_type, r=flip1995

useless_conversion: show type in error message.

changelog: useless_conversion: show type in error message.

3 years agoMerge pull request #6036 from giraffate/update_verbose_bit_mask_to_pedantic
Manish Goregaokar [Sun, 13 Sep 2020 16:24:23 +0000 (09:24 -0700)]
Merge pull request #6036 from giraffate/update_verbose_bit_mask_to_pedantic

Downgrade `verbose_bit_mask` to pedantic

3 years agoDowngrade `verbose_bit_mask` to pedantic
Takayuki Nakata [Sun, 13 Sep 2020 14:23:16 +0000 (23:23 +0900)]
Downgrade `verbose_bit_mask` to pedantic

3 years agouseless_conversion: show type in error message.
Matthias Krüger [Sun, 13 Sep 2020 10:42:14 +0000 (12:42 +0200)]
useless_conversion: show type in error message.

changelog: useless_conversion: show type in error message.

3 years agoAuto merge of #6032 - matthiaskrgr:move_consume, r=flip1995
bors [Sun, 13 Sep 2020 08:10:12 +0000 (08:10 +0000)]
Auto merge of #6032 - matthiaskrgr:move_consume, r=flip1995

into_iter_on_ref: rephrase lint message: will not move the x -> will not consume the x

imo that's a bit clearer.

changelog: none

3 years agoAuto merge of #6030 - rail-rain:fix_use_snippet_in_types, r=matthiaskrgr
bors [Sun, 13 Sep 2020 07:37:40 +0000 (07:37 +0000)]
Auto merge of #6030 - rail-rain:fix_use_snippet_in_types, r=matthiaskrgr

fix some use of `snippet` in `types.rs`

changelog: none

3 years agoAuto merge of #6033 - flip1995:rustup, r=flip1995
bors [Sun, 13 Sep 2020 06:01:21 +0000 (06:01 +0000)]
Auto merge of #6033 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Sat, 12 Sep 2020 13:58:41 +0000 (15:58 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup