mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
8b02dac542
side effect for `enum_variants`: use .first() instead of .get(0) in enum_variants lint move to_camel_case to str_util module move module, enum and struct name repetitions check to a single file `item_name_repetitions` rename enum_variants threshold config option
186 lines
4.7 KiB
Text
186 lines
4.7 KiB
Text
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:12:5
|
|
|
|
|
LL | / fn a(&self) -> &u8 {
|
|
LL | |
|
|
LL | |
|
|
LL | | &self.b
|
|
| | ------- help: consider using: `&self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: `-D clippy::misnamed-getters` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::misnamed_getters)]`
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:17:5
|
|
|
|
|
LL | / fn a_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.b
|
|
| | ----------- help: consider using: `&mut self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:22:5
|
|
|
|
|
LL | / fn b(self) -> u8 {
|
|
LL | |
|
|
LL | | self.a
|
|
| | ------ help: consider using: `self.b`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:27:5
|
|
|
|
|
LL | / fn b_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.a
|
|
| | ----------- help: consider using: `&mut self.b`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:32:5
|
|
|
|
|
LL | / fn c(&self) -> &u8 {
|
|
LL | |
|
|
LL | | &self.b
|
|
| | ------- help: consider using: `&self.c`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:37:5
|
|
|
|
|
LL | / fn c_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.a
|
|
| | ----------- help: consider using: `&mut self.c`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:49:5
|
|
|
|
|
LL | / unsafe fn a(&self) -> &u8 {
|
|
LL | |
|
|
LL | | &self.b
|
|
| | ------- help: consider using: `&self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:53:5
|
|
|
|
|
LL | / unsafe fn a_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.b
|
|
| | ----------- help: consider using: `&mut self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:58:5
|
|
|
|
|
LL | / unsafe fn b(self) -> u8 {
|
|
LL | |
|
|
LL | | self.a
|
|
| | ------ help: consider using: `self.b`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:63:5
|
|
|
|
|
LL | / unsafe fn b_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.a
|
|
| | ----------- help: consider using: `&mut self.b`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:76:5
|
|
|
|
|
LL | / unsafe fn a_unchecked(&self) -> &u8 {
|
|
LL | |
|
|
LL | | &self.b
|
|
| | ------- help: consider using: `&self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:80:5
|
|
|
|
|
LL | / unsafe fn a_unchecked_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.b
|
|
| | ----------- help: consider using: `&mut self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:85:5
|
|
|
|
|
LL | / unsafe fn b_unchecked(self) -> u8 {
|
|
LL | |
|
|
LL | | self.a
|
|
| | ------ help: consider using: `self.b`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:90:5
|
|
|
|
|
LL | / unsafe fn b_unchecked_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.a
|
|
| | ----------- help: consider using: `&mut self.b`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:123:5
|
|
|
|
|
LL | / fn a(&self) -> &u8 {
|
|
LL | |
|
|
LL | | &self.b
|
|
| | ------- help: consider using: `&self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:127:5
|
|
|
|
|
LL | / fn a_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.b
|
|
| | ----------- help: consider using: `&mut self.a`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:132:5
|
|
|
|
|
LL | / fn d(&self) -> &u8 {
|
|
LL | |
|
|
LL | | &self.b
|
|
| | ------- help: consider using: `&self.d`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: getter function appears to return the wrong field
|
|
--> $DIR/misnamed_getters.rs:136:5
|
|
|
|
|
LL | / fn d_mut(&mut self) -> &mut u8 {
|
|
LL | |
|
|
LL | | &mut self.b
|
|
| | ----------- help: consider using: `&mut self.d`
|
|
LL | | }
|
|
| |_____^
|
|
|
|
error: aborting due to 18 previous errors
|
|
|