@@ -100,13 +100,15 @@ impl<T: Sized> Exclusive<T> {
100
100
/// Wrap a value in an `Exclusive`
101
101
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
102
102
#[ must_use]
103
+ #[ inline]
103
104
pub const fn new ( t : T ) -> Self {
104
105
Self { inner : t }
105
106
}
106
107
107
108
/// Unwrap the value contained in the `Exclusive`
108
109
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
109
110
#[ must_use]
111
+ #[ inline]
110
112
pub const fn into_inner ( self ) -> T {
111
113
self . inner
112
114
}
@@ -116,6 +118,7 @@ impl<T: ?Sized> Exclusive<T> {
116
118
/// Get exclusive access to the underlying value.
117
119
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
118
120
#[ must_use]
121
+ #[ inline]
119
122
pub const fn get_mut ( & mut self ) -> & mut T {
120
123
& mut self . inner
121
124
}
@@ -128,6 +131,7 @@ impl<T: ?Sized> Exclusive<T> {
128
131
/// produce _pinned_ access to the underlying value.
129
132
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
130
133
#[ must_use]
134
+ #[ inline]
131
135
pub const fn get_pin_mut ( self : Pin < & mut Self > ) -> Pin < & mut T > {
132
136
// SAFETY: `Exclusive` can only produce `&mut T` if itself is unpinned
133
137
// `Pin::map_unchecked_mut` is not const, so we do this conversion manually
@@ -139,6 +143,7 @@ impl<T: ?Sized> Exclusive<T> {
139
143
/// building an `Exclusive` with [`Exclusive::new`].
140
144
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
141
145
#[ must_use]
146
+ #[ inline]
142
147
pub const fn from_mut ( r : & ' _ mut T ) -> & ' _ mut Exclusive < T > {
143
148
// SAFETY: repr is ≥ C, so refs have the same layout; and `Exclusive` properties are `&mut`-agnostic
144
149
unsafe { & mut * ( r as * mut T as * mut Exclusive < T > ) }
@@ -149,6 +154,7 @@ impl<T: ?Sized> Exclusive<T> {
149
154
/// building an `Exclusive` with [`Exclusive::new`].
150
155
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
151
156
#[ must_use]
157
+ #[ inline]
152
158
pub const fn from_pin_mut ( r : Pin < & ' _ mut T > ) -> Pin < & ' _ mut Exclusive < T > > {
153
159
// SAFETY: `Exclusive` can only produce `&mut T` if itself is unpinned
154
160
// `Pin::map_unchecked_mut` is not const, so we do this conversion manually
@@ -158,6 +164,7 @@ impl<T: ?Sized> Exclusive<T> {
158
164
159
165
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
160
166
impl < T > From < T > for Exclusive < T > {
167
+ #[ inline]
161
168
fn from ( t : T ) -> Self {
162
169
Self :: new ( t)
163
170
}
@@ -166,7 +173,7 @@ impl<T> From<T> for Exclusive<T> {
166
173
#[ unstable( feature = "exclusive_wrapper" , issue = "98407" ) ]
167
174
impl < T : Future + ?Sized > Future for Exclusive < T > {
168
175
type Output = T :: Output ;
169
-
176
+ # [ inline ]
170
177
fn poll ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
171
178
self . get_pin_mut ( ) . poll ( cx)
172
179
}
0 commit comments