@@ -136,12 +136,12 @@ impl<'a, T: Resource + FromResources> DerefMut for Local<'a, T> {
136
136
/// `NonSend<T>` resources cannot leave the main thread, so any system that wants access to
137
137
/// a non-send resource will run on the main thread. See `Resources::insert_non_send()` and friends.
138
138
#[ derive( Debug ) ]
139
- pub struct NonSend < ' a , T : Resource > {
139
+ pub struct NonSend < ' a , T : ' static > {
140
140
value : * mut T ,
141
141
_marker : PhantomData < & ' a T > ,
142
142
}
143
143
144
- impl < ' a , T : Resource > NonSend < ' a , T > {
144
+ impl < ' a , T : ' static > NonSend < ' a , T > {
145
145
pub ( crate ) unsafe fn new ( resources : & Resources ) -> Self {
146
146
NonSend {
147
147
value : resources. get_unsafe_non_send_ref :: < T > ( ) . as_ptr ( ) ,
@@ -150,15 +150,15 @@ impl<'a, T: Resource> NonSend<'a, T> {
150
150
}
151
151
}
152
152
153
- impl < ' a , T : Resource > Deref for NonSend < ' a , T > {
153
+ impl < ' a , T : ' static > Deref for NonSend < ' a , T > {
154
154
type Target = T ;
155
155
156
156
fn deref ( & self ) -> & T {
157
157
unsafe { & * self . value }
158
158
}
159
159
}
160
160
161
- impl < ' a , T : Resource > DerefMut for NonSend < ' a , T > {
161
+ impl < ' a , T : ' static > DerefMut for NonSend < ' a , T > {
162
162
fn deref_mut ( & mut self ) -> & mut T {
163
163
unsafe { & mut * self . value }
164
164
}
0 commit comments