Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
5e17f9f
Skip if_not_else lint for '!= 0'-style checks
BenWiederhake Jun 25, 2023
438f934
suggest passing function instead of calling it in [`option_if_let_else`]
J-ZhengLi Sep 4, 2023
22ba792
Update clippy_lints/src/option_if_let_else.rs
J-ZhengLi Sep 12, 2023
fb4f603
Apply suggestions from code review
J-ZhengLi Sep 14, 2023
f4a8b12
Wrap with parenthesis if necessary
koka831 Sep 29, 2023
536114c
[`ignored_unit_patterns`]: check &(), &&(), ...
lengyijun Oct 15, 2023
4fc503e
Avoid a `track_errors` by bubbling up most errors from `check_well_fo…
oli-obk Oct 18, 2023
8e7d167
Merge commit '2b030eb03d9e5837440b1ee0b98c50b97c0c5889' into clippyup
flip1995 Oct 21, 2023
d6fc606
[`map_identity`]: recognize tuples
y21 Jun 13, 2023
56c8235
Auto merge of #10943 - y21:issue7189, r=llogiq
bors Oct 21, 2023
87d0ace
use visibility to check unused imports and delete some stmts
bvanjoi Oct 15, 2023
3c501e4
[`iter_without_into_iter`]: fix papercuts + only lint on pub types
y21 Oct 22, 2023
f942470
Auto merge of #11028 - BenWiederhake:dev-ifnotelse_neqzero, r=llogiq
bors Oct 23, 2023
350a682
Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillot
bors Oct 23, 2023
56ece10
Use `no_run` for doc-tests in new lints
Alexendoo Oct 23, 2023
9f5de66
Auto merge of #11460 - J-ZhengLi:issue11429, r=Centri3
bors Oct 23, 2023
7347c18
Set existing doc-tests to `no_run`
Alexendoo Oct 23, 2023
033c763
Auto merge of #11699 - Alexendoo:no-run-doctests, r=llogiq
bors Oct 23, 2023
e1b287c
Use multiple pushes in `vec_init_then_push` example
Alexendoo Oct 23, 2023
7ade24e
Fix stable feature names in tests
dtolnay Oct 15, 2023
4622203
Move configuration to new `clippy_config` crate
Alexendoo Oct 19, 2023
330d7fa
Auto merge of #116033 - bvanjoi:fix-116032, r=petrochenkov
bors Oct 23, 2023
f879096
Add a lint to check needless `Waker` clones
a1phyr Oct 23, 2023
7df1c8a
Hide config implementation details from public docs
Alexendoo Oct 19, 2023
4eb4192
Auto merge of #11685 - Alexendoo:clippy_config, r=flip1995
bors Oct 24, 2023
cd6ec97
Auto merge of #116773 - dtolnay:validatestable, r=compiler-errors
bors Oct 24, 2023
f4f5b05
Handle structured stable attribute 'since' version in clippy
dtolnay Oct 25, 2023
76d7af0
Expose a non-Symbol way to access current rustc version string
dtolnay Oct 25, 2023
ffc7419
Work around the fact that `check_mod_type_wf` may spuriously return `…
oli-obk Oct 25, 2023
0580080
Remove the `internal_warn` lint category
Alexendoo Oct 25, 2023
ebf6667
Apply suggestions
a1phyr Oct 25, 2023
c337899
Rename `AsyncCoroutineKind` to `CoroutineSource`
oli-obk Oct 23, 2023
7ce6e0d
Auto merge of #11670 - lengyijun:ignored_unit_pattern_ref, r=dswij
bors Oct 25, 2023
ebe63cd
Stop telling people to submit bugs for internal feature ICEs
Noratrieb Oct 16, 2023
5f19fac
Rollup merge of #117175 - oli-obk:gen_fn_split, r=compiler-errors
matthiaskrgr Oct 25, 2023
45f94c7
mention restriction to exported types as a limitation
y21 Oct 25, 2023
d914890
Auto merge of #116818 - Nilstrieb:stop-submitting-bug-reports, r=wesl…
bors Oct 26, 2023
3e05710
Auto merge of #117148 - dtolnay:sinceversion, r=cjgillot
bors Oct 26, 2023
0da4dab
Auto merge of #11584 - koka831:fix/11335, r=blyxyas
bors Oct 26, 2023
392b255
Auto merge of #11712 - Alexendoo:remove-internal-warn, r=dswij
bors Oct 26, 2023
2f0f4dd
Auto merge of #11698 - a1phyr:waker_clone_and_wake, r=y21
bors Oct 26, 2023
d736992
Parse rustc version at compile time
dtolnay Oct 27, 2023
0c8caee
Add gen blocks to ast and do some broken ast lowering
oli-obk Oct 20, 2023
f4b4e2c
Remove internal feature from clippy_utils
Alexendoo Oct 27, 2023
1ed1001
Fix missing parenthesis in suboptimal floating point help
llogiq Oct 27, 2023
58fe451
Expand docs on clippy::todo
Wilfred Oct 27, 2023
9a10d32
reword limitation section
y21 Oct 28, 2023
f8409ef
Auto merge of #11696 - y21:iter_without_into_iter_suggestion, r=xFrednet
bors Oct 28, 2023
5852ca8
Auto merge of #11724 - rust-lang:fix-11559, r=blyxyas
bors Oct 28, 2023
2fea83b
move `read_zero_byte_vec` to nursery
dswij Oct 28, 2023
f2a0776
Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errors
bors Oct 29, 2023
2030c58
Fix some typos
cuishuang Oct 29, 2023
a40958a
Auto merge of #11730 - cuishuang:master, r=dswij
bors Oct 29, 2023
fa6fd8c
Auto merge of #11726 - Wilfred:todo_docs, r=dswij
bors Oct 29, 2023
c51e2a0
fix enum_variant_names depending lint depending on order
jonboh Sep 13, 2023
e6c804c
ignore lower-camel-case words in `doc_markdown`
llogiq Oct 29, 2023
739f9e2
Auto merge of #11727 - dswij:read-zero-byte-vec-nursery, r=Centri3
bors Oct 29, 2023
2e907aa
Rename Since -> StableSince in preparation for a DeprecatedSince
dtolnay Oct 26, 2023
e245f7c
Auto merge of #11735 - rust-lang:fix-11568, r=blyxyas
bors Oct 30, 2023
325e9fd
Auto merge of #11723 - Alexendoo:clippy-utils-internal, r=Jarcho
bors Oct 30, 2023
cdc4d56
Auto merge of #11701 - Alexendoo:vec-init-then-push-docs, r=Jarcho
bors Oct 30, 2023
69c3b9c
new lint: `unnecessary_fallible_conversions`
y21 Oct 14, 2023
3da80dc
Auto merge of #11498 - jonboh:issue11494_enumvariants_order_affects_l…
bors Oct 31, 2023
7d34406
Auto merge of #11669 - y21:issue11577, r=Jarcho
bors Oct 31, 2023
0b90f72
feat: unused_enumerate_index lint
dnbln Feb 26, 2023
14b8290
Apply suggestions from code review
dnbln Oct 12, 2023
bb9cc6d
refactor: extract common pat_is_wild to clippy_utils
dnbln Nov 1, 2023
919f698
Auto merge of #10404 - dnbln:feat/unused_enumerate_index, r=blyxyas
bors Nov 1, 2023
3b759bc
fix get_first false negative for VecDeque
matthri Nov 1, 2023
61c76dd
remove code duplication
matthri Nov 1, 2023
01a0a36
Auto merge of #11744 - matthri:get-first-deque-fix, r=Jarcho
bors Nov 2, 2023
95dc7be
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Nov 2, 2023
5eee19e
Bump nightly version -> 2023-11-02
flip1995 Nov 2, 2023
62a82b3
Format let-chains across the code base
flip1995 Nov 2, 2023
09ac14c
Auto merge of #11747 - flip1995:rustup, r=flip1995
bors Nov 2, 2023
257147a
Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyup
flip1995 Nov 2, 2023
02562bf
Update Cargo.lock
flip1995 Nov 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions book/src/lint_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,15 +774,15 @@ Additional dotfiles (files or directories starting with a dot) to allow

## `enforce-iter-loop-reborrow`
#### Example
```
```no_run
let mut vec = vec![1, 2, 3];
let rmvec = &mut vec;
for _ in rmvec.iter() {}
for _ in rmvec.iter_mut() {}
```

Use instead:
```
```no_run
let mut vec = vec![1, 2, 3];
let rmvec = &mut vec;
for _ in &*rmvec {}
Expand Down
4 changes: 2 additions & 2 deletions clippy_dev/src/new_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,11 @@ fn get_lint_declaration(name_upper: &str, category: &str) -> String {
/// ### Why is this bad?
///
/// ### Example
/// ```rust
/// ```no_run
/// // example code where clippy issues a warning
/// ```
/// Use instead:
/// ```rust
/// ```no_run
/// // example code which does not raise clippy warning
/// ```
#[clippy::version = "{}"]
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/absolute_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ declare_clippy_lint! {
/// using absolute paths is the proper way of referencing items in one.
///
/// ### Example
/// ```rust
/// ```no_run
/// let x = std::f64::consts::PI;
/// ```
/// Use any of the below instead, or anything else:
/// ```rust
/// ```no_run
/// use std::f64;
/// use std::f64::consts;
/// use std::f64::consts::PI;
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/almost_complete_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ declare_clippy_lint! {
/// This (`'a'..'z'`) is almost certainly a typo meant to include all letters.
///
/// ### Example
/// ```rust
/// ```no_run
/// let _ = 'a'..'z';
/// ```
/// Use instead:
/// ```rust
/// ```no_run
/// let _ = 'a'..='z';
/// ```
#[clippy::version = "1.68.0"]
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/approx_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ declare_clippy_lint! {
/// issue](https://github.com/rust-lang/rust/issues).
///
/// ### Example
/// ```rust
/// ```no_run
/// let x = 3.14;
/// let y = 1_f64 / x;
/// ```
/// Use instead:
/// ```rust
/// ```no_run
/// let x = std::f32::consts::PI;
/// let y = std::f64::consts::FRAC_1_PI;
/// ```
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/arc_with_non_send_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare_clippy_lint! {
/// either `T` should be made `Send + Sync` or an `Rc` should be used instead of an `Arc`
///
/// ### Example
/// ```rust
/// ```no_run
/// # use std::cell::RefCell;
/// # use std::sync::Arc;
///
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/async_yields_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare_clippy_lint! {
/// An await is likely missing.
///
/// ### Example
/// ```rust
/// ```no_run
/// async fn foo() {}
///
/// fn bar() {
Expand All @@ -26,7 +26,7 @@ declare_clippy_lint! {
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// async fn foo() {}
///
/// fn bar() {
Expand Down
42 changes: 21 additions & 21 deletions clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ declare_clippy_lint! {
/// a valid semver. Failing that, the contained information is useless.
///
/// ### Example
/// ```rust
/// ```no_run
/// #[deprecated(since = "forever")]
/// fn something_else() { /* ... */ }
/// ```
Expand All @@ -156,14 +156,14 @@ declare_clippy_lint! {
/// currently works for basic cases but is not perfect.
///
/// ### Example
/// ```rust
/// ```no_run
/// #[allow(dead_code)]
///
/// fn not_quite_good_code() { }
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// // Good (as inner attribute)
/// #![allow(dead_code)]
///
Expand Down Expand Up @@ -198,25 +198,25 @@ declare_clippy_lint! {
/// Does not detect empty lines after doc attributes (e.g. `#[doc = ""]`).
///
/// ### Example
/// ```rust
/// ```no_run
/// /// Some doc comment with a blank line after it.
///
/// fn not_quite_good_code() { }
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// /// Good (no blank line)
/// fn this_is_fine() { }
/// ```
///
/// ```rust
/// ```no_run
/// // Good (convert to a regular comment)
///
/// fn this_is_fine_too() { }
/// ```
///
/// ```rust
/// ```no_run
/// //! Good (convert to a comment on an inner attribute)
///
/// fn this_is_fine_as_well() { }
Expand All @@ -236,12 +236,12 @@ declare_clippy_lint! {
/// These lints should only be enabled on a lint-by-lint basis and with careful consideration.
///
/// ### Example
/// ```rust
/// ```no_run
/// #![deny(clippy::restriction)]
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// #![deny(clippy::as_conversions)]
/// ```
#[clippy::version = "1.47.0"]
Expand All @@ -265,13 +265,13 @@ declare_clippy_lint! {
/// [#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)
///
/// ### Example
/// ```rust
/// ```no_run
/// #[cfg_attr(rustfmt, rustfmt_skip)]
/// fn main() { }
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// #[rustfmt::skip]
/// fn main() { }
/// ```
Expand All @@ -290,13 +290,13 @@ declare_clippy_lint! {
/// by the conditional compilation engine.
///
/// ### Example
/// ```rust
/// ```no_run
/// #[cfg(linux)]
/// fn conditional() { }
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// # mod hidden {
/// #[cfg(target_os = "linux")]
/// fn conditional() { }
Expand Down Expand Up @@ -325,14 +325,14 @@ declare_clippy_lint! {
/// ensure that others understand the reasoning
///
/// ### Example
/// ```rust
/// ```no_run
/// #![feature(lint_reasons)]
///
/// #![allow(clippy::some_lint)]
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// #![feature(lint_reasons)]
///
/// #![allow(clippy::some_lint, reason = "False positive rust-lang/rust-clippy#1002020")]
Expand All @@ -352,7 +352,7 @@ declare_clippy_lint! {
/// panicking with the expected message, and not another unrelated panic.
///
/// ### Example
/// ```rust
/// ```no_run
/// fn random() -> i32 { 0 }
///
/// #[should_panic]
Expand All @@ -363,7 +363,7 @@ declare_clippy_lint! {
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// fn random() -> i32 { 0 }
///
/// #[should_panic = "attempt to divide by zero"]
Expand All @@ -386,13 +386,13 @@ declare_clippy_lint! {
/// If there is only one condition, no need to wrap it into `any` or `all` combinators.
///
/// ### Example
/// ```rust
/// ```no_run
/// #[cfg(any(unix))]
/// pub struct Bar;
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// #[cfg(unix)]
/// pub struct Bar;
/// ```
Expand All @@ -412,13 +412,13 @@ declare_clippy_lint! {
/// may cause conditional compilation not work quitely.
///
/// ### Example
/// ```rust
/// ```no_run
/// #[cfg(features = "some-feature")]
/// fn conditional() { }
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// #[cfg(feature = "some-feature")]
/// fn conditional() { }
/// ```
Expand Down
10 changes: 5 additions & 5 deletions clippy_lints/src/await_holding_invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare_clippy_lint! {
/// to wrap the `.lock()` call in a block instead of explicitly dropping the guard.
///
/// ### Example
/// ```rust
/// ```no_run
/// # use std::sync::Mutex;
/// # async fn baz() {}
/// async fn foo(x: &Mutex<u32>) {
Expand All @@ -47,7 +47,7 @@ declare_clippy_lint! {
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// # use std::sync::Mutex;
/// # async fn baz() {}
/// async fn foo(x: &Mutex<u32>) {
Expand Down Expand Up @@ -87,7 +87,7 @@ declare_clippy_lint! {
/// to wrap the `.borrow[_mut]()` call in a block instead of explicitly dropping the ref.
///
/// ### Example
/// ```rust
/// ```no_run
/// # use std::cell::RefCell;
/// # async fn baz() {}
/// async fn foo(x: &RefCell<u32>) {
Expand All @@ -105,7 +105,7 @@ declare_clippy_lint! {
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// # use std::cell::RefCell;
/// # async fn baz() {}
/// async fn foo(x: &RefCell<u32>) {
Expand Down Expand Up @@ -151,7 +151,7 @@ declare_clippy_lint! {
/// ]
/// ```
///
/// ```rust
/// ```no_run
/// # async fn baz() {}
/// struct CustomLockType;
/// struct OtherCustomLockType;
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/blocks_in_if_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ declare_clippy_lint! {
/// Style, using blocks in the condition makes it hard to read.
///
/// ### Examples
/// ```rust
/// ```no_run
/// # fn somefunc() -> bool { true };
/// if { true } { /* ... */ }
///
/// if { let x = somefunc(); x } { /* ... */ }
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// # fn somefunc() -> bool { true };
/// if true { /* ... */ }
///
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/bool_assert_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ declare_clippy_lint! {
/// It is shorter to use the equivalent.
///
/// ### Example
/// ```rust
/// ```no_run
/// assert_eq!("a".is_empty(), false);
/// assert_ne!("a".is_empty(), true);
/// ```
///
/// Use instead:
/// ```rust
/// ```no_run
/// assert!(!"a".is_empty());
/// ```
#[clippy::version = "1.53.0"]
Expand Down
6 changes: 3 additions & 3 deletions clippy_lints/src/bool_to_int_with_if.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare_clippy_lint! {
/// See https://doc.rust-lang.org/std/primitive.bool.html#impl-From%3Cbool%3E
///
/// ### Example
/// ```rust
/// ```no_run
/// # let condition = false;
/// if condition {
/// 1_i64
Expand All @@ -30,12 +30,12 @@ declare_clippy_lint! {
/// };
/// ```
/// Use instead:
/// ```rust
/// ```no_run
/// # let condition = false;
/// i64::from(condition);
/// ```
/// or
/// ```rust
/// ```no_run
/// # let condition = false;
/// condition as i64;
/// ```
Expand Down
Loading