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 {
518
518
impl < ' a , T : Show > Show for & ' a mut T {
519
519
fn fmt ( & self , f : & mut Formatter ) -> Result { secret_show ( & * * self , f) }
520
520
}
521
+ impl < ' a > Show for & ' a Show {
522
+ fn fmt ( & self , f : & mut Formatter ) -> Result { ( * self ) . fmt ( f) }
523
+ }
521
524
522
525
impl Bool for bool {
523
526
fn fmt ( & self , f : & mut Formatter ) -> Result {
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ pub fn main() {
81
81
t ! ( format!( "{foo_bar}" , foo_bar=1 i) , "1" ) ;
82
82
t ! ( format!( "{:d}" , 5 i + 5 i) , "10" ) ;
83
83
84
+ let a: & fmt:: Show = & 1 i;
85
+ t ! ( format!( "{}" , a) , "1" ) ;
86
+
84
87
// Formatting strings and their arguments
85
88
t ! ( format!( "{:s}" , "a" ) , "a" ) ;
86
89
t ! ( format!( "{:4s}" , "a" ) , "a " ) ;
You can’t perform that action at this time.
0 commit comments