mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
Note array.into_iter() specifically in method probing
This commit is contained in:
parent
c020367b82
commit
2a97c690bc
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user