@@ -846,6 +846,7 @@ impl<'a, T: ?Sized> MutexGuard<'a, T> {
846
846
#[ inline]
847
847
pub fn map < U , F > ( mut this : Self , f : F ) -> MappedMutexGuard < ' a , U >
848
848
where
849
+ U : ?Sized ,
849
850
F : FnOnce ( & mut T ) -> & mut U ,
850
851
{
851
852
let data = f ( & mut * this) as * mut U ;
@@ -894,6 +895,7 @@ impl<'a, T: ?Sized> MutexGuard<'a, T> {
894
895
#[ inline]
895
896
pub fn try_map < U , F > ( mut this : Self , f : F ) -> Result < MappedMutexGuard < ' a , U > , Self >
896
897
where
898
+ U : ?Sized ,
897
899
F : FnOnce ( & mut T ) -> Option < & mut U > ,
898
900
{
899
901
let data = match f ( & mut * this) {
@@ -1026,6 +1028,7 @@ impl<T: ?Sized> OwnedMutexGuard<T> {
1026
1028
#[ inline]
1027
1029
pub fn map < U , F > ( mut this : Self , f : F ) -> OwnedMappedMutexGuard < T , U >
1028
1030
where
1031
+ U : ?Sized ,
1029
1032
F : FnOnce ( & mut T ) -> & mut U ,
1030
1033
{
1031
1034
let data = f ( & mut * this) as * mut U ;
@@ -1074,6 +1077,7 @@ impl<T: ?Sized> OwnedMutexGuard<T> {
1074
1077
#[ inline]
1075
1078
pub fn try_map < U , F > ( mut this : Self , f : F ) -> Result < OwnedMappedMutexGuard < T , U > , Self >
1076
1079
where
1080
+ U : ?Sized ,
1077
1081
F : FnOnce ( & mut T ) -> Option < & mut U > ,
1078
1082
{
1079
1083
let data = match f ( & mut * this) {
0 commit comments