Evan Typanski
c8df6d6970
Prefer if let chain over macro
2022-06-22 14:23:04 -04:00
Evan Typanski
93e41d3305
Fix case where rem was considered commutative
2022-06-22 14:23:04 -04:00
Evan Typanski
75ed0c9f26
Prefer .ok()?
over .unwrap()
2022-06-22 13:15:35 -04:00
alexey semenyuk
b969326874
Example for VEC_RESIZE_TO_ZERO
2022-06-22 11:01:52 +00:00
bors
f9fea1737e
Auto merge of #9030 - Serial-ATA:remove-clippy-dev-dep, r=flip1995
...
Remove `cargo_dev` dependency
changelog: none
Sorry about that 😅 .
r? `@flip1995`
2022-06-22 08:02:54 +00:00
bors
bc0bf06718
Auto merge of #9017 - alex-semenyuk:while_let_on_iterator_doc_fix, r=giraffate
...
Example for `WHILE_LET_ON_ITERATOR`
changelog: none
example for `WHILE_LET_ON_ITERATOR`, using `for` instead of `while let`
2022-06-22 00:01:49 +00:00
kyoto7250
ab645bb081
enum_variant_names should ignore when all prefixes are _
2022-06-22 08:32:54 +09:00
Evan Typanski
6e1df4732b
Fix case where suggestion errored for infer type
2022-06-21 16:41:36 -04:00
Evan Typanski
e5ebd3edab
Implement manual_rem_euclid lint
2022-06-21 14:13:15 -04:00
Serial
890fd0e3c1
Remove cargo_dev
dependency
2022-06-21 14:04:37 -04:00
Serial
2bd1581bbf
Add dev deprecate
2022-06-21 13:43:47 -04:00
alexey semenyuk
dc7f227593
For
example should be used instead while
in WHILE_LET_ON_ITERATOR
...
`For` example should be used instead `while` in WHILE_LET_ON_ITERATOR
For example should be used instead while in WHILE_LET_ON_ITERATOR
Revert some changes
Fix cargo dev fmt
2022-06-21 10:40:19 +03:00
Marcel Hellwig
6fc84d4da3
put parentheses around neg_multiply suggestion if needed
2022-06-20 23:47:53 +02:00
bors
93c6f9ebed
Auto merge of #9006 - kyoto7250:issue-8836-v2, r=Jarcho
...
feat(fix): ignore `todo!` and `unimplemented!` in `if_same_then_else`
close : #8836
take over: #8853
This PR adds check `todo!` and `unimplemented!` in if_same_then_else.
( I thought `unimplemented` should not be checked as well as todo!.)
Thank you in advance.
changelog: ignore todo! and unimplemented! in if_same_then_else
r? `@Jarcho`
2022-06-20 15:08:32 +00:00
bors
97d451397d
Auto merge of #9025 - Alexendoo:unused-async-method, r=dswij
...
unused_async: lint async methods
Now lints:
```rust
impl Foo {
async fn method(&self) -> &'static str {
"no await here"
}
}
```
changelog: [`unused_async`]: lint async methods
Fixes #9024
2022-06-20 13:10:52 +00:00
Alex Macleod
a0b107bbb6
unused_async: lint async methods
2022-06-20 12:03:27 +00:00
bors
195f2cba45
Auto merge of #9023 - unvalley:add-meta-tag-for-lint-list, r=xFrednet
...
Add description meta tag for lint list
closes #8975
changelog:none
2022-06-20 10:16:08 +00:00
kyoto7250
4a4b5cf061
confirm using chain in collapsible_span_lint_calls
2022-06-20 13:17:54 +09:00
kyoto7250
39ffda014d
check macro in HitEqInterExpr
2022-06-20 11:14:52 +09:00
kyoto7250
46d056e2eb
check last statement
2022-06-20 11:05:40 +09:00
bors
9d92af76b4
Auto merge of #9016 - Alexendoo:needless-return-test, r=giraffate
...
Use `RefCell` in `needless_return` tests
changelog: none
The stdio locks no longer fail to compile if the `return` is removed due to them now being `'static` (#9008 )
2022-06-20 00:43:06 +00:00
unvalley
4e7ed42867
Add description meta tag for lint list
2022-06-20 00:19:08 +09:00
Alex Macleod
eeedf72c33
Use RefCell in needless_return tests
2022-06-18 16:36:47 +00:00
kyoto7250
a9215d90c8
ignore item in thread_local!
2022-06-18 21:02:47 +09:00
kyoto7250
4a02ae9636
cargo dev fmt
2022-06-18 18:29:39 +09:00
kyoto7250
040d45e412
check macro in eq_block
2022-06-18 18:24:39 +09:00
kyoto7250
7a83809c8c
check only first statement
2022-06-18 17:49:03 +09:00
kyoto7250
f411c18a73
check macro_backtrace only
2022-06-18 17:46:42 +09:00
bors
e933bb6bc3
Auto merge of #8989 - kyoto7250:default_iter_empty, r=Alexendoo
...
feat(lint): add default_iter_empty
close #8915
This PR adds `default_iter_empty` lint.
This lint checks `std::iter::Empty::default()` and replace with `std::iter::empty()`.
Thank you in advance.
---
changelog: add `default_instead_of_iter_empty` lint.
2022-06-17 21:06:09 +00:00
kyoto7250
697c75ef4b
check only the end
2022-06-18 00:19:30 +09:00
kyoto7250
2bb8c45026
feat(lint): add default_iter_empty
...
Update description in clippy_lints/src/default_iter_empty.rs
Co-authored-by: Fridtjof Stoldt <xFrednet@gmail.com>
Update clippy_lints/src/default_iter_empty.rs
Co-authored-by: Alex Macleod <alex@macleod.io>
Update clippy_lints/src/default_iter_empty.rs
Co-authored-by: Alex Macleod <alex@macleod.io>
renamed default_iter_empty to default_instead_of_iter_empty
Avoid duplicate messages
add tests for regression
rewrite 'Why is this bad?'
cargo dev fmt
delete default_iter_empty lint in renamed_lint.rs
rewrite a message in the suggestion
cargo dev update_lints --check
2022-06-17 21:34:36 +09:00
kyoto7250
a5b6d25ca4
use get_diagnostic_name for checking macro_call
2022-06-17 10:10:40 +09:00
bors
d7b5cbf065
Auto merge of #9007 - flip1995:rustup, r=flip1995
...
Rustup
r? `@ghost`
changelog: none
2022-06-16 14:07:23 +00:00
flip1995
280797ecb0
Bump nightly version -> 2022-06-16
2022-06-16 16:04:12 +02:00
flip1995
c5c8f6122f
Merge remote-tracking branch 'upstream/master' into rustup
2022-06-16 16:04:06 +02:00
bors
9edd6412f1
Auto merge of #9005 - flip1995:book_ci_2, r=xFrednet
...
Build mdbook in remark workflow
r? `@xFrednet`
Supersedes #8959
changelog: none
2022-06-16 12:49:20 +00:00
kyoto7250
7cb4cef123
feat(fix): ignore todo! and unimplemented! in if_same_then_else
2022-06-16 21:38:47 +09:00
flip1995
980d88e25c
Build mdbook in remark workflow
...
This is just to ensure that the book builds all time to not get in trouble when syncing with rust-lang/rust
2022-06-16 14:10:35 +02:00
bors
71f2de96ee
Auto merge of #9002 - andylizi:fix-never-loop, r=Manishearth
...
Fix false positive for `never_loop` struct expression fields
Fixes #9001 .
changelog: [`never_loop`]: Now checks for `continue` in struct expression
2022-06-15 18:36:32 +00:00
Dany Marcoux
9306e9a4df
Ignore bodies containing todo!()
in clippy::if_same_then_else
2022-06-16 00:36:56 +09:00
Yuki Okushi
bd071bf5b2
Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011
...
Make `ExprKind::Closure` a struct variant.
Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`.
r? ``@Aaron1011``
2022-06-15 19:37:14 +09:00
andylizi
a8370d4460
Fix false positive for never_loop
struct expression fields
2022-06-15 18:02:59 +08:00
bors
844c06a7c7
Auto merge of #8964 - tamaroning:read_zero_byte_vec, r=dswij
...
Warn about read into zero-length `Vec`
Closes #8886
- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`
changelog: none
2022-06-15 06:16:14 +00:00
bors
32a86c086e
Auto merge of #8999 - Alexendoo:error-pattern, r=xFrednet
...
Remove error-pattern comments
The `clippy_lints` one [is unused](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.60error-pattern.60 ), the others in `ui-toml` also appear not to have an effect
changelog: none
2022-06-14 16:54:13 +00:00
Alex Macleod
08cfb8ddc3
Remove error-pattern comments
2022-06-14 16:28:34 +00:00
tamaron
14478bb94b
add lint
2022-06-14 23:30:43 +09:00
b-naber
196f3c0e71
fix wrong evaluation in clippy
2022-06-14 16:11:35 +02:00
b-naber
6d94f95a20
address review
2022-06-14 16:11:27 +02:00
b-naber
3f4ad95826
fix clippy test failures
2022-06-14 16:08:11 +02:00
b-naber
90a41050ba
implement valtrees as the type-system representation for constant values
2022-06-14 16:07:11 +02:00