From fb783653322156ba616e6175e76fd53106977a3f Mon Sep 17 00:00:00 2001 From: lyj Date: Thu, 16 Sep 2021 16:52:57 +0800 Subject: [PATCH] add 3414 test --- tests/ui/wrong_self_convention2.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/ui/wrong_self_convention2.rs b/tests/ui/wrong_self_convention2.rs index 501bc1e6a85..dd3e842c925 100644 --- a/tests/ui/wrong_self_convention2.rs +++ b/tests/ui/wrong_self_convention2.rs @@ -68,3 +68,22 @@ trait Foo: Sized { fn as_byte_slice(slice: &[Self]) -> &[u8]; } } + +mod issue3414 { + struct CellLikeThing(T); + + impl CellLikeThing { + // don't trigger + fn into_inner(this: Self) -> T { + this.0 + } + } + + impl std::ops::Deref for CellLikeThing { + type Target = T; + + fn deref(&self) -> &T { + &self.0 + } + } +}