@@ -849,7 +849,7 @@ impl<T, E: fmt::Debug> Result<T, E> {
849849 pub fn unwrap ( self ) -> T {
850850 match self {
851851 Ok ( t) => t,
852- Err ( e) => unwrap_failed ( "called `Result::unwrap()` on an `Err` value" , e) ,
852+ Err ( e) => unwrap_failed ( "called `Result::unwrap()` on an `Err` value" , & e) ,
853853 }
854854 }
855855
@@ -876,7 +876,7 @@ impl<T, E: fmt::Debug> Result<T, E> {
876876 pub fn expect ( self , msg : & str ) -> T {
877877 match self {
878878 Ok ( t) => t,
879- Err ( e) => unwrap_failed ( msg, e) ,
879+ Err ( e) => unwrap_failed ( msg, & e) ,
880880 }
881881 }
882882}
@@ -908,7 +908,7 @@ impl<T: fmt::Debug, E> Result<T, E> {
908908 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
909909 pub fn unwrap_err ( self ) -> E {
910910 match self {
911- Ok ( t) => unwrap_failed ( "called `Result::unwrap_err()` on an `Ok` value" , t) ,
911+ Ok ( t) => unwrap_failed ( "called `Result::unwrap_err()` on an `Ok` value" , & t) ,
912912 Err ( e) => e,
913913 }
914914 }
@@ -935,7 +935,7 @@ impl<T: fmt::Debug, E> Result<T, E> {
935935 #[ stable( feature = "result_expect_err" , since = "1.17.0" ) ]
936936 pub fn expect_err ( self , msg : & str ) -> E {
937937 match self {
938- Ok ( t) => unwrap_failed ( msg, t) ,
938+ Ok ( t) => unwrap_failed ( msg, & t) ,
939939 Err ( e) => e,
940940 }
941941 }
@@ -1047,7 +1047,7 @@ impl<T, E> Result<Option<T>, E> {
10471047// This is a separate function to reduce the code size of the methods
10481048#[ inline( never) ]
10491049#[ cold]
1050- fn unwrap_failed < E : fmt :: Debug > ( msg : & str , error : E ) -> ! {
1050+ fn unwrap_failed ( msg : & str , error : & dyn fmt :: Debug ) -> ! {
10511051 panic ! ( "{}: {:?}" , msg, error)
10521052}
10531053
0 commit comments