2023-10-06 15:35:45 +00:00
|
|
|
error: `IntoIterator` implemented for a reference type without an `iter` method
|
2024-01-11 16:27:03 +00:00
|
|
|
--> $DIR/into_iter_without_iter.rs:9:1
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | / impl<'a> IntoIterator for &'a S1 {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL | |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | type IntoIter = std::slice::Iter<'a, u8>;
|
|
|
|
LL | | type Item = &'a u8;
|
2023-10-06 15:35:45 +00:00
|
|
|
... |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::into-iter-without-iter` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::into_iter_without_iter)]`
|
|
|
|
help: consider implementing `iter`
|
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL +
|
|
|
|
LL + impl S1 {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL + fn iter(&self) -> std::slice::Iter<'a, u8> {
|
|
|
|
LL + <&Self as IntoIterator>::into_iter(self)
|
|
|
|
LL + }
|
|
|
|
LL + }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: `IntoIterator` implemented for a reference type without an `iter_mut` method
|
2024-01-11 16:27:03 +00:00
|
|
|
--> $DIR/into_iter_without_iter.rs:17:1
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | / impl<'a> IntoIterator for &'a mut S1 {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL | |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | type IntoIter = std::slice::IterMut<'a, u8>;
|
|
|
|
LL | | type Item = &'a mut u8;
|
2023-10-06 15:35:45 +00:00
|
|
|
... |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
|
|
|
help: consider implementing `iter_mut`
|
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL +
|
|
|
|
LL + impl S1 {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL + fn iter_mut(&mut self) -> std::slice::IterMut<'a, u8> {
|
|
|
|
LL + <&mut Self as IntoIterator>::into_iter(self)
|
|
|
|
LL + }
|
|
|
|
LL + }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: `IntoIterator` implemented for a reference type without an `iter` method
|
2024-01-11 16:27:03 +00:00
|
|
|
--> $DIR/into_iter_without_iter.rs:27:1
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | / impl<'a, T> IntoIterator for &'a S2<T> {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL | |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | type IntoIter = std::slice::Iter<'a, T>;
|
|
|
|
LL | | type Item = &'a T;
|
2023-10-06 15:35:45 +00:00
|
|
|
... |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
|
|
|
help: consider implementing `iter`
|
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL +
|
|
|
|
LL + impl S2<T> {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL + fn iter(&self) -> std::slice::Iter<'a, T> {
|
|
|
|
LL + <&Self as IntoIterator>::into_iter(self)
|
|
|
|
LL + }
|
|
|
|
LL + }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: `IntoIterator` implemented for a reference type without an `iter_mut` method
|
2024-01-11 16:27:03 +00:00
|
|
|
--> $DIR/into_iter_without_iter.rs:35:1
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | / impl<'a, T> IntoIterator for &'a mut S2<T> {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL | |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | type IntoIter = std::slice::IterMut<'a, T>;
|
|
|
|
LL | | type Item = &'a mut T;
|
2023-10-06 15:35:45 +00:00
|
|
|
... |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
|
|
|
help: consider implementing `iter_mut`
|
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL +
|
|
|
|
LL + impl S2<T> {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL + fn iter_mut(&mut self) -> std::slice::IterMut<'a, T> {
|
|
|
|
LL + <&mut Self as IntoIterator>::into_iter(self)
|
|
|
|
LL + }
|
|
|
|
LL + }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: `IntoIterator` implemented for a reference type without an `iter_mut` method
|
2024-01-11 16:27:03 +00:00
|
|
|
--> $DIR/into_iter_without_iter.rs:86:1
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | / impl<'a, T> IntoIterator for &mut S4<'a, T> {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL | |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | type IntoIter = std::slice::IterMut<'a, T>;
|
|
|
|
LL | | type Item = &'a mut T;
|
2023-10-06 15:35:45 +00:00
|
|
|
... |
|
2023-11-02 16:35:56 +00:00
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
2023-10-06 15:35:45 +00:00
|
|
|
|
|
|
|
|
help: consider implementing `iter_mut`
|
|
|
|
|
|
2023-11-02 16:35:56 +00:00
|
|
|
LL +
|
|
|
|
LL + impl S4<'a, T> {
|
2023-10-06 15:35:45 +00:00
|
|
|
LL + fn iter_mut(&mut self) -> std::slice::IterMut<'a, T> {
|
|
|
|
LL + <&mut Self as IntoIterator>::into_iter(self)
|
|
|
|
LL + }
|
|
|
|
LL + }
|
|
|
|
|
|
|
|
|
|
2024-01-11 16:27:03 +00:00
|
|
|
error: `IntoIterator` implemented for a reference type without an `iter` method
|
|
|
|
--> $DIR/into_iter_without_iter.rs:120:9
|
|
|
|
|
|
|
|
|
LL | / impl<'a> IntoIterator for &'a Issue12037 {
|
|
|
|
LL | | type IntoIter = std::slice::Iter<'a, u8>;
|
|
|
|
LL | | type Item = &'a u8;
|
|
|
|
LL | | fn into_iter(self) -> Self::IntoIter {
|
|
|
|
LL | | todo!()
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_________^
|
|
|
|
...
|
|
|
|
LL | generate_impl!();
|
|
|
|
| ---------------- in this macro invocation
|
|
|
|
|
|
|
|
|
= note: this error originates in the macro `generate_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
help: consider implementing `iter`
|
|
|
|
|
|
|
|
|
LL ~
|
|
|
|
LL + impl Issue12037 {
|
|
|
|
LL + fn iter(&self) -> std::slice::Iter<'a, u8> {
|
|
|
|
LL + <&Self as IntoIterator>::into_iter(self)
|
|
|
|
LL + }
|
|
|
|
LL + }
|
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2023-10-06 15:35:45 +00:00
|
|
|
|