Skip to content

Commit 2a97c69

Browse files
committed
Note array.into_iter() specifically in method probing
1 parent c020367 commit 2a97c69

File tree

1 file changed

+1
-0
lines changed
  • compiler/rustc_typeck/src/check/method

1 file changed

+1
-0
lines changed

compiler/rustc_typeck/src/check/method/probe.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
14631463
TraitCandidate(trait_ref) => {
14641464
if let Some(method_name) = self.method_name {
14651465
// Some trait methods are excluded for arrays before 2021.
1466+
// (`array.into_iter()` wants a slice iterator for compatibility.)
14661467
if self_ty.is_array() && !method_name.span.rust_2021() {
14671468
let trait_def = self.tcx.trait_def(trait_ref.def_id);
14681469
if trait_def.skip_array_during_method_dispatch {

0 commit comments

Comments
 (0)