Skip to content

Commit 2522a03

Browse files
committed
Run CI checks for Rust 2024 as well
4 parents 540e116 + 0c1ef98 + 8052451 + 2298a67 commit 2522a03

File tree

72 files changed

+1176
-162
lines changed

Some content is hidden

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

72 files changed

+1176
-162
lines changed

.github/workflows/clippy.yml

+49
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,52 @@ jobs:
7373
run: .github/driver.sh
7474
env:
7575
OS: ${{ runner.os }}
76+
77+
base-2024:
78+
# NOTE: If you modify this job, make sure you copy the changes to clippy_bors.yml
79+
runs-on: ubuntu-latest
80+
81+
steps:
82+
# Setup
83+
- name: Checkout
84+
uses: actions/checkout@v4
85+
86+
- name: Select Rust 2024 edition
87+
run: |
88+
for i in clippy_config clippy_dev clippy_lints clippy_utils lintcheck; do
89+
sed -i \
90+
-e '1icargo-features = ["edition2024"]' \
91+
-e 's/edition = "2021"/edition = "2024"/' \
92+
$i/Cargo.toml
93+
done
94+
95+
- name: Install toolchain
96+
run: rustup show active-toolchain
97+
98+
# Run
99+
- name: Build
100+
run: cargo build --tests --features internal
101+
102+
- name: Test
103+
run: cargo test --features internal
104+
105+
- name: Test clippy_lints
106+
run: cargo test --features internal
107+
working-directory: clippy_lints
108+
109+
- name: Test clippy_utils
110+
run: cargo test
111+
working-directory: clippy_utils
112+
113+
- name: Test rustc_tools_util
114+
run: cargo test
115+
working-directory: rustc_tools_util
116+
117+
- name: Test clippy_dev
118+
run: cargo test
119+
working-directory: clippy_dev
120+
121+
- name: Test clippy-driver
122+
run: .github/driver.sh
123+
env:
124+
OS: ${{ runner.os }}

.github/workflows/clippy_bors.yml

+17
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,19 @@ jobs:
5757
include:
5858
- os: ubuntu-latest
5959
host: x86_64-unknown-linux-gnu
60+
edition: 2021
61+
- os: ubuntu-latest
62+
host: x86_64-unknown-linux-gnu
63+
edition: 2024
6064
- os: ubuntu-latest
6165
host: i686-unknown-linux-gnu
66+
edition: 2021
6267
- os: windows-latest
6368
host: x86_64-pc-windows-msvc
69+
edition: 2021
6470
- os: macos-13
6571
host: x86_64-apple-darwin
72+
edition: 2021
6673

6774
runs-on: ${{ matrix.os }}
6875

@@ -79,6 +86,16 @@ jobs:
7986
sudo apt-get update
8087
sudo apt-get install gcc-multilib zlib1g-dev:i386
8188
89+
- name: Select Rust 2024 edition
90+
if: matrix.edition == 2024
91+
run: |
92+
for i in clippy_config clippy_dev clippy_lints clippy_utils lintcheck; do
93+
sed -i \
94+
-e '1icargo-features = ["edition2024"]' \
95+
-e 's/edition = "2021"/edition = "2024"/' \
96+
$i/Cargo.toml
97+
done
98+
8299
- name: Install toolchain
83100
run: |
84101
rustup set default-host ${{ matrix.host }}

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5689,13 +5689,15 @@ Released 2018-09-13
56895689
[`manual_unwrap_or_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default
56905690
[`manual_while_let_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some
56915691
[`many_single_char_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
5692+
[`map_all_any_identity`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity
56925693
[`map_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
56935694
[`map_collect_result_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_collect_result_unit
56945695
[`map_entry`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
56955696
[`map_err_ignore`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_err_ignore
56965697
[`map_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
56975698
[`map_identity`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_identity
56985699
[`map_unwrap_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or
5700+
[`map_with_unused_argument_over_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_with_unused_argument_over_ranges
56995701
[`match_as_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_as_ref
57005702
[`match_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_bool
57015703
[`match_like_matches_macro`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro

book/src/lint_configuration.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ default configuration of Clippy. By default, any configuration will replace the
456456
* `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
457457
* `doc-valid-idents = ["ClipPy", ".."]` would append `ClipPy` to the default list.
458458

459-
**Default Value:** `["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "MHz", "GHz", "THz", "AccessKit", "CoreFoundation", "CoreGraphics", "CoreText", "DevOps", "Direct2D", "Direct3D", "DirectWrite", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PostScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenAL", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "OpenType", "WebGL", "WebGL2", "WebGPU", "WebRTC", "WebSocket", "WebTransport", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"]`
459+
**Default Value:** `["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "MHz", "GHz", "THz", "AccessKit", "CoAP", "CoreFoundation", "CoreGraphics", "CoreText", "DevOps", "Direct2D", "Direct3D", "DirectWrite", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PostScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenAL", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "OpenType", "WebGL", "WebGL2", "WebGPU", "WebRTC", "WebSocket", "WebTransport", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "NetBSD", "OpenBSD", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"]`
460460

461461
---
462462
**Affected lints:**
@@ -710,6 +710,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
710710
* [`manual_try_fold`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold)
711711
* [`map_clone`](https://rust-lang.github.io/rust-clippy/master/index.html#map_clone)
712712
* [`map_unwrap_or`](https://rust-lang.github.io/rust-clippy/master/index.html#map_unwrap_or)
713+
* [`map_with_unused_argument_over_ranges`](https://rust-lang.github.io/rust-clippy/master/index.html#map_with_unused_argument_over_ranges)
713714
* [`match_like_matches_macro`](https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro)
714715
* [`mem_replace_with_default`](https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default)
715716
* [`missing_const_for_fn`](https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn)

clippy_config/src/conf.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const DEFAULT_DOC_VALID_IDENTS: &[&str] = &[
1919
"KiB", "MiB", "GiB", "TiB", "PiB", "EiB",
2020
"MHz", "GHz", "THz",
2121
"AccessKit",
22-
"CoreFoundation", "CoreGraphics", "CoreText",
22+
"CoAP", "CoreFoundation", "CoreGraphics", "CoreText",
2323
"DevOps",
2424
"Direct2D", "Direct3D", "DirectWrite", "DirectX",
2525
"ECMAScript",
@@ -573,6 +573,7 @@ define_Conf! {
573573
manual_try_fold,
574574
map_clone,
575575
map_unwrap_or,
576+
map_with_unused_argument_over_ranges,
576577
match_like_matches_macro,
577578
mem_replace_with_default,
578579
missing_const_for_fn,

clippy_config/src/msrvs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ macro_rules! msrv_aliases {
1919
// names may refer to stabilized feature flags or library items
2020
msrv_aliases! {
2121
1,83,0 { CONST_EXTERN_FN, CONST_FLOAT_BITS_CONV, CONST_FLOAT_CLASSIFY }
22-
1,82,0 { IS_NONE_OR }
22+
1,82,0 { IS_NONE_OR, REPEAT_N }
2323
1,81,0 { LINT_REASONS_STABILIZATION }
2424
1,80,0 { BOX_INTO_ITER}
2525
1,77,0 { C_STR_LITERALS }
@@ -55,7 +55,7 @@ msrv_aliases! {
5555
1,33,0 { UNDERSCORE_IMPORTS }
5656
1,30,0 { ITERATOR_FIND_MAP, TOOL_ATTRIBUTES }
5757
1,29,0 { ITER_FLATTEN }
58-
1,28,0 { FROM_BOOL }
58+
1,28,0 { FROM_BOOL, REPEAT_WITH }
5959
1,27,0 { ITERATOR_TRY_FOLD }
6060
1,26,0 { RANGE_INCLUSIVE, STRING_RETAIN }
6161
1,24,0 { IS_ASCII_DIGIT }

clippy_lints/src/casts/unnecessary_cast.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ fn is_cast_from_ty_alias<'tcx>(cx: &LateContext<'tcx>, expr: impl Visitable<'tcx
268268
if !snippet
269269
.split("->")
270270
.skip(1)
271-
.map(|s| snippet_eq_ty(s, cast_from) || s.split("where").any(|ty| snippet_eq_ty(ty, cast_from)))
272-
.any(|a| a)
271+
.any(|s| snippet_eq_ty(s, cast_from) || s.split("where").any(|ty| snippet_eq_ty(ty, cast_from)))
273272
{
274273
return ControlFlow::Break(());
275274
}

clippy_lints/src/checked_conversions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fn get_types_from_cast<'a>(
232232
// or `to_type::MAX as from_type`
233233
let call_from_cast: Option<(&Expr<'_>, &str)> = if let ExprKind::Cast(limit, from_type) = &expr.kind
234234
// to_type::max_value(), from_type
235-
&& let TyKind::Path(ref from_type_path) = &from_type.kind
235+
&& let TyKind::Path(from_type_path) = &from_type.kind
236236
&& let Some(from_sym) = int_ty_to_sym(from_type_path)
237237
{
238238
Some((limit, from_sym))
@@ -245,7 +245,7 @@ fn get_types_from_cast<'a>(
245245
if let ExprKind::Call(from_func, [limit]) = &expr.kind
246246
// `from_type::from, to_type::max_value()`
247247
// `from_type::from`
248-
&& let ExprKind::Path(ref path) = &from_func.kind
248+
&& let ExprKind::Path(path) = &from_func.kind
249249
&& let Some(from_sym) = get_implementing_type(path, INTS, "from")
250250
{
251251
Some((limit, from_sym))

clippy_lints/src/copy_iterator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ declare_lint_pass!(CopyIterator => [COPY_ITERATOR]);
3737
impl<'tcx> LateLintPass<'tcx> for CopyIterator {
3838
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
3939
if let ItemKind::Impl(Impl {
40-
of_trait: Some(ref trait_ref),
40+
of_trait: Some(trait_ref),
4141
..
4242
}) = item.kind
4343
&& let ty = cx.tcx.type_of(item.owner_id).instantiate_identity()

clippy_lints/src/declared_lints.rs

+2
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,14 @@ pub static LINTS: &[&crate::LintInfo] = &[
416416
crate::methods::MANUAL_SPLIT_ONCE_INFO,
417417
crate::methods::MANUAL_STR_REPEAT_INFO,
418418
crate::methods::MANUAL_TRY_FOLD_INFO,
419+
crate::methods::MAP_ALL_ANY_IDENTITY_INFO,
419420
crate::methods::MAP_CLONE_INFO,
420421
crate::methods::MAP_COLLECT_RESULT_UNIT_INFO,
421422
crate::methods::MAP_ERR_IGNORE_INFO,
422423
crate::methods::MAP_FLATTEN_INFO,
423424
crate::methods::MAP_IDENTITY_INFO,
424425
crate::methods::MAP_UNWRAP_OR_INFO,
426+
crate::methods::MAP_WITH_UNUSED_ARGUMENT_OVER_RANGES_INFO,
425427
crate::methods::MUT_MUTEX_LOCK_INFO,
426428
crate::methods::NAIVE_BYTECOUNT_INFO,
427429
crate::methods::NEEDLESS_AS_BYTES_INFO,

clippy_lints/src/derivable_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ fn check_enum<'tcx>(cx: &LateContext<'tcx>, item: &'tcx Item<'_>, func_expr: &Ex
187187
impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
188188
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
189189
if let ItemKind::Impl(Impl {
190-
of_trait: Some(ref trait_ref),
190+
of_trait: Some(trait_ref),
191191
items: [child],
192192
self_ty,
193193
..

clippy_lints/src/derive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ declare_lint_pass!(Derive => [
202202
impl<'tcx> LateLintPass<'tcx> for Derive {
203203
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
204204
if let ItemKind::Impl(Impl {
205-
of_trait: Some(ref trait_ref),
205+
of_trait: Some(trait_ref),
206206
..
207207
}) = item.kind
208208
{

clippy_lints/src/disallowed_script_idents.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl EarlyLintPass for DisallowedScriptIdents {
8080
let mut symbols: Vec<_> = symbols.iter().collect();
8181
symbols.sort_unstable_by_key(|k| k.1);
8282

83-
for (symbol, &span) in &symbols {
83+
for &(symbol, &span) in &symbols {
8484
// Note: `symbol.as_str()` is an expensive operation, thus should not be called
8585
// more than once for a single symbol.
8686
let symbol_str = symbol.as_str();

clippy_lints/src/empty_drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ declare_lint_pass!(EmptyDrop => [EMPTY_DROP]);
3636
impl LateLintPass<'_> for EmptyDrop {
3737
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
3838
if let ItemKind::Impl(Impl {
39-
of_trait: Some(ref trait_ref),
39+
of_trait: Some(trait_ref),
4040
items: [child],
4141
..
4242
}) = item.kind

clippy_lints/src/functions/ref_option.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use rustc_span::{Span, sym};
1515
fn check_ty<'a>(cx: &LateContext<'a>, param: &rustc_hir::Ty<'a>, param_ty: Ty<'a>, fixes: &mut Vec<(Span, String)>) {
1616
if let ty::Ref(_, opt_ty, Mutability::Not) = param_ty.kind()
1717
&& is_type_diagnostic_item(cx, *opt_ty, sym::Option)
18-
&& let ty::Adt(_, opt_gen) = opt_ty.kind()
19-
&& let [gen] = opt_gen.as_slice()
20-
&& let GenericArgKind::Type(gen_ty) = gen.unpack()
18+
&& let ty::Adt(_, opt_gen_args) = opt_ty.kind()
19+
&& let [gen_arg] = opt_gen_args.as_slice()
20+
&& let GenericArgKind::Type(gen_ty) = gen_arg.unpack()
2121
&& !gen_ty.is_ref()
2222
// Need to gen the original spans, so first parsing mid, and hir parsing afterward
2323
&& let hir::TyKind::Ref(lifetime, hir::MutTy { ty, .. }) = param.kind

clippy_lints/src/large_include_file.rs

+48-15
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use clippy_config::Conf;
22
use clippy_utils::diagnostics::span_lint_and_then;
33
use clippy_utils::macros::root_macro_call_first_node;
4-
use rustc_ast::LitKind;
4+
use clippy_utils::source::snippet_opt;
5+
use rustc_ast::{AttrArgs, AttrArgsEq, AttrKind, Attribute, LitKind};
56
use rustc_hir::{Expr, ExprKind};
67
use rustc_lint::{LateContext, LateLintPass};
78
use rustc_session::impl_lint_pass;
8-
use rustc_span::sym;
9+
use rustc_span::{Span, sym};
910

1011
declare_clippy_lint! {
1112
/// ### What it does
@@ -51,6 +52,24 @@ impl LargeIncludeFile {
5152

5253
impl_lint_pass!(LargeIncludeFile => [LARGE_INCLUDE_FILE]);
5354

55+
impl LargeIncludeFile {
56+
fn emit_lint(&self, cx: &LateContext<'_>, span: Span) {
57+
#[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")]
58+
span_lint_and_then(
59+
cx,
60+
LARGE_INCLUDE_FILE,
61+
span,
62+
"attempted to include a large file",
63+
|diag| {
64+
diag.note(format!(
65+
"the configuration allows a maximum size of {} bytes",
66+
self.max_file_size
67+
));
68+
},
69+
);
70+
}
71+
}
72+
5473
impl LateLintPass<'_> for LargeIncludeFile {
5574
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) {
5675
if let ExprKind::Lit(lit) = &expr.kind
@@ -66,19 +85,33 @@ impl LateLintPass<'_> for LargeIncludeFile {
6685
&& (cx.tcx.is_diagnostic_item(sym::include_bytes_macro, macro_call.def_id)
6786
|| cx.tcx.is_diagnostic_item(sym::include_str_macro, macro_call.def_id))
6887
{
69-
#[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")]
70-
span_lint_and_then(
71-
cx,
72-
LARGE_INCLUDE_FILE,
73-
expr.span.source_callsite(),
74-
"attempted to include a large file",
75-
|diag| {
76-
diag.note(format!(
77-
"the configuration allows a maximum size of {} bytes",
78-
self.max_file_size
79-
));
80-
},
81-
);
88+
self.emit_lint(cx, expr.span.source_callsite());
89+
}
90+
}
91+
92+
fn check_attribute(&mut self, cx: &LateContext<'_>, attr: &Attribute) {
93+
if !attr.span.from_expansion()
94+
// Currently, rustc limits the usage of macro at the top-level of attributes,
95+
// so we don't need to recurse into each level.
96+
&& let AttrKind::Normal(ref normal) = attr.kind
97+
&& let AttrArgs::Eq(_, AttrArgsEq::Hir(ref meta)) = normal.item.args
98+
&& !attr.span.contains(meta.span)
99+
// Since the `include_str` is already expanded at this point, we can only take the
100+
// whole attribute snippet and then modify for our suggestion.
101+
&& let Some(snippet) = snippet_opt(cx, attr.span)
102+
// We cannot remove this because a `#[doc = include_str!("...")]` attribute can
103+
// occupy several lines.
104+
&& let Some(start) = snippet.find('[')
105+
&& let Some(end) = snippet.rfind(']')
106+
&& let snippet = &snippet[start + 1..end]
107+
// We check that the expansion actually comes from `include_str!` and not just from
108+
// another macro.
109+
&& let Some(sub_snippet) = snippet.trim().strip_prefix("doc")
110+
&& let Some(sub_snippet) = sub_snippet.trim().strip_prefix("=")
111+
&& let sub_snippet = sub_snippet.trim()
112+
&& (sub_snippet.starts_with("include_str!") || sub_snippet.starts_with("include_bytes!"))
113+
{
114+
self.emit_lint(cx, attr.span);
82115
}
83116
}
84117
}

clippy_lints/src/len_zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
629629
.filter_by_name_unhygienic(is_empty)
630630
.any(|item| is_is_empty(cx, item))
631631
}),
632-
ty::Alias(ty::Projection, ref proj) => has_is_empty_impl(cx, proj.def_id),
632+
ty::Alias(ty::Projection, proj) => has_is_empty_impl(cx, proj.def_id),
633633
ty::Adt(id, _) => has_is_empty_impl(cx, id.did()),
634634
ty::Array(..) | ty::Slice(..) | ty::Str => true,
635635
_ => false,

clippy_lints/src/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ impl<'tcx> Visitor<'tcx> for RefVisitor<'_, 'tcx> {
425425
self.visit_opaque_ty(opaque);
426426
self.lts.truncate(len);
427427
self.lts.extend(bounds.iter().filter_map(|bound| match bound {
428-
GenericArg::Lifetime(&l) => Some(l),
428+
&GenericArg::Lifetime(l) => Some(l),
429429
_ => None,
430430
}));
431431
},

clippy_lints/src/manual_async_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn captures_all_lifetimes(inputs: &[Ty<'_>], output_lifetimes: &[LifetimeName])
169169
}
170170

171171
fn desugared_async_block<'tcx>(cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) -> Option<&'tcx Body<'tcx>> {
172-
if let Some(Expr {
172+
if let Some(&Expr {
173173
kind: ExprKind::Closure(&Closure { kind, body, .. }),
174174
..
175175
}) = block.expr

clippy_lints/src/matches/match_like_matches.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn find_bool_lit(ex: &ExprKind<'_>) -> Option<bool> {
148148
}) => Some(*b),
149149
ExprKind::Block(
150150
rustc_hir::Block {
151-
stmts: &[],
151+
stmts: [],
152152
expr: Some(exp),
153153
..
154154
},

0 commit comments

Comments
 (0)