about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/into_iter_without_iter.stderr
blob: a033ff645f49a949d918fba6a0c7e7a0b401343c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
error: `IntoIterator` implemented for a reference type without an `iter` method
  --> tests/ui/into_iter_without_iter.rs:9:1
   |
LL | / impl<'a> IntoIterator for &'a S1 {
LL | |
LL | |     type IntoIter = std::slice::Iter<'a, u8>;
LL | |     type Item = &'a u8;
...  |
LL | | }
   | |_^
   |
   = 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`
   |
LL + 
LL + impl S1 {
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
  --> tests/ui/into_iter_without_iter.rs:17:1
   |
LL | / impl<'a> IntoIterator for &'a mut S1 {
LL | |
LL | |     type IntoIter = std::slice::IterMut<'a, u8>;
LL | |     type Item = &'a mut u8;
...  |
LL | | }
   | |_^
   |
help: consider implementing `iter_mut`
   |
LL + 
LL + impl S1 {
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
  --> tests/ui/into_iter_without_iter.rs:27:1
   |
LL | / impl<'a, T> IntoIterator for &'a S2<T> {
LL | |
LL | |     type IntoIter = std::slice::Iter<'a, T>;
LL | |     type Item = &'a T;
...  |
LL | | }
   | |_^
   |
help: consider implementing `iter`
   |
LL + 
LL + impl S2<T> {
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
  --> tests/ui/into_iter_without_iter.rs:35:1
   |
LL | / impl<'a, T> IntoIterator for &'a mut S2<T> {
LL | |
LL | |     type IntoIter = std::slice::IterMut<'a, T>;
LL | |     type Item = &'a mut T;
...  |
LL | | }
   | |_^
   |
help: consider implementing `iter_mut`
   |
LL + 
LL + impl S2<T> {
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
  --> tests/ui/into_iter_without_iter.rs:86:1
   |
LL | / impl<'a, T> IntoIterator for &mut S4<'a, T> {
LL | |
LL | |     type IntoIter = std::slice::IterMut<'a, T>;
LL | |     type Item = &'a mut T;
...  |
LL | | }
   | |_^
   |
help: consider implementing `iter_mut`
   |
LL + 
LL + impl S4<'a, T> {
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` method
  --> tests/ui/into_iter_without_iter.rs:120:9
   |
LL | /         impl<'a> IntoIterator for &'a Issue12037 {
LL | |
LL | |             type IntoIter = std::slice::Iter<'a, u8>;
LL | |             type Item = &'a u8;
...  |
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