Skip to content

Commit 03a5b6b

Browse files
authored
r? @ghost changelog: none
2 parents 549107d + 8a91bbf commit 03a5b6b

28 files changed

+112
-89
lines changed

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ impl TyCoercionStability {
853853
continue;
854854
},
855855
ty::Param(_) if for_return => Self::Deref,
856-
ty::Alias(ty::Weak | ty::Inherent, _) => unreachable!("should have been normalized away above"),
856+
ty::Alias(ty::Free | ty::Inherent, _) => unreachable!("should have been normalized away above"),
857857
ty::Alias(ty::Projection, _) if !for_return && ty.has_non_region_param() => Self::Reborrow,
858858
ty::Infer(_)
859859
| ty::Error(_)

clippy_lints/src/missing_const_for_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ fn fn_inputs_has_impl_trait_ty(cx: &LateContext<'_>, def_id: LocalDefId) -> bool
197197
inputs.iter().any(|input| {
198198
matches!(
199199
input.kind(),
200-
ty::Alias(ty::AliasTyKind::Weak, alias_ty) if cx.tcx.type_of(alias_ty.def_id).skip_binder().is_impl_trait()
200+
ty::Alias(ty::AliasTyKind::Free, alias_ty) if cx.tcx.type_of(alias_ty.def_id).skip_binder().is_impl_trait()
201201
)
202202
})
203203
}

clippy_utils/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain:
88

99
<!-- begin autogenerated nightly -->
1010
```
11-
nightly-2025-04-22
11+
nightly-2025-05-01
1212
```
1313
<!-- end autogenerated nightly -->
1414

clippy_utils/src/hir_utils.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,11 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
11171117
self.hash_const_arg(s);
11181118
self.hash_const_arg(e);
11191119
},
1120+
TyPatKind::Or(variants) => {
1121+
for variant in variants {
1122+
self.hash_ty_pat(variant);
1123+
}
1124+
},
11201125
TyPatKind::Err(_) => {},
11211126
}
11221127
}

clippy_utils/src/source.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ pub trait SpanRangeExt: SpanRange {
142142
map_range(cx.sess().source_map(), self.into_range(), f)
143143
}
144144

145+
#[allow(rustdoc::invalid_rust_codeblocks, reason = "The codeblock is intentionally broken")]
145146
/// Extends the range to include all preceding whitespace characters, unless there
146147
/// are non-whitespace characters left on the same line after `self`.
147148
///

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[toolchain]
22
# begin autogenerated nightly
3-
channel = "nightly-2025-04-22"
3+
channel = "nightly-2025-05-01"
44
# end autogenerated nightly
55
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]
66
profile = "minimal"

tests/ui/blocks_in_conditions.fixed

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
//@aux-build:proc_macro_attr.rs
22

33
#![warn(clippy::blocks_in_conditions)]
4-
#![allow(unused, clippy::needless_if, clippy::missing_transmute_annotations)]
4+
#![allow(
5+
unused,
6+
unnecessary_transmutes,
7+
clippy::needless_if,
8+
clippy::missing_transmute_annotations
9+
)]
510
#![warn(clippy::nonminimal_bool)]
611

712
macro_rules! blocky {

tests/ui/blocks_in_conditions.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
//@aux-build:proc_macro_attr.rs
22

33
#![warn(clippy::blocks_in_conditions)]
4-
#![allow(unused, clippy::needless_if, clippy::missing_transmute_annotations)]
4+
#![allow(
5+
unused,
6+
unnecessary_transmutes,
7+
clippy::needless_if,
8+
clippy::missing_transmute_annotations
9+
)]
510
#![warn(clippy::nonminimal_bool)]
611

712
macro_rules! blocky {

tests/ui/blocks_in_conditions.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: in an `if` condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
2-
--> tests/ui/blocks_in_conditions.rs:25:5
2+
--> tests/ui/blocks_in_conditions.rs:30:5
33
|
44
LL | / if {
55
LL | |
@@ -20,13 +20,13 @@ LL ~ }; if res {
2020
|
2121

2222
error: omit braces around single expression condition
23-
--> tests/ui/blocks_in_conditions.rs:37:8
23+
--> tests/ui/blocks_in_conditions.rs:42:8
2424
|
2525
LL | if { true } { 6 } else { 10 }
2626
| ^^^^^^^^ help: try: `true`
2727

2828
error: this boolean expression can be simplified
29-
--> tests/ui/blocks_in_conditions.rs:43:8
29+
--> tests/ui/blocks_in_conditions.rs:48:8
3030
|
3131
LL | if true && x == 3 { 6 } else { 10 }
3232
| ^^^^^^^^^^^^^^ help: try: `x == 3`

tests/ui/checked_unwrap/simple_conditionals.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ LL | if result.is_ok() {
236236
LL | result.as_mut().unwrap();
237237
| ^^^^^^^^^^^^^^^^^^^^^^^^
238238

239-
error: creating a shared reference to mutable static is discouraged
239+
error: creating a shared reference to mutable static
240240
--> tests/ui/checked_unwrap/simple_conditionals.rs:183:12
241241
|
242242
LL | if X.is_some() {

0 commit comments

Comments
 (0)