File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,9 @@ impl<'a, T: Show> Show for &'a T {
518518impl < ' a , T : Show > Show for & ' a mut T {
519519 fn fmt ( & self , f : & mut Formatter ) -> Result { secret_show ( & * * self , f) }
520520}
521+ impl < ' a > Show for & ' a Show {
522+ fn fmt ( & self , f : & mut Formatter ) -> Result { ( * self ) . fmt ( f) }
523+ }
521524
522525impl Bool for bool {
523526 fn fmt ( & self , f : & mut Formatter ) -> Result {
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ pub fn main() {
8181 t ! ( format!( "{foo_bar}" , foo_bar=1 i) , "1" ) ;
8282 t ! ( format!( "{:d}" , 5 i + 5 i) , "10" ) ;
8383
84+ let a: & fmt:: Show = & 1 i;
85+ t ! ( format!( "{}" , a) , "1" ) ;
86+
8487 // Formatting strings and their arguments
8588 t ! ( format!( "{:s}" , "a" ) , "a" ) ;
8689 t ! ( format!( "{:4s}" , "a" ) , "a " ) ;
You can’t perform that action at this time.
0 commit comments