diff --git a/tests/ui/misnamed_getters.rs b/tests/ui/misnamed_getters.rs index 6f161818251..2c451bd3a16 100644 --- a/tests/ui/misnamed_getters.rs +++ b/tests/ui/misnamed_getters.rs @@ -85,6 +85,18 @@ unsafe fn c_unchecked_mut(&mut self) -> &mut u8 { } } +struct C { + inner: Box, +} +impl C { + unsafe fn a(&self) -> &u8 { + &self.inner.b + } + unsafe fn a_mut(&mut self) -> &mut u8 { + &mut self.inner.b + } +} + fn main() { // test code goes here }