@@ -942,6 +942,13 @@ impl<'b, T: ?Sized> Ref<'b, T> {
942942#[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
943943impl < ' b , T : ?Sized + Unsize < U > , U : ?Sized > CoerceUnsized < Ref < ' b , U > > for Ref < ' b , T > { }
944944
945+ #[ stable( feature = "std_guard_impls" , since = "1.20" ) ]
946+ impl < ' a , T : ?Sized + fmt:: Display > fmt:: Display for Ref < ' a , T > {
947+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
948+ self . value . fmt ( f)
949+ }
950+ }
951+
945952impl < ' b , T : ?Sized > RefMut < ' b , T > {
946953 /// Make a new `RefMut` for a component of the borrowed data, e.g. an enum
947954 /// variant.
@@ -1034,6 +1041,13 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
10341041#[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
10351042impl < ' b , T : ?Sized + Unsize < U > , U : ?Sized > CoerceUnsized < RefMut < ' b , U > > for RefMut < ' b , T > { }
10361043
1044+ #[ stable( feature = "std_guard_impls" , since = "1.20" ) ]
1045+ impl < ' a , T : ?Sized + fmt:: Display > fmt:: Display for RefMut < ' a , T > {
1046+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1047+ self . value . fmt ( f)
1048+ }
1049+ }
1050+
10371051/// The core primitive for interior mutability in Rust.
10381052///
10391053/// `UnsafeCell<T>` is a type that wraps some `T` and indicates unsafe interior operations on the
0 commit comments