Skip to content

Commit 3641b0c

Browse files
committed
Auto merge of rust-lang#99948 - Dylan-DPC:rollup-ed5136t, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - rust-lang#99311 (change maybe_body_owned_by to take local def id) - rust-lang#99862 (Improve type mismatch w/ function signatures) - rust-lang#99895 (don't call type ascription "cast") - rust-lang#99900 (remove some manual hash stable impls) - rust-lang#99903 (Add diagnostic when using public instead of pub) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ab7e555 + 6c1110e commit 3641b0c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

clippy_lints/src/methods/suspicious_map.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ pub fn check<'tcx>(cx: &LateContext<'tcx>, expr: &hir::Expr<'_>, count_recv: &hi
1212
if_chain! {
1313
if is_trait_method(cx, count_recv, sym::Iterator);
1414
let closure = expr_or_init(cx, map_arg);
15-
if let Some(body_id) = cx.tcx.hir().maybe_body_owned_by(closure.hir_id);
15+
if let Some(def_id) = cx.tcx.hir().opt_local_def_id(closure.hir_id);
16+
if let Some(body_id) = cx.tcx.hir().maybe_body_owned_by(def_id);
1617
let closure_body = cx.tcx.hir().body(body_id);
1718
if !cx.typeck_results().expr_ty(&closure_body.value).is_unit();
1819
then {

clippy_lints/src/utils/author.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'tcx> LateLintPass<'tcx> for Author {
138138

139139
fn check_item(cx: &LateContext<'_>, hir_id: HirId) {
140140
let hir = cx.tcx.hir();
141-
if let Some(body_id) = hir.maybe_body_owned_by(hir_id) {
141+
if let Some(body_id) = hir.maybe_body_owned_by(hir_id.expect_owner()) {
142142
check_node(cx, hir_id, |v| {
143143
v.expr(&v.bind("expr", &hir.body(body_id).value));
144144
});

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ pub fn is_integer_const(cx: &LateContext<'_>, e: &Expr<'_>, value: u128) -> bool
13531353
if is_integer_literal(e, value) {
13541354
return true;
13551355
}
1356-
let enclosing_body = cx.tcx.hir().local_def_id(cx.tcx.hir().enclosing_body_owner(e.hir_id));
1356+
let enclosing_body = cx.tcx.hir().enclosing_body_owner(e.hir_id);
13571357
if let Some((Constant::Int(v), _)) = constant(cx, cx.tcx.typeck(enclosing_body), e) {
13581358
return value == v;
13591359
}

0 commit comments

Comments
 (0)