rust/tests/ui/missnamed_getters.rs
2022-11-20 13:45:11 +01:00

29 lines
292 B
Rust

#![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
}