]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rust-2021/array-into-iter-ambiguous.fixed
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / rust-2021 / array-into-iter-ambiguous.fixed
1 // See https://github.com/rust-lang/rust/issues/88475
2 // run-rustfix
3 // edition:2018
4 // check-pass
5 #![warn(array_into_iter)]
6 #![allow(unused)]
7
8 struct FooIter;
9
10 trait MyIntoIter {
11     fn into_iter(self) -> FooIter;
12 }
13
14 impl<T, const N: usize> MyIntoIter for [T; N] {
15     fn into_iter(self) -> FooIter {
16         FooIter
17     }
18 }
19
20 struct Point;
21
22 pub fn main() {
23     let points: [Point; 1] = [Point];
24     let y = MyIntoIter::into_iter(points);
25     //~^ WARNING trait method `into_iter` will become ambiguous in Rust 2021
26     //~| WARNING this changes meaning in Rust 2021
27 }