about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2021-04-21 12:13:55 -0700
committerJosh Stone <jistone@redhat.com>2021-04-21 13:04:59 -0700
commit2a97c690bc56e7e20768d0ce632f0b719bf5ff37 (patch)
tree77a1b7e09b6db2c2f733c6a8fd04654e167d996d
parentc020367b820b982a3c0ac86cedc5be6ed732b2fe (diff)
downloadrust-2a97c690bc56e7e20768d0ce632f0b719bf5ff37.tar.gz
rust-2a97c690bc56e7e20768d0ce632f0b719bf5ff37.zip
Note array.into_iter() specifically in method probing
-rw-r--r--compiler/rustc_typeck/src/check/method/probe.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/check/method/probe.rs b/compiler/rustc_typeck/src/check/method/probe.rs
index 88fd94931e1..e65e66c32f6 100644
--- a/compiler/rustc_typeck/src/check/method/probe.rs
+++ b/compiler/rustc_typeck/src/check/method/probe.rs
@@ -1463,6 +1463,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
                 TraitCandidate(trait_ref) => {
                     if let Some(method_name) = self.method_name {
                         // Some trait methods are excluded for arrays before 2021.
+                        // (`array.into_iter()` wants a slice iterator for compatibility.)
                         if self_ty.is_array() && !method_name.span.rust_2021() {
                             let trait_def = self.tcx.trait_def(trait_ref.def_id);
                             if trait_def.skip_array_during_method_dispatch {