about summary refs log tree commit diff
path: root/src/test/ui/rust-2021/array-into-iter-ambiguous.fixed
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-08-31 11:20:32 +0000
committerbors <bors@rust-lang.org>2021-08-31 11:20:32 +0000
commit76d18cfb8945f824c8777e04981e930d2037954e (patch)
tree9f4dba058543f58edd2637684793081670592a2d /src/test/ui/rust-2021/array-into-iter-ambiguous.fixed
parentfe37929e4cba2c5c21e6805805769630c736bc3d (diff)
parentfeafda8cd3f98e5ebb0a2637918180722dec4799 (diff)
Auto merge of #88527 - m-ou-se:rollup-az6xtc5, r=m-ou-se
Rollup of 14 pull requests

Successful merges:

 - #88394 (Document `std::env::current_exe` possible rename behaviour)
 - #88406 (Tait nest infer test)
 - #88408 (Add inference cycle TAIT test)
 - #88409 (Add auto trait leakage TAIT test)
 - #88413 (Add weird return types TAIT test)
 - #88450 (fix(rustc_parse): correct span in `maybe_whole_expr!`)
 - #88462 (rustdoc: Stop using resolver for macro loading)
 - #88465 (Adding examples to docs of `std::time` module)
 - #88486 (Remove unused arena macro args)
 - #88492 (Use MaybeUninit::write in functor.rs)
 - #88496 (Fix prelude collision lint suggestion for generics with lifetimes)
 - #88497 (Fix prelude collision suggestions for glob imported traits. )
 - #88503 (Warn when [T; N].into_iter() is ambiguous in the new edition. )
 - #88509 (Don't suggest extra <> in dyn suggestion.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui/rust-2021/array-into-iter-ambiguous.fixed')
-rw-r--r--src/test/ui/rust-2021/array-into-iter-ambiguous.fixed27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/rust-2021/array-into-iter-ambiguous.fixed b/src/test/ui/rust-2021/array-into-iter-ambiguous.fixed
new file mode 100644
index 00000000000..76f661baed7
--- /dev/null
+++ b/src/test/ui/rust-2021/array-into-iter-ambiguous.fixed
@@ -0,0 +1,27 @@
+// See https://github.com/rust-lang/rust/issues/88475
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(array_into_iter)]
+#![allow(unused)]
+
+struct FooIter;
+
+trait MyIntoIter {
+    fn into_iter(self) -> FooIter;
+}
+
+impl<T, const N: usize> MyIntoIter for [T; N] {
+    fn into_iter(self) -> FooIter {
+        FooIter
+    }
+}
+
+struct Point;
+
+pub fn main() {
+    let points: [Point; 1] = [Point];
+    let y = MyIntoIter::into_iter(points);
+    //~^ WARNING trait method `into_iter` will become ambiguous in Rust 2021
+    //~| WARNING this changes meaning in Rust 2021
+}