@@ -46,7 +46,7 @@ pub trait DetectChanges {
46
46
/// The type contained within this smart pointer
47
47
///
48
48
/// For example, for `Res<T>` this would be `T`.
49
- type Inner ;
49
+ type Inner : ? Sized ;
50
50
51
51
/// Returns `true` if this value was added after the system last ran.
52
52
fn is_added ( & self ) -> bool ;
@@ -90,7 +90,7 @@ pub trait DetectChanges {
90
90
91
91
macro_rules! change_detection_impl {
92
92
( $name: ident < $( $generics: tt ) ,+ >, $target: ty, $( $traits: ident) ?) => {
93
- impl <$( $generics) ,* $ ( : $traits) ?> DetectChanges for $name<$( $generics) ,* > {
93
+ impl <$( $generics) ,* : ? Sized $ ( + $traits) ?> DetectChanges for $name<$( $generics) ,* > {
94
94
type Inner = $target;
95
95
96
96
#[ inline]
@@ -130,7 +130,7 @@ macro_rules! change_detection_impl {
130
130
}
131
131
}
132
132
133
- impl <$( $generics) ,* $ ( : $traits) ?> Deref for $name<$( $generics) ,* > {
133
+ impl <$( $generics) ,* : ? Sized $ ( + $traits) ?> Deref for $name<$( $generics) ,* > {
134
134
type Target = $target;
135
135
136
136
#[ inline]
@@ -139,7 +139,7 @@ macro_rules! change_detection_impl {
139
139
}
140
140
}
141
141
142
- impl <$( $generics) ,* $ ( : $traits) ?> DerefMut for $name<$( $generics) ,* > {
142
+ impl <$( $generics) ,* : ? Sized $ ( + $traits) ?> DerefMut for $name<$( $generics) ,* > {
143
143
#[ inline]
144
144
fn deref_mut( & mut self ) -> & mut Self :: Target {
145
145
self . set_changed( ) ;
@@ -165,7 +165,7 @@ macro_rules! change_detection_impl {
165
165
166
166
macro_rules! impl_into_inner {
167
167
( $name: ident < $( $generics: tt ) ,+ >, $target: ty, $( $traits: ident) ?) => {
168
- impl <$( $generics) ,* $ ( : $traits) ?> $name<$( $generics) ,* > {
168
+ impl <$( $generics) ,* : ? Sized $ ( + $traits) ?> $name<$( $generics) ,* > {
169
169
/// Consume `self` and return a mutable reference to the
170
170
/// contained value while marking `self` as "changed".
171
171
#[ inline]
@@ -179,12 +179,12 @@ macro_rules! impl_into_inner {
179
179
180
180
macro_rules! impl_debug {
181
181
( $name: ident < $( $generics: tt ) ,+ >, $( $traits: ident) ?) => {
182
- impl <$( $generics) ,* $ ( : $traits) ?> std:: fmt:: Debug for $name<$( $generics) ,* >
182
+ impl <$( $generics) ,* : ? Sized $ ( + $traits) ?> std:: fmt:: Debug for $name<$( $generics) ,* >
183
183
where T : std:: fmt:: Debug
184
184
{
185
185
fn fmt( & self , f: & mut std:: fmt:: Formatter <' _>) -> std:: fmt:: Result {
186
186
f. debug_tuple( stringify!( $name) )
187
- . field( self . value)
187
+ . field( & self . value)
188
188
. finish( )
189
189
}
190
190
}
@@ -209,7 +209,7 @@ pub(crate) struct Ticks<'a> {
209
209
/// Panics when used as a [`SystemParam`](crate::system::SystemParam) if the resource does not exist.
210
210
///
211
211
/// Use `Option<ResMut<T>>` instead if the resource might not always exist.
212
- pub struct ResMut < ' a , T : Resource > {
212
+ pub struct ResMut < ' a , T : ? Sized + Resource > {
213
213
pub ( crate ) value : & ' a mut T ,
214
214
pub ( crate ) ticks : Ticks < ' a > ,
215
215
}
@@ -241,7 +241,7 @@ impl<'a, T: Resource> From<ResMut<'a, T>> for Mut<'a, T> {
241
241
/// Panics when used as a `SystemParameter` if the resource does not exist.
242
242
///
243
243
/// Use `Option<NonSendMut<T>>` instead if the resource might not always exist.
244
- pub struct NonSendMut < ' a , T : ' static > {
244
+ pub struct NonSendMut < ' a , T : ? Sized + ' static > {
245
245
pub ( crate ) value : & ' a mut T ,
246
246
pub ( crate ) ticks : Ticks < ' a > ,
247
247
}
0 commit comments