From d2c9f3add10a020d6ef7b674b7a722a1d0846f2d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 16 Jun 2021 10:30:29 +0300 Subject: internal: add deref_mut to minicore --- crates/ide_completion/src/render.rs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'crates/ide_completion/src') diff --git a/crates/ide_completion/src/render.rs b/crates/ide_completion/src/render.rs index 3eb51e80b..fac83b650 100644 --- a/crates/ide_completion/src/render.rs +++ b/crates/ide_completion/src/render.rs @@ -1191,21 +1191,11 @@ fn main() { fn suggest_deref_mut() { check_relevance( r#" -#[lang = "deref"] -trait Deref { - type Target; - fn deref(&self) -> &Self::Target; -} - -#[lang = "deref_mut"] -pub trait DerefMut: Deref { - fn deref_mut(&mut self) -> &mut Self::Target; -} - +//- minicore: deref_mut struct S; struct T(S); -impl Deref for T { +impl core::ops::Deref for T { type Target = S; fn deref(&self) -> &Self::Target { @@ -1213,7 +1203,7 @@ impl Deref for T { } } -impl DerefMut for T { +impl core::ops::DerefMut for T { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } @@ -1232,12 +1222,12 @@ fn main() { lc m [local] lc t [local] lc &mut t [type+local] - tt DerefMut [] - tt Deref [] - fn foo(…) [] st T [] st S [] fn main() [] + fn foo(…) [] + md core [] + tt Sized [] "#]], ) } -- cgit v1.2.3