Taiki Endo
8b0aa6a00b
default_trait_access: Fix wrong suggestion
2020-09-01 00:31:53 +09:00
Takayuki Nakata
001f9e45f2
Fix the wrong suggestion when using macro in collapsible_if
2020-09-01 00:05:53 +09:00
Hirochika Matsumoto
451ef78803
Use match_def_path
instead of match_qpath
2020-08-31 22:40:47 +09:00
bors
001c1c51d2
Auto merge of #5984 - ebroto:5693_const_assoc_fn, r=flip1995
...
or_fn_call: ignore nullary associated const fns
The fix in #5889 was missing associated functions.
changelog: Ignore also `const fn` methods in [`or_fun_call`]
Fixes #5693
2020-08-31 10:43:58 +00:00
Aaron Hill
fdc48fb90c
Fix clippy
2020-08-30 19:17:17 -04:00
Camelid
17b2ba5ded
Syntax-highlight single_char_push_str
lint
2020-08-30 11:29:17 -07:00
Dylan MacKenzie
1c5b0fbe53
Update dataflow analyses to use new interface
2020-08-30 11:15:25 -07:00
Vali Schneider
73a3288282
uncommented fn
2020-08-29 16:22:15 -07:00
Vali Schneider
a424a2c167
changed check_impl_item to check_fn and added a few more test cases
2020-08-29 16:17:53 -07:00
Kyle Huey
04912ca115
Formatting changes requested by ThibsG.
2020-08-29 15:33:54 -07:00
Kyle Huey
4972989b61
Add a lint for an async block/closure that yields a type that is itself awaitable.
...
This catches bugs of the form
tokio::spawn(async move {
let f = some_async_thing();
f // Oh no I forgot to await f so that work will never complete.
});
2020-08-29 15:33:54 -07:00
Hirochika Matsumoto
5b7590f841
Downgrade applicability of create_dir
2020-08-29 14:20:01 +09:00
Eduardo Broto
7a66e6502d
or_fn_call: ignore nullary associated const fns
2020-08-29 01:20:49 +02:00
flip1995
282c59820b
Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup
2020-08-28 18:43:25 +02:00
bors
3d0b0e66af
Auto merge of #5774 - ThibsG:FixNewRetNoSelf, r=ebroto
...
Fix FP in `new_ret_no_self`: trigger in trait def instead of impl block
Lint in trait def instead of impl block.
Fixes : #5435
changelog: none
2020-08-28 11:54:07 +00:00
Hirochika Matsumoto
eebd248365
Fix errors
2020-08-28 19:56:19 +09:00
Hirochika Matsumoto
34e302e67c
Fix clippy error
2020-08-28 19:35:04 +09:00
Hirochika Matsumoto
607905d126
Add STD_FS_CREATE_DIR into paths
2020-08-28 18:53:15 +09:00
Hirochika Matsumoto
5574182b4d
Add a new lint to prevent create_dir
from being used
2020-08-28 18:45:28 +09:00
Thibaud
73b1ee1a61
Update clippy_lints/src/methods/mod.rs
...
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-28 09:33:05 +02:00
Thibaud
ffaadae8e4
Update clippy_lints/src/utils/mod.rs
...
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-28 09:31:29 +02:00
Thibaud
e8be047c5b
Update clippy_lints/src/utils/mod.rs
...
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-28 09:31:12 +02:00
Vali Schneider
b006522393
added lint for todo and removed option
2020-08-27 16:55:23 -07:00
bors
07c5e9edb5
Auto merge of #5971 - giraffate:fix_fp_in_to_string_in_display, r=ebroto
...
Fix FP in `to_string_in_display`
Don't emit a lint when `.to_string()` on anything that is not `self`
Fix #5967
changelog: Fix FP in `to_string_in_display` when calling `.to_string()` on anything that is not `self`
2020-08-27 23:26:52 +00:00
Vali Schneider
8462cce960
edited documentation
2020-08-27 16:22:37 -07:00
Vali Schneider
ceab1a9167
removed unnecessary comment
2020-08-27 16:19:24 -07:00
Vali Schneider
459969f88f
added restriction lint that prohibits the usage of unimplemented, unreachable or panic in a function of type result or option
2020-08-27 16:18:05 -07:00
Tim Nielens
f3ccbef2af
unit-arg - pr comments
2020-08-27 19:36:28 +02:00
ThibsG
504612622f
Merge logic of looking for Self
type
2020-08-27 18:31:31 +02:00
ThibsG
3cb75c2e5c
Remove expansion restriction + fix doc and tests naming
2020-08-27 18:25:38 +02:00
ThibsG
2a3ee5fa85
Fix FP in new_ret_no_self
: trigger in trait def instead of impl block
2020-08-27 18:25:38 +02:00
Takayuki Nakata
04bff17668
Fix FP in to_string_in_display
...
Don't emit a lint when `.to_string()` on anything that is not `self`
2020-08-27 23:37:47 +09:00
Jane Lusby
91024f1fde
Add new lint to prevent usage of unwrap in fns that return result
2020-08-26 16:31:49 -07:00
rail
edc05da57d
Fix the wrong use of snippet_with_applicability
...
This includes a workaround of the issue #5822 ,
the cause of this little mistake.
2020-08-27 10:24:16 +12:00
bors
64c4bb0d2b
Auto merge of #5966 - 1c3t3a:1c3t3a-dev-5819-fix, r=Manishearth
...
Corrects the float_equality_without_abs lint
Fixes an issue in the `float_equality_without_abs` lint. The lint suggestion was configured in a way that it lints the whole error and not just the subtraction part. In the current configuration the lint would suggest to change the expression in a wrong way, e.g.
```rust
let _ = (a - b) < f32::EPSILON; // before
let _ = (a - b).abs(); // after
```
This was dicovered by @flip1995. (See discussion of PR #5952 ).
Also the suggestion is now formatted via `utils::sugg`.
changelog: none
2020-08-26 18:15:42 +00:00
Bastian
2d853148d7
Changed the location of the suggestion as well as the way the suggestion is assembled
2020-08-26 16:39:30 +02:00
bors
894581b872
Auto merge of #5946 - mikerite:fix-5729, r=flip1995
...
Fix `let_and_return` bad suggestion
Add a cast to the suggestion when the return expression has adjustments.
These adjustments are lost when the suggestion is applied.
This is similar to the problem in issue #4437 .
Closes #5729
changelog: Fix `let_and_return` bad suggestion
2020-08-26 12:01:32 +00:00
bors
9ef44799bf
Auto merge of #5949 - rail-rain:fix_fp_borrow_interior_mutable_const, r=oli-obk
...
Fix fp in `borrow_interior_mutable_const`
fixes #5796
changelog: fix false positive in `borrow_interior_mutable_const` when referencing a field behind a pointer.
2020-08-26 11:06:37 +00:00
Hirochika Matsumoto
9d18c24b56
Fix typo
2020-08-26 16:03:35 +09:00
bors
ad7a03cbaa
Auto merge of #5951 - ThibsG:FixMacroCloneOnRefPtr2076, r=ebroto
...
Fix incorrect suggestion when `clone_on_ref_ptr` is triggered in macros
In the lint `clone_on_ref_ptr`, if the `span` is in a macro, don't expand it for suggestion.
Fixes : #2076
changelog: none
r? @ebroto
2020-08-25 21:48:19 +00:00
Thibaud
370fc45a0a
Update clippy_lints/src/methods/mod.rs
...
Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
2020-08-25 22:20:35 +02:00
Scott McMurray
3b1e5d6ff7
Re-enable len_zero for ranges now that is_empty
is stable on them
2020-08-25 12:17:03 -07:00
bors
f9015592f3
Auto merge of #5952 - 1c3t3a:1c3t3a-dev-5819, r=Manishearth
...
Added a lint which corrects expressions like (a - b) < f32::EPSILON, according to #5819
Fixes #5819
changelog: none
2020-08-25 16:54:48 +00:00
Bastian
179df0bd15
Added F32::EPSILON and F64::EPSILON to paths.rs
2020-08-25 13:41:39 +02:00
bors
64b53f3877
Auto merge of #5920 - giraffate:fix_fp_for_redundant_closure_call, r=mikerite
...
Fix FP for `redundant_closure_call`
Fix #5916
changelog: Fix FP for `redundant_closure_call` when called in function body
2020-08-25 03:29:59 +00:00
Matthias Krüger
e9964f2e8a
stable_sort_primitive: print the type that is being sorted in the lint message
2020-08-24 20:06:43 +02:00
Bastian
680c68153b
Added a lint which corrects expressions like (a - b) < f32::EPSILON
2020-08-24 16:31:51 +02:00
ThibsG
3d820f71fe
Fix incorrect suggestion when clone_on_ref_ptr
is triggered in macros
2020-08-24 14:05:49 +02:00
Takayuki Nakata
9fe0ac36a5
Avoid period in lint message according to convention
2020-08-24 10:11:53 +09:00
Takayuki Nakata
b2c2266792
Fix FP for redundant_closure_call
...
Visit the nested things like function body when checking closure call.
2020-08-24 09:43:16 +09:00