about summary refs log tree commit diff
path: root/src/libcore/iter
diff options
context:
space:
mode:
authorLukas Kalbertodt <lukas.kalbertodt@gmail.com>2019-11-01 12:04:18 +0100
committerLukas Kalbertodt <lukas.kalbertodt@gmail.com>2019-11-06 14:43:28 +0100
commitb492c97a31432adde450c9cc8c9d369bbd4d83f2 (patch)
tree4df4cc9e5db61b16a37aa79ae4a33e5704359109 /src/libcore/iter
parentb3a0350c2bf5d93cb734257bbddc8300bef4b851 (diff)
Add future incompatibility lint for `array.into_iter()`
As we might want to add `IntoIterator` impls for arrays in the future,
and since that introduces a breaking change, this lint warns and
suggests using `iter()` instead (which is shorter and more explicit).
Diffstat (limited to 'src/libcore/iter')
-rw-r--r--src/libcore/iter/traits/collect.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcore/iter/traits/collect.rs b/src/libcore/iter/traits/collect.rs
index 00a86417058..bbdb169cac0 100644
--- a/src/libcore/iter/traits/collect.rs
+++ b/src/libcore/iter/traits/collect.rs
@@ -205,6 +205,7 @@ pub trait FromIterator<A>: Sized {
 ///         .collect()
 /// }
 /// ```
+#[rustc_diagnostic_item = "IntoIterator"]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait IntoIterator {
     /// The type of the elements being iterated over.