From a38c701b9e0b7b78b765c729ce78e58d2247e584 Mon Sep 17 00:00:00 2001 From: Dima Pristupa Date: Mon, 25 Oct 2021 19:10:03 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Add=20blank=20lines=20into=20an?= =?UTF-8?q?=20example=20with=20missing=20variable=20shadowing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/04_pinning/01_chapter.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/04_pinning/01_chapter.md b/src/04_pinning/01_chapter.md index c7603a3..00ba08d 100644 --- a/src/04_pinning/01_chapter.md +++ b/src/04_pinning/01_chapter.md @@ -496,8 +496,10 @@ The type system prevents us from moving the data. > let mut test1 = Test::new("test1"); > let mut test1_pin = unsafe { Pin::new_unchecked(&mut test1) }; > Test::init(test1_pin.as_mut()); +> > drop(test1_pin); > println!(r#"test1.b points to "test1": {:?}..."#, test1.b); +> > let mut test2 = Test::new("test2"); > mem::swap(&mut test1, &mut test2); > println!("... and now it points nowhere: {:?}", test1.b);