Skip to content

Commit 9b5b4cb

Browse files
authored
Merge branch 'master' into new-lint-slice-as-bytes
2 parents 8f4aae3 + 4825666 commit 9b5b4cb

File tree

152 files changed

+2515
-454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+2515
-454
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5768,6 +5768,7 @@ Released 2018-09-13
57685768
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
57695769
[`manual_range_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns
57705770
[`manual_rem_euclid`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rem_euclid
5771+
[`manual_repeat_n`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n
57715772
[`manual_retain`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
57725773
[`manual_rotate`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rotate
57735774
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
@@ -5905,6 +5906,7 @@ Released 2018-09-13
59055906
[`non_minimal_cfg`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
59065907
[`non_octal_unix_permissions`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_octal_unix_permissions
59075908
[`non_send_fields_in_send_ty`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_send_fields_in_send_ty
5909+
[`non_std_lazy_statics`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_std_lazy_statics
59085910
[`non_zero_suggestions`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_zero_suggestions
59095911
[`nonminimal_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
59105912
[`nonsensical_open_options`]: https://rust-lang.github.io/rust-clippy/master/index.html#nonsensical_open_options
@@ -6174,6 +6176,7 @@ Released 2018-09-13
61746176
[`unnecessary_safety_comment`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_comment
61756177
[`unnecessary_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
61766178
[`unnecessary_self_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports
6179+
[`unnecessary_semicolon`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon
61776180
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
61786181
[`unnecessary_struct_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_struct_initialization
61796182
[`unnecessary_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned

book/src/lint_configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,13 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
762762
* [`mem_replace_with_default`](https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default)
763763
* [`missing_const_for_fn`](https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn)
764764
* [`needless_borrow`](https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow)
765+
* [`non_std_lazy_statics`](https://rust-lang.github.io/rust-clippy/master/index.html#non_std_lazy_statics)
765766
* [`option_as_ref_deref`](https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref)
766767
* [`option_map_unwrap_or`](https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unwrap_or)
767768
* [`ptr_as_ptr`](https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr)
768769
* [`redundant_field_names`](https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names)
769770
* [`redundant_static_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes)
771+
* [`same_item_push`](https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push)
770772
* [`seek_from_current`](https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current)
771773
* [`seek_rewind`](https://rust-lang.github.io/rust-clippy/master/index.html#seek_rewind)
772774
* [`transmute_ptr_to_ref`](https://rust-lang.github.io/rust-clippy/master/index.html#transmute_ptr_to_ref)

clippy_config/src/conf.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,11 +631,13 @@ define_Conf! {
631631
mem_replace_with_default,
632632
missing_const_for_fn,
633633
needless_borrow,
634+
non_std_lazy_statics,
634635
option_as_ref_deref,
635636
option_map_unwrap_or,
636637
ptr_as_ptr,
637638
redundant_field_names,
638639
redundant_static_lifetimes,
640+
same_item_push,
639641
seek_from_current,
640642
seek_rewind,
641643
transmute_ptr_to_ref,

clippy_dev/src/setup/intellij.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn check_and_get_rustc_dir(rustc_path: &str) -> Result<PathBuf, ()> {
6262
eprintln!("error: unable to get the absolute path of rustc ({err})");
6363
return Err(());
6464
},
65-
};
65+
}
6666
}
6767

6868
let path = path.join("compiler");

clippy_dev/src/update_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ fn try_rename_file(old_name: &Path, new_name: &Path) -> bool {
842842
Ok(file) => drop(file),
843843
Err(e) if matches!(e.kind(), io::ErrorKind::AlreadyExists | io::ErrorKind::NotFound) => return false,
844844
Err(e) => panic_file(e, new_name, "create"),
845-
};
845+
}
846846
match fs::rename(old_name, new_name) {
847847
Ok(()) => true,
848848
Err(e) => {

clippy_lints/src/assigning_clones.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ fn build_sugg<'tcx>(
257257
// The receiver may have been a value type, so we need to add an `&` to
258258
// be sure the argument to clone_from will be a reference.
259259
arg_sugg = arg_sugg.addr();
260-
};
260+
}
261261

262262
format!("{receiver_sugg}.clone_from({arg_sugg})")
263263
},

clippy_lints/src/attrs/mixed_attributes_style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub(super) fn check(cx: &EarlyContext<'_>, item_span: Span, attrs: &[Attribute])
6060
}
6161
outer_attr_kind.insert(kind);
6262
},
63-
};
63+
}
6464
}
6565
}
6666

clippy_lints/src/cargo/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ declare_clippy_lint! {
161161
/// [dependencies]
162162
/// regex = "*"
163163
/// ```
164+
/// Use instead:
165+
/// ```toml
166+
/// [dependencies]
167+
/// # allow patch updates, but not minor or major version changes
168+
/// some_crate_1 = "~1.2.3"
169+
///
170+
/// # pin the version to a specific version
171+
/// some_crate_2 = "=1.2.3"
172+
/// ```
164173
#[clippy::version = "1.32.0"]
165174
pub WILDCARD_DEPENDENCIES,
166175
cargo,

clippy_lints/src/casts/cast_possible_wrap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_from: Ty<'_>, ca
8484
diag
8585
.note("`usize` and `isize` may be as small as 16 bits on some platforms")
8686
.note("for more information see https://doc.rust-lang.org/reference/types/numeric.html#machine-dependent-integer-types");
87-
};
87+
}
8888
});
8989
}

clippy_lints/src/casts/cast_sign_loss.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn expr_muldiv_sign(cx: &LateContext<'_>, expr: &Expr<'_>) -> Sign {
205205
// - uncertain if there are any uncertain values (because they could be negative or positive),
206206
Sign::Uncertain => return Sign::Uncertain,
207207
Sign::ZeroOrPositive => (),
208-
};
208+
}
209209
}
210210

211211
// A mul/div is:
@@ -236,7 +236,7 @@ fn expr_add_sign(cx: &LateContext<'_>, expr: &Expr<'_>) -> Sign {
236236
// - uncertain if there are any uncertain values (because they could be negative or positive),
237237
Sign::Uncertain => return Sign::Uncertain,
238238
Sign::ZeroOrPositive => positive_count += 1,
239-
};
239+
}
240240
}
241241

242242
// A sum is:

0 commit comments

Comments
 (0)