From 5a8e915725a2e2eace517ac82fcf5e7e677f245b Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 16 Jun 2020 08:52:00 -0700 Subject: [PATCH 1/2] Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15) --- src/stage0.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stage0.txt b/src/stage0.txt index 5e840b9db1994..769ec669bdc8d 100644 --- a/src/stage0.txt +++ b/src/stage0.txt @@ -12,7 +12,7 @@ # source tarball for a stable release you'll likely see `1.x.0` for rustc and # `0.(x+1).0` for Cargo where they were released on `date`. -date: 2020-06-03 +date: 2020-06-16 rustc: beta cargo: beta From bfb0e8db88d5a9fbb908e88e7588ee9e917cee25 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 20 Jun 2020 12:27:16 -0700 Subject: [PATCH 2/2] Fix broken inner_deref doc tests. --- src/libcore/result.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 2080ae193667e..0c0e6d291bb92 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -1155,6 +1155,7 @@ impl Result { /// # Examples /// /// ``` + /// #![feature(inner_deref)] /// let x: Result = Ok("hello".to_string()); /// let y: Result<&str, &u32> = Ok("hello"); /// assert_eq!(x.as_deref(), y); @@ -1189,12 +1190,15 @@ impl Result { /// # Examples /// /// ``` + /// #![feature(inner_deref)] + /// let mut s = "HELLO".to_string(); /// let mut x: Result = Ok("hello".to_string()); - /// let y: Result<&mut str, &mut u32> = Ok("HELLO"); + /// let y: Result<&mut str, &mut u32> = Ok(&mut s); /// assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y); /// + /// let mut i = 42; /// let mut x: Result = Err(42); - /// let y: Result<&mut str, &mut u32> = Err(&42); + /// let y: Result<&mut str, &mut u32> = Err(&mut i); /// assert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y); /// ``` pub fn as_deref_mut(&mut self) -> Result<&mut T::Target, &mut E> {