@@ -115,9 +115,9 @@ where
115
115
I : Interner ,
116
116
{
117
117
match ty. kind ( ) {
118
- // impl {Meta,}Sized for u*, i*, bool, f*, FnDef, FnPtr, *(const/mut) T, char
119
- // impl {Meta,}Sized for &mut? T, [T; N], dyn* Trait, !, Coroutine, CoroutineWitness
120
- // impl {Meta,}Sized for Closure, CoroutineClosure
118
+ // impl {Meta,Pointee, }Sized for u*, i*, bool, f*, FnDef, FnPtr, *(const/mut) T, char
119
+ // impl {Meta,Pointee, }Sized for &mut? T, [T; N], dyn* Trait, !, Coroutine, CoroutineWitness
120
+ // impl {Meta,Pointee, }Sized for Closure, CoroutineClosure
121
121
ty:: Infer ( ty:: IntVar ( _) | ty:: FloatVar ( _) )
122
122
| ty:: Uint ( _)
123
123
| ty:: Int ( _)
@@ -138,14 +138,19 @@ where
138
138
| ty:: Dynamic ( _, _, ty:: DynStar )
139
139
| ty:: Error ( _) => Ok ( ty:: Binder :: dummy ( vec ! [ ] ) ) ,
140
140
141
- // impl {Meta,}Sized for str, [T], dyn Trait
141
+ // impl {Meta,Pointee, }Sized for str, [T], dyn Trait
142
142
ty:: Str | ty:: Slice ( _) | ty:: Dynamic ( ..) => match sizedness {
143
143
SizedTraitKind :: Sized => Err ( NoSolution ) ,
144
- SizedTraitKind :: MetaSized => Ok ( ty:: Binder :: dummy ( vec ! [ ] ) ) ,
144
+ SizedTraitKind :: MetaSized | SizedTraitKind :: PointeeSized => {
145
+ Ok ( ty:: Binder :: dummy ( vec ! [ ] ) )
146
+ }
145
147
} ,
146
148
147
- // impl {} for extern type
148
- ty:: Foreign ( ..) => Err ( NoSolution ) ,
149
+ // impl PointeeSized for extern type
150
+ ty:: Foreign ( ..) => match sizedness {
151
+ SizedTraitKind :: Sized | SizedTraitKind :: MetaSized => Err ( NoSolution ) ,
152
+ SizedTraitKind :: PointeeSized => Ok ( ty:: Binder :: dummy ( vec ! [ ] ) ) ,
153
+ } ,
149
154
150
155
ty:: Alias ( ..) | ty:: Param ( _) | ty:: Placeholder ( ..) => Err ( NoSolution ) ,
151
156
@@ -156,17 +161,17 @@ where
156
161
157
162
ty:: UnsafeBinder ( bound_ty) => Ok ( bound_ty. map_bound ( |ty| vec ! [ ty] ) ) ,
158
163
159
- // impl {Meta,}Sized for ()
160
- // impl {Meta,}Sized for (T1, T2, .., Tn) where Tn: {Meta,}Sized if n >= 1
164
+ // impl {Meta,Pointee, }Sized for ()
165
+ // impl {Meta,Pointee, }Sized for (T1, T2, .., Tn) where Tn: {Meta,}Sized if n >= 1
161
166
ty:: Tuple ( tys) => Ok ( ty:: Binder :: dummy ( tys. last ( ) . map_or_else ( Vec :: new, |ty| vec ! [ ty] ) ) ) ,
162
167
163
- // impl {Meta,}Sized for Adt<Args...>
168
+ // impl {Meta,Pointee, }Sized for Adt<Args...>
164
169
// where {meta,pointee,}sized_constraint(Adt)<Args...>: {Meta,}Sized
165
170
//
166
171
// `{meta,pointee,}sized_constraint(Adt)` is the deepest struct trail that can be
167
172
// determined by the definition of `Adt`, independent of the generic args.
168
173
//
169
- // impl {Meta,}Sized for Adt<Args...>
174
+ // impl {Meta,Pointee, }Sized for Adt<Args...>
170
175
// if {meta,pointee,}sized_constraint(Adt) == None
171
176
//
172
177
// As a performance optimization, `{meta,pointee,}sized_constraint(Adt)` can return `None`
0 commit comments