rust/tests/ui/missnamed_getters.rs

29 lines
292 B
Rust
Raw Normal View History

2022-11-01 12:39:36 -05:00
#![allow(unused)]
#![warn(clippy::missnamed_getters)]
struct A {
a: u8,
b: u8,
}
impl A {
fn a(&self) -> &u8 {
&self.b
}
}
union B {
a: u8,
b: u8,
}
impl B {
unsafe fn a(&self) -> &u8 {
&self.b
}
}
fn main() {
// test code goes here
}