Skip to content

Commit e22ca1a

Browse files
committed
Auto merge of rust-lang#3506 - rust-lang:rustup-2024-04-24, r=RalfJung
Automatic Rustup
2 parents 4646433 + ff8d7a5 commit e22ca1a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

clippy_lints/src/functions/must_use.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut DefIdSet)
185185
if let hir::PatKind::Wild = pat.kind {
186186
return false; // ignore `_` patterns
187187
}
188-
if cx.tcx.has_typeck_results(pat.hir_id.owner.to_def_id()) {
188+
if cx.tcx.has_typeck_results(pat.hir_id.owner.def_id) {
189189
is_mutable_ty(cx, cx.tcx.typeck(pat.hir_id.owner.def_id).pat_ty(pat), tys)
190190
} else {
191191
false
@@ -233,7 +233,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
233233
Call(_, args) => {
234234
let mut tys = DefIdSet::default();
235235
for arg in args {
236-
if cx.tcx.has_typeck_results(arg.hir_id.owner.to_def_id())
236+
if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id)
237237
&& is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys)
238238
&& is_mutated_static(arg)
239239
{
@@ -246,7 +246,7 @@ fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bo
246246
MethodCall(_, receiver, args, _) => {
247247
let mut tys = DefIdSet::default();
248248
for arg in std::iter::once(receiver).chain(args.iter()) {
249-
if cx.tcx.has_typeck_results(arg.hir_id.owner.to_def_id())
249+
if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id)
250250
&& is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys)
251251
&& is_mutated_static(arg)
252252
{

tests/ui/cfg_attr_rustfmt.fixed

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn foo(
1616

1717
fn skip_on_statements() {
1818
#[rustfmt::skip]
19-
5+3;
19+
{ 5+3; }
2020
}
2121

2222
#[rustfmt::skip]
@@ -33,11 +33,11 @@ mod foo {
3333
#[clippy::msrv = "1.29"]
3434
fn msrv_1_29() {
3535
#[cfg_attr(rustfmt, rustfmt::skip)]
36-
1+29;
36+
{ 1+29; }
3737
}
3838

3939
#[clippy::msrv = "1.30"]
4040
fn msrv_1_30() {
4141
#[rustfmt::skip]
42-
1+30;
42+
{ 1+30; }
4343
}

tests/ui/cfg_attr_rustfmt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn foo(
1616

1717
fn skip_on_statements() {
1818
#[cfg_attr(rustfmt, rustfmt::skip)]
19-
5+3;
19+
{ 5+3; }
2020
}
2121

2222
#[cfg_attr(rustfmt, rustfmt_skip)]
@@ -33,11 +33,11 @@ mod foo {
3333
#[clippy::msrv = "1.29"]
3434
fn msrv_1_29() {
3535
#[cfg_attr(rustfmt, rustfmt::skip)]
36-
1+29;
36+
{ 1+29; }
3737
}
3838

3939
#[clippy::msrv = "1.30"]
4040
fn msrv_1_30() {
4141
#[cfg_attr(rustfmt, rustfmt::skip)]
42-
1+30;
42+
{ 1+30; }
4343
}

0 commit comments

Comments
 (0)