Skip to content

Commit 25a9d62

Browse files
committed
Arbitrary self types v2: roll loop.
Just for slightly more concise code - no functional changes. r? @wesleywiser
1 parent eedc229 commit 25a9d62

File tree

1 file changed

+10
-17
lines changed
  • compiler/rustc_hir_typeck/src/method

1 file changed

+10
-17
lines changed

compiler/rustc_hir_typeck/src/method/probe.rs

+10-17
Original file line numberDiff line numberDiff line change
@@ -1230,23 +1230,16 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
12301230
if let Some(by_value_pick) = by_value_pick {
12311231
if let Ok(by_value_pick) = by_value_pick.as_ref() {
12321232
if by_value_pick.kind == PickKind::InherentImplPick {
1233-
if let Err(e) = self.check_for_shadowed_autorefd_method(
1234-
by_value_pick,
1235-
step,
1236-
self_ty,
1237-
hir::Mutability::Not,
1238-
track_unstable_candidates,
1239-
) {
1240-
return Some(Err(e));
1241-
}
1242-
if let Err(e) = self.check_for_shadowed_autorefd_method(
1243-
by_value_pick,
1244-
step,
1245-
self_ty,
1246-
hir::Mutability::Mut,
1247-
track_unstable_candidates,
1248-
) {
1249-
return Some(Err(e));
1233+
for mutbl in [hir::Mutability::Not, hir::Mutability::Mut] {
1234+
if let Err(e) = self.check_for_shadowed_autorefd_method(
1235+
by_value_pick,
1236+
step,
1237+
self_ty,
1238+
mutbl,
1239+
track_unstable_candidates,
1240+
) {
1241+
return Some(Err(e));
1242+
}
12501243
}
12511244
}
12521245
}

0 commit comments

Comments
 (0)