Michael Wright
d1f0f04a48
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
2020-09-14 06:11:35 +02:00
bors
0ab75c37b6
Auto merge of #5977 - xvschneider:AddLintPanicInResult, r=matthiaskrgr
...
Add lint panic in result
### Change
Adding a new "restriction" lint that will emit a warning when using "panic", "unimplemented" or "unreachable" in a function of type option/result.
### Motivation
Some codebases must avoid crashes at all costs, and hence functions of type option/result must return an error instead of crashing.
### Test plan
Running:
TESTNAME=panic_in_result cargo uitest ---
changelog: none
2020-09-10 16:22:20 +00:00
bors
5034d47f72
Auto merge of #5980 - matsujika:create-dir, r=flip1995
...
Add a lint to prevent `create_dir` from being used
This closes #5950
changelog: none
2020-09-10 14:34:22 +00:00
Vali Schneider
f90b1fc063
cargo dev update-lints
2020-09-09 14:06:11 -07:00
Vali Schneider
3550568a54
removing if chain and renaming lint
2020-09-09 14:02:34 -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
5574182b4d
Add a new lint to prevent create_dir
from being used
2020-08-28 18:45:28 +09: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
Eduardo Broto
baf62e7a38
Update changelog to beta 1.47
2020-08-27 14:48:07 +02: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
Bastian
680c68153b
Added a lint which corrects expressions like (a - b) < f32::EPSILON
2020-08-24 16:31:51 +02:00
Tomasz Miąsko
4f4abf4e06
Warn about explicit self-assignment
...
Warn about assignments where left-hand side place expression is the same
as right-hand side value expression. For example, warn about assignment in:
```rust
pub struct Event {
id: usize,
x: i32,
y: i32,
}
pub fn copy_position(a: &mut Event, b: &Event) {
a.x = b.x;
a.y = a.y;
}
```
2020-08-16 23:31:36 +02:00
Dániel Buga
fc1e07e0c1
Rename lint to use plural form
2020-08-16 22:16:39 +02:00
Dániel Buga
d7220dbd91
Run cargo dev update_lints
2020-08-16 20:27:54 +02:00
Dániel Buga
923d61222c
Rename the changelog footnote as well
2020-08-16 20:27:22 +02:00
Dániel Buga
a3ea65c2d9
Implement new lint
2020-08-16 20:27:22 +02:00
bors
c8e05fc1c6
Auto merge of #5881 - wiomoc:feature/single-char-push_str, r=ebroto,flip1995
...
Lint `push_str` with a single-character string literal
Fixes #5875
changelog: `* [single_char_push_str]`
2020-08-16 16:41:57 +00:00
Christoph Walcher
72d2c2eab4
Lint push_str
with a single-character string literal
...
Fixes #5875
2020-08-15 01:40:55 +02:00
chansuke
8e549978e5
Don't use to_string
in impl Display
2020-08-14 21:38:11 +09:00
bors
09bd400243
Auto merge of #5891 - flip1995:rustup, r=flip1995
...
Rustup
r? @ghost
Sync back rust-lang/rust#75098
changelog: none
2020-08-11 12:32:10 +00:00
robojumper
82c816ee02
Fix CHANGELOG's commit range links
...
Two most recent links linked to the wrong range
changelog: none
2020-08-10 17:45:04 +02:00
Philipp Krones
8ee57eed79
Rollup merge of #5869 - wiomoc:feature/implicit-self, r=ebroto,flip1995
...
New lint against `Self` as an arbitrary self type
Fixes #5861
changelog: * [`needless_arbitrary_self_type`] [#5869 ](https://github.com/rust-lang/rust-clippy/pull/5869 )
2020-08-10 14:56:26 +02:00
Philipp Krones
9da5b6d1d0
Rollup merge of #5825 - giraffate:same_item_push, r=Manishearth
...
Add the new lint `same_item_push`
changelog: Add the new lint `same_item_push`
Fixed #4078 . As I said in https://github.com/rust-lang/rust-clippy/issues/4078#issuecomment-658184195 , I referrerd to https://github.com/rust-lang/rust-clippy/pull/4647 .
2020-08-10 14:56:25 +02:00
Christoph Walcher
d635b76eaf
adopt comments from review
2020-08-07 18:08:51 +02:00
Christoph Walcher
e0a4988fcc
Lint against Self
as an arbitrary self type
...
Fixes #5861
2020-08-07 18:08:51 +02:00
Ryan1729
5e84b8c2fb
run cargo dev new_lint then move transmutes_expressible_as_ptr_casts into transmute module
2020-08-06 04:24:24 -06:00
bors
2d4c3379d3
Auto merge of #5809 - JarredAllen:stable_sort_primitive, r=Manishearth
...
Stable sort primitive
changelog: Implements #5762
2020-08-05 20:41:21 +00:00
Takayuki Nakata
1e8ada3cab
Add lint same_item_push
2020-08-05 22:51:38 +09:00
Philipp Krones
84455b211f
Rollup merge of #5852 - wiomoc:feature/lint-duplicate-trait, r=Manishearth
...
Add lint for duplicate methods of trait bounds
rel: #5777
changelog: Add [`trait_duplication_in_bounds`] lint
2020-08-04 12:06:41 +02:00
JarredAllen
25abd7ae76
Create stable_sort_primitive lint
2020-08-03 11:17:43 -07:00
Christoph Walcher
94c50bc8c9
Lint duplicate methods of trait bounds
...
Fixes #5777
2020-07-28 16:42:26 +02:00
Ryan1729
5a644964fc
run cargo dev new_lint
...
specifically:
cargo dev new_lint --name derive_ord_xor_partial_ord --category correctness --pass late
2020-07-26 20:40:57 -06:00
flip1995
d164ab65f7
Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup
2020-07-26 21:07:07 +02:00
flip1995
aba0d244d4
Typo: Change Log -> Changelog
2020-07-16 15:40:13 +02:00
flip1995
cf383cf48a
Update changelog to beta-1.46
2020-07-16 15:36:53 +02:00
Matthias Krüger
126790999a
new lint: Returning unit from closures expecting Ord
...
This lint catches cases where the last statement of a closure expecting
an instance of Ord has a trailing semi-colon. It compiles since the
closure ends up return () which also implements Ord but causes
unexpected results in cases such as sort_by_key.
Fixes #5080
reprise: rebase, update and address all concerns
2020-07-14 15:54:04 +02:00
flip1995
6f25adbd5a
Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup
2020-07-14 14:59:59 +02:00
bors
12df6384b9
Auto merge of #5773 - giraffate:repeat_once, r=flip1995
...
Add a lint for `.repeat(1)`
changelog: New lint `repeat_once`
fix #3028 .
2020-07-14 09:13:58 +00:00
Takayuki Nakata
5307cb5614
Add a lint for .repeat(1)
...
fix #3028 .
2020-07-07 23:13:39 +09:00
robojumper
2e8a1be444
new lint: match_like_matches_macro
2020-07-06 18:25:20 +02:00
JarredAllen
ccb999851a
Fix compile error from library change
2020-07-03 16:50:45 -07:00
JarredAllen
93f0f5d37b
Last few tweaks
2020-07-03 16:50:45 -07:00
JarredAllen
bf48a2d50d
Lint for if let Some(x) = ... instead of Option::map_or
2020-07-03 16:47:38 -07:00
Robert Sedlacek
c3c402783f
Added restriction lint: pattern-type-mismatch
2020-07-03 18:12:29 +02:00
Eduardo Broto
814349f941
Lint enabling the whole restriction group
2020-06-30 21:56:19 +02:00
Teddy_Wang
40ee620e51
Added a lint for .map(|x| x)
2020-06-13 10:08:12 -04:00
Lzu Tao
8db24840f7
Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy
2020-06-09 14:36:01 +00:00
Mazdak Farrokhzad
7b6dc7b33d
add unnested_or_patterns
lint
2020-06-07 21:09:47 +02:00
bors
6fc9939893
Auto merge of #5671 - ebroto:changelog_144_145, r=flip1995
...
Update changelog for stable:1.44 beta:1.45
[Rendered](https://github.com/ebroto/rust-clippy/blob/changelog_144_145/CHANGELOG.md )
changelog: none
2020-06-05 12:52:23 +00:00
Eduardo Broto
dcd4806782
Apply suggestions from PR review
2020-06-02 20:45:57 +02:00