summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/misnamed_getters.stderr
blob: 1e38a83d019a6d33e7aa82c973beedd657e9dc9b (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:11:5
   |
LL | /     fn a(&self) -> &u8 {
LL | |         &self.b
   | |         ------- help: consider using: `&self.a`
LL | |     }
   | |_____^
   |
   = note: `-D clippy::misnamed-getters` implied by `-D warnings`

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:14:5
   |
LL | /     fn a_mut(&mut self) -> &mut u8 {
LL | |         &mut self.b
   | |         ----------- help: consider using: `&mut self.a`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:18:5
   |
LL | /     fn b(self) -> u8 {
LL | |         self.a
   | |         ------ help: consider using: `self.b`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:22:5
   |
LL | /     fn b_mut(&mut self) -> &mut u8 {
LL | |         &mut self.a
   | |         ----------- help: consider using: `&mut self.b`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:26:5
   |
LL | /     fn c(&self) -> &u8 {
LL | |         &self.b
   | |         ------- help: consider using: `&self.c`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:30:5
   |
LL | /     fn c_mut(&mut self) -> &mut u8 {
LL | |         &mut self.a
   | |         ----------- help: consider using: `&mut self.c`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:41:5
   |
LL | /     unsafe fn a(&self) -> &u8 {
LL | |         &self.b
   | |         ------- help: consider using: `&self.a`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:44:5
   |
LL | /     unsafe fn a_mut(&mut self) -> &mut u8 {
LL | |         &mut self.b
   | |         ----------- help: consider using: `&mut self.a`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:48:5
   |
LL | /     unsafe fn b(self) -> u8 {
LL | |         self.a
   | |         ------ help: consider using: `self.b`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:52:5
   |
LL | /     unsafe fn b_mut(&mut self) -> &mut u8 {
LL | |         &mut self.a
   | |         ----------- help: consider using: `&mut self.b`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:64:5
   |
LL | /     unsafe fn a_unchecked(&self) -> &u8 {
LL | |         &self.b
   | |         ------- help: consider using: `&self.a`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:67:5
   |
LL | /     unsafe fn a_unchecked_mut(&mut self) -> &mut u8 {
LL | |         &mut self.b
   | |         ----------- help: consider using: `&mut self.a`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:71:5
   |
LL | /     unsafe fn b_unchecked(self) -> u8 {
LL | |         self.a
   | |         ------ help: consider using: `self.b`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:75:5
   |
LL | /     unsafe fn b_unchecked_mut(&mut self) -> &mut u8 {
LL | |         &mut self.a
   | |         ----------- help: consider using: `&mut self.b`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:107:5
   |
LL | /     fn a(&self) -> &u8 {
LL | |         &self.b
   | |         ------- help: consider using: `&self.a`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:110:5
   |
LL | /     fn a_mut(&mut self) -> &mut u8 {
LL | |         &mut self.b
   | |         ----------- help: consider using: `&mut self.a`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:114:5
   |
LL | /     fn d(&self) -> &u8 {
LL | |         &self.b
   | |         ------- help: consider using: `&self.d`
LL | |     }
   | |_____^

error: getter function appears to return the wrong field
  --> $DIR/misnamed_getters.rs:117:5
   |
LL | /     fn d_mut(&mut self) -> &mut u8 {
LL | |         &mut self.b
   | |         ----------- help: consider using: `&mut self.d`
LL | |     }
   | |_____^

error: aborting due to 18 previous errors