From 77374a95272dfb8fcbc75cd074b4e61b1890c724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Sat, 12 Nov 2022 22:33:46 +0100 Subject: [PATCH] Add failing test --- tests/ui/misnamed_getters.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/ui/misnamed_getters.rs b/tests/ui/misnamed_getters.rs index 6f1618182..2c451bd3a 100644 --- a/tests/ui/misnamed_getters.rs +++ b/tests/ui/misnamed_getters.rs @@ -85,6 +85,18 @@ impl B { } } +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 }