Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy subtree update #124621

Merged
merged 79 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
22f57ff
fix `for x in y unsafe { }`
bend-n Mar 20, 2024
a356785
reasoning
bend-n Mar 20, 2024
58c53e8
reduce `single_char_pattern` to only lint on ascii chars
llogiq Nov 21, 2023
54de78a
downgrade to pedantic
llogiq Nov 28, 2023
666e2f2
fix [`large_stack_arrays`] linting in `vec` macro & add `matching_roo…
J-ZhengLi Apr 10, 2024
2861729
test [`large_stack_arrays`] with proc-macro and make sure not to offe…
J-ZhengLi Apr 17, 2024
876d5f0
Rename `BindingAnnotation` to `BindingMode`
Jules-Bertholet Apr 16, 2024
66362ef
Don't suggest `Box::default()` in functions with differing generics
Alexendoo Apr 17, 2024
81106c5
has_typeck_results doesnt need to be a query
compiler-errors Apr 15, 2024
a5aaf33
Merge commit 'ca3b393750ee8d870bf3215dcf6509cafa5c0445' into clippy-s…
flip1995 Apr 18, 2024
f7aef63
Rework interior mutability detection
Alexendoo Apr 18, 2024
26484ce
Disallow ambiguous attributes on expressions
voidc Apr 17, 2024
2a4dae3
[arithmetic_side_effects] Fix #12318
c410-f3r Apr 18, 2024
2f8b1e3
needless_pass_by_ref_mut: Fix corner case in async functions
GuillaumeGomez Apr 18, 2024
0999867
needless_pass_by_ref_mut: emit the lint on `self` as well
GuillaumeGomez Apr 18, 2024
2795a60
Auto merge of #12693 - GuillaumeGomez:run-on-self-needless_pass_by_re…
bors Apr 18, 2024
adab7d0
[`collection_is_never_read`]: check clousure in method args
J-ZhengLi Apr 19, 2024
206b1a1
Threadlocal_initializer_can_be_made_const will not trigger for unreac…
Apr 17, 2024
898baf8
Add `test_with_disallowed_name`
smoelius Apr 20, 2024
de258cc
Fix `is_test_module_or_function`
smoelius Apr 20, 2024
c2a98cb
Auto merge of #12685 - m-rph:12637, r=blyxyas
bors Apr 20, 2024
8eafeeb
Auto merge of #12691 - Alexendoo:ignore-interior-mutability-indirect,…
bors Apr 20, 2024
c642d0c
Auto merge of #12696 - smoelius:fix-is_test_module_or_function, r=Ale…
bors Apr 20, 2024
fc6dfeb
Auto merge of #11852 - rust-lang:single-char-pattern-ascii-only, r=xF…
bors Apr 22, 2024
7fcaa60
Auto merge of #12692 - c410-f3r:arrrr, r=Manishearth
bors Apr 22, 2024
9ca9d71
Auto merge of #123992 - compiler-errors:no-has-typeck-results, r=jack…
bors Apr 23, 2024
53b5056
Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davi…
matthiaskrgr Apr 23, 2024
d55e5b4
chore: fix some typos in comments
forcedebug Apr 23, 2024
b2a7371
Auto merge of #12705 - forcedebug:master, r=Manishearth
bors Apr 23, 2024
107e44b
[`non_canonical_partial_ord_impl`]: Fix emitting warnings which confl…
Luv-Ray Apr 24, 2024
3fc9537
Error on using `yield` without also using `#[coroutine]` on the closure
oli-obk Apr 11, 2024
7d9f970
Fix and bless clippy tests
nbdd0121 Apr 19, 2024
9162bbf
Auto merge of #12702 - Luv-Ray:non_canonical_partial_ord_impl, r=Mani…
bors Apr 24, 2024
69a4a46
Rename `msrvs::ASSIGNING_CLONES` to `msrvs::CLONE_INTO`
Alexendoo Apr 24, 2024
de4fce8
Auto merge of #12711 - Alexendoo:assigning-clones-msrv, r=Manishearth
bors Apr 25, 2024
ec9ddc7
ast: Generalize item kind visiting
petrochenkov Apr 24, 2024
a8e0bcb
clippy: bless tests
klensy Apr 26, 2024
c6bf954
Auto merge of #12624 - J-ZhengLi:issue12586, r=xFrednet
bors Apr 27, 2024
b700d9c
clippy::single_match(_else) may be machine applicable
kornelski Apr 27, 2024
ef1b021
remove myself from vacation
y21 Apr 28, 2024
0b1f09e
Fixed reduction of & in cast_possible_truncation
MATSMACKE Apr 27, 2024
a18f50f
Auto merge of #12728 - y21:rr, r=dswij
bors Apr 28, 2024
ca1ddc0
Auto merge of #12722 - MATSMACKE:master, r=Alexendoo
bors Apr 28, 2024
e2861d5
Encourage using `LateLintPass`
ARandomDev99 Mar 30, 2024
87efce4
configurably allow `useless_vec` in tests
llogiq Apr 27, 2024
e68fcb0
Auto merge of #12725 - llogiq:allow-useless-test-vecs, r=blyxyas
bors Apr 28, 2024
cbdc36a
skip warning when generic evolved;
J-ZhengLi Apr 29, 2024
0fc9a65
Auto merge of #12694 - J-ZhengLi:issue11783, r=dswij
bors Apr 29, 2024
f0beaed
suppress `readonly_write_lock` for underscore-prefixed bindings
y21 Apr 29, 2024
9276ce1
Add StaticForeignItem and use it on ForeignItemKind
spastorino Apr 29, 2024
b1fa284
Update version attribute for 1.78 lints
xFrednet Apr 29, 2024
7ac1529
Changelog for Clippy 1.78 :magic_wand:
xFrednet Apr 29, 2024
9e02abe
Auto merge of #12726 - kornelski:else_applicable, r=blyxyas
bors Apr 29, 2024
71db2d1
[type_complexity]: Fix duplicate errors
UlazkaMateusz Apr 29, 2024
70e74b1
Auto merge of #12736 - UlazkaMateusz:fix-type_complexity_duplicate_er…
bors Apr 29, 2024
4261e0b
Auto merge of #12734 - y21:issue12733, r=Manishearth
bors Apr 29, 2024
4bee978
Auto merge of #124398 - klensy:trailing-ws, r=compiler-errors
bors Apr 30, 2024
fc15bc1
Rollup merge of #124524 - spastorino:make-foreign-static-use-struct, …
matthiaskrgr Apr 30, 2024
d8e76ec
Auto merge of #12596 - ARandomDev99:issue-12595, r=Alexendoo
bors Apr 30, 2024
a3ef100
warning
bend-n May 1, 2024
a7f66ba
Auto merge of #12687 - Alexendoo:box-default-generic-fn, r=xFrednet
bors May 1, 2024
fed9940
Remove clippy_utils::paths::VEC_RESIZE
CBSpeir May 1, 2024
852a64f
Auto merge of #11988 - J-ZhengLi:issue11324, r=Alexendoo
bors May 1, 2024
272413f
allow or patterns for a high enough MSRV in `collapsible_match`
y21 May 2, 2024
790fb93
check for `matches!` macro directly in `redundant_guards`
y21 May 2, 2024
5e05821
Remove clippy_utils::paths::{SLICE_GET, STR_BYTES}
CBSpeir May 2, 2024
5c23f13
Apply suggestions from code review <3
xFrednet Apr 29, 2024
546408b
Auto merge of #12735 - xFrednet:changelog-1-78, r=dswij
bors May 2, 2024
dcfc3b5
Bump ui_test to 0.23
oli-obk May 2, 2024
7eb3809
Auto merge of #12746 - oli-obk:bump_ui_test, r=blyxyas
bors May 2, 2024
e849235
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 May 2, 2024
76b95fd
Bump Clippy version -> 0.1.80
flip1995 May 2, 2024
d878e0e
Bump nightly version -> 2024-05-02
flip1995 May 2, 2024
1325425
Auto merge of #12748 - flip1995:rustup, r=flip1995
bors May 2, 2024
a2bd02b
Auto merge of #12515 - bend-n:🦀, r=llogiq
bors May 2, 2024
c369183
Auto merge of #12743 - CBSpeir:remove-paths-vec_resize, r=y21
bors May 2, 2024
20b085d
Auto merge of #12745 - y21:collapsible_match_or_pat, r=llogiq
bors May 2, 2024
15a6485
Merge commit '20b085d500dfba5afe0869707bf357af3afe20be' into clippy-s…
flip1995 May 2, 2024
e395dc9
Update Cargo.lock
flip1995 May 2, 2024
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
34 changes: 22 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ dependencies = [
"unicode-width",
]

[[package]]
name = "annotate-snippets"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5a59f105fb9635e9eebdc1e29d53e764fa5795b9cf899a638a53e61567ef61"
dependencies = [
"anstyle",
"unicode-width",
]

[[package]]
name = "ansi_term"
version = "0.12.1"
Expand Down Expand Up @@ -574,7 +584,7 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce"

[[package]]
name = "clippy"
version = "0.1.79"
version = "0.1.80"
dependencies = [
"anstream",
"clippy_config",
Expand All @@ -595,13 +605,13 @@ dependencies = [
"termize",
"tokio",
"toml 0.7.8",
"ui_test 0.22.3",
"ui_test 0.23.0",
"walkdir",
]

[[package]]
name = "clippy_config"
version = "0.1.79"
version = "0.1.80"
dependencies = [
"rustc-semver",
"serde",
Expand All @@ -624,7 +634,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.79"
version = "0.1.80"
dependencies = [
"arrayvec",
"cargo_metadata 0.18.1",
Expand All @@ -649,7 +659,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.79"
version = "0.1.80"
dependencies = [
"arrayvec",
"clippy_config",
Expand Down Expand Up @@ -968,7 +978,7 @@ checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69"

[[package]]
name = "declare_clippy_lint"
version = "0.1.79"
version = "0.1.80"
dependencies = [
"itertools 0.12.1",
"quote",
Expand Down Expand Up @@ -5160,9 +5170,9 @@ dependencies = [

[[package]]
name = "spanned"
version = "0.1.6"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad48ded9f0734eca7058107cc170767b8758e41e4088fb0020e7ff7ec6b0d92d"
checksum = "ccdf4f5590b7e6fbd4f2e80d442789079a6fff7c12ef921a9de358b7b353098e"
dependencies = [
"bstr",
"color-eyre",
Expand Down Expand Up @@ -5900,11 +5910,11 @@ dependencies = [

[[package]]
name = "ui_test"
version = "0.22.3"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa577a42db0e211a73c069d7dbcae54bc7473a7c5535a564842cbd8a13c0441e"
checksum = "29e5f4ffcbab82453958fbf59990e981b8e8a177dcd60c2bd8f9b52c3036a6e1"
dependencies = [
"annotate-snippets 0.10.2",
"annotate-snippets 0.11.2",
"anyhow",
"bstr",
"cargo-platform",
Expand All @@ -5919,7 +5929,7 @@ dependencies = [
"prettydiff",
"regex",
"rustc_version",
"rustfix 0.6.1",
"rustfix 0.8.1",
"serde",
"serde_json",
"spanned",
Expand Down
56 changes: 54 additions & 2 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,62 @@ document.

## Unreleased / Beta / In Rust Nightly

[66c29b97...master](https://github.com/rust-lang/rust-clippy/compare/66c29b97...master)
[93f0a9a9...master](https://github.com/rust-lang/rust-clippy/compare/93f0a9a9...master)

## Rust 1.78

Current stable, released 2024-05-02

[View all 112 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-01-26T05%3A46%3A23Z..2024-03-07T16%3A25%3A52Z+base%3Amaster)

### New Lints

* [`assigning_clones`]
[#12077](https://github.com/rust-lang/rust-clippy/pull/12077)
* [`mixed_attributes_style`]
[#12354](https://github.com/rust-lang/rust-clippy/pull/12354)
* [`empty_docs`]
[#12342](https://github.com/rust-lang/rust-clippy/pull/12342)
* [`unnecessary_get_then_check`]
[#12339](https://github.com/rust-lang/rust-clippy/pull/12339)
* [`multiple_bound_locations`]
[#12259](https://github.com/rust-lang/rust-clippy/pull/12259)
* [`unnecessary_clippy_cfg`]
[#12303](https://github.com/rust-lang/rust-clippy/pull/12303)
* [`deprecated_clippy_cfg_attr`]
[#12292](https://github.com/rust-lang/rust-clippy/pull/12292)
* [`manual_c_str_literals`]
[#11919](https://github.com/rust-lang/rust-clippy/pull/11919)
* [`ref_as_ptr`]
[#12087](https://github.com/rust-lang/rust-clippy/pull/12087)
* [`lint_groups_priority`]
[#11832](https://github.com/rust-lang/rust-clippy/pull/11832)
* [`unnecessary_result_map_or_else`]
[#12169](https://github.com/rust-lang/rust-clippy/pull/12169)
* [`to_string_trait_impl`]
[#12122](https://github.com/rust-lang/rust-clippy/pull/12122)
* [`incompatible_msrv`]
[#12160](https://github.com/rust-lang/rust-clippy/pull/12160)

### Enhancements

* [`thread_local_initializer_can_be_made_const`]: Now checks the [`msrv`] configuration
[#12405](https://github.com/rust-lang/rust-clippy/pull/12405)
* [`disallowed_macros`]: Code generated by derive macros can no longer allow this lint
[#12267](https://github.com/rust-lang/rust-clippy/pull/12267)
* [`wildcard_imports`]: Add configuration [`allowed-wildcard-imports`] to allow preconfigured wildcards
[#11979](https://github.com/rust-lang/rust-clippy/pull/11979)

### ICE Fixes

* [`ptr_as_ptr`]: No longer ICEs when the cast source is a function call to a local variable
[#12617](https://github.com/rust-lang/rust-clippy/pull/12617)
* [`cast_sign_loss`]: Avoids an infinite loop when casting two chained `.unwrap()` calls
[#12508](https://github.com/rust-lang/rust-clippy/pull/12508)

## Rust 1.77

Current stable, released 2024-03-18
Released 2024-03-18

[View all 93 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2023-12-16T18%3A20%3A00Z..2024-01-25T18%3A15%3A56Z+base%3Amaster)

Expand Down Expand Up @@ -5891,6 +5942,7 @@ Released 2018-09-13
[`allow-print-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-print-in-tests
[`allow-private-module-inception`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-private-module-inception
[`allow-unwrap-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-unwrap-in-tests
[`allow-useless-vec-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-useless-vec-in-tests
[`allowed-dotfiles`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-dotfiles
[`allowed-duplicate-crates`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-duplicate-crates
[`allowed-idents-below-min-chars`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allowed-idents-below-min-chars
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.1.79"
version = "0.1.80"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down Expand Up @@ -30,7 +30,7 @@ color-print = "0.3.4"
anstream = "0.6.0"

[dev-dependencies]
ui_test = "0.22.2"
ui_test = "0.23"
regex = "1.5.5"
toml = "0.7.3"
walkdir = "2.3"
Expand Down
8 changes: 4 additions & 4 deletions src/tools/clippy/book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ This is good, because it makes writing this particular lint less complicated.
We have to make this decision with every new Clippy lint. It boils down to using
either [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].

In short, the `LateLintPass` has access to type information while the
`EarlyLintPass` doesn't. If you don't need access to type information, use the
`EarlyLintPass`. The `EarlyLintPass` is also faster. However, linting speed
hasn't really been a concern with Clippy so far.
In short, the `EarlyLintPass` runs before type checking and
[HIR](https://rustc-dev-guide.rust-lang.org/hir.html) lowering and the `LateLintPass`
has access to type information. Consider using the `LateLintPass` unless you need
something specific from the `EarlyLintPass`.

Since we don't need type information for checking the function name, we used
`--pass=early` when running the new lint automation and all the imports were
Expand Down
15 changes: 13 additions & 2 deletions src/tools/clippy/book/src/lint_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ Whether `unwrap` should be allowed in test functions or `#[cfg(test)]`
* [`unwrap_used`](https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used)


## `allow-useless-vec-in-tests`
Whether `useless_vec` should ignore test functions or `#[cfg(test)]`

**Default Value:** `false`

---
**Affected lints:**
* [`useless_vec`](https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec)


## `allowed-dotfiles`
Additional dotfiles (files or directories starting with a dot) to allow

Expand Down Expand Up @@ -506,13 +516,14 @@ The maximum byte size a `Future` can have, before it triggers the `clippy::large


## `ignore-interior-mutability`
A list of paths to types that should be treated like `Arc`, i.e. ignored but
for the generic parameters for determining interior mutability
A list of paths to types that should be treated as if they do not contain interior mutability

**Default Value:** `["bytes::Bytes"]`

---
**Affected lints:**
* [`borrow_interior_mutable_const`](https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const)
* [`declare_interior_mutable_const`](https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const)
* [`ifs_same_cond`](https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond)
* [`mutable_key_type`](https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type)

Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_config"
version = "0.1.79"
version = "0.1.80"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
9 changes: 6 additions & 3 deletions src/tools/clippy/clippy_config/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,17 @@ define_Conf! {
///
/// Whether print macros (ex. `println!`) should be allowed in test functions or `#[cfg(test)]`
(allow_print_in_tests: bool = false),
/// Lint: USELESS_VEC.
///
/// Whether `useless_vec` should ignore test functions or `#[cfg(test)]`
(allow_useless_vec_in_tests: bool = false),
/// Lint: RESULT_LARGE_ERR.
///
/// The maximum size of the `Err`-variant in a `Result` returned from a function
(large_error_threshold: u64 = 128),
/// Lint: MUTABLE_KEY_TYPE, IFS_SAME_COND.
/// Lint: MUTABLE_KEY_TYPE, IFS_SAME_COND, BORROW_INTERIOR_MUTABLE_CONST, DECLARE_INTERIOR_MUTABLE_CONST.
///
/// A list of paths to types that should be treated like `Arc`, i.e. ignored but
/// for the generic parameters for determining interior mutability
/// A list of paths to types that should be treated as if they do not contain interior mutability
(ignore_interior_mutability: Vec<String> = Vec::from(["bytes::Bytes".into()])),
/// Lint: UNINLINED_FORMAT_ARGS.
///
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_config/src/msrvs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ msrv_aliases! {
1,70,0 { OPTION_RESULT_IS_VARIANT_AND, BINARY_HEAP_RETAIN }
1,68,0 { PATH_MAIN_SEPARATOR_STR }
1,65,0 { LET_ELSE, POINTER_CAST_CONSTNESS }
1,63,0 { ASSIGNING_CLONES }
1,63,0 { CLONE_INTO }
1,62,0 { BOOL_THEN_SOME, DEFAULT_ENUM_ATTRIBUTE }
1,59,0 { THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST }
1,58,0 { FORMAT_ARGS_CAPTURE, PATTERN_TRAIT_CHAR_ARRAY }
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_lints"
version = "0.1.79"
version = "0.1.80"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/assigning_clones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare_clippy_lint! {
/// a.clone_from(&b);
/// }
/// ```
#[clippy::version = "1.77.0"]
#[clippy::version = "1.78.0"]
pub ASSIGNING_CLONES,
perf,
"assigning the result of cloning may be inefficient"
Expand Down Expand Up @@ -153,7 +153,7 @@ fn extract_call<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option<
fn is_ok_to_suggest<'tcx>(cx: &LateContext<'tcx>, lhs: &Expr<'tcx>, call: &CallCandidate<'tcx>, msrv: &Msrv) -> bool {
// For calls to .to_owned we suggest using .clone_into(), which was only stablilized in 1.63.
// If the current MSRV is below that, don't suggest the lint.
if !msrv.meets(msrvs::ASSIGNING_CLONES) && matches!(call.target, TargetTrait::ToOwned) {
if !msrv.meets(msrvs::CLONE_INTO) && matches!(call.target, TargetTrait::ToOwned) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/box_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ fn given_type(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
if let Some(index) = args.iter().position(|arg| arg.hir_id == expr.hir_id)
&& let Some(sig) = expr_sig(cx, path)
&& let Some(input) = sig.input(index)
&& !cx.typeck_results().expr_ty_adjusted(expr).boxed_ty().is_trait()
&& let Some(input_ty) = input.no_bound_vars()
{
input.no_bound_vars().is_some()
input_ty == cx.typeck_results().expr_ty_adjusted(expr)
} else {
false
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/cargo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ declare_clippy_lint! {
/// pedantic = { level = "warn", priority = -1 }
/// similar_names = "allow"
/// ```
#[clippy::version = "1.76.0"]
#[clippy::version = "1.78.0"]
pub LINT_GROUPS_PRIORITY,
correctness,
"a lint group in `Cargo.toml` at the same priority as a lint"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,14 @@ fn apply_reductions(cx: &LateContext<'_>, nbits: u64, expr: &Expr<'_>, signed: b
get_constant_bits(cx, right).map_or(0, |b| b.saturating_sub(1))
})
},
BinOpKind::Rem | BinOpKind::BitAnd => get_constant_bits(cx, right)
BinOpKind::Rem => get_constant_bits(cx, right)
.unwrap_or(u64::MAX)
.min(apply_reductions(cx, nbits, left, signed)),
BinOpKind::BitAnd => get_constant_bits(cx, right)
.unwrap_or(u64::MAX)
.min(get_constant_bits(cx, left).unwrap_or(u64::MAX))
.min(apply_reductions(cx, nbits, right, signed))
.min(apply_reductions(cx, nbits, left, signed)),
BinOpKind::Shr => apply_reductions(cx, nbits, left, signed)
.saturating_sub(constant_int(cx, right).map_or(0, |s| u64::try_from(s).unwrap_or_default())),
_ => nbits,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/casts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ declare_clippy_lint! {
/// let a_ref = &1;
/// let a_ptr = std::ptr::from_ref(a_ref);
/// ```
#[clippy::version = "1.77.0"]
#[clippy::version = "1.78.0"]
pub REF_AS_PTR,
pedantic,
"using `as` to cast a reference to pointer"
Expand Down
Loading
Loading