@@ -59,7 +59,7 @@ pub trait Readable: Copy + Default + private::Sealed {
59
59
type RestrictShared : Readable + Access ;
60
60
}
61
61
impl < A : RestrictAccess < ReadOnly , Restricted = ReadOnly > > Readable for A {
62
- type RestrictShared = ReadOnly ;
62
+ type RestrictShared = < Self as RestrictAccess < ReadOnly > > :: Restricted ;
63
63
}
64
64
65
65
/// Helper trait that is implemented by [`ReadWrite`] and [`WriteOnly`].
@@ -74,30 +74,28 @@ impl<A: RestrictAccess<ReadOnly, Restricted = Self>> Copyable for A {}
74
74
#[ derive( Debug , Default , Copy , Clone ) ]
75
75
pub struct ReadWrite ;
76
76
impl Access for ReadWrite {
77
- #[ allow( deprecated) ]
78
- type RestrictShared = <Self as Readable >:: RestrictShared ;
77
+ type RestrictShared = <Self as RestrictAccess < ReadOnly > >:: Restricted ;
79
78
}
80
79
81
80
/// Zero-sized marker type for allowing only read access.
82
81
#[ derive( Debug , Default , Copy , Clone ) ]
83
82
pub struct ReadOnly ;
84
83
impl Access for ReadOnly {
85
- #[ allow( deprecated) ]
86
- type RestrictShared = <Self as Readable >:: RestrictShared ;
84
+ type RestrictShared = <Self as RestrictAccess < ReadOnly > >:: Restricted ;
87
85
}
88
86
89
87
/// Zero-sized marker type for allowing only write access.
90
88
#[ derive( Debug , Default , Copy , Clone ) ]
91
89
pub struct WriteOnly ;
92
90
impl Access for WriteOnly {
93
- type RestrictShared = NoAccess ;
91
+ type RestrictShared = < Self as RestrictAccess < ReadOnly > > :: Restricted ;
94
92
}
95
93
96
94
/// Zero-sized marker type that grants no access.
97
95
#[ derive( Debug , Default , Copy , Clone ) ]
98
96
pub struct NoAccess ;
99
97
impl Access for NoAccess {
100
- type RestrictShared = NoAccess ;
98
+ type RestrictShared = < Self as RestrictAccess < ReadOnly > > :: Restricted ;
101
99
}
102
100
103
101
mod private {
0 commit comments