Skip to content

Commit

Permalink
Note array.into_iter() specifically in method probing
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Apr 21, 2021
1 parent c020367 commit 2a97c69
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_typeck/src/check/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2a97c69

Please sign in to comment.