@@ -199,7 +199,7 @@ fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt,
199
199
200
200
fn uncovered_tys < ' tcx > ( tcx : TyCtxt , ty : Ty < ' tcx > , infer_is_local : InferIsLocal )
201
201
-> Vec < Ty < ' tcx > > {
202
- if ty_is_local_constructor ( tcx , ty, infer_is_local) {
202
+ if ty_is_local_constructor ( ty, infer_is_local) {
203
203
vec ! [ ]
204
204
} else if fundamental_ty ( tcx, ty) {
205
205
ty. walk_shallow ( )
@@ -219,13 +219,13 @@ fn is_type_parameter(ty: Ty) -> bool {
219
219
}
220
220
221
221
fn ty_is_local ( tcx : TyCtxt , ty : Ty , infer_is_local : InferIsLocal ) -> bool {
222
- ty_is_local_constructor ( tcx , ty, infer_is_local) ||
222
+ ty_is_local_constructor ( ty, infer_is_local) ||
223
223
fundamental_ty ( tcx, ty) && ty. walk_shallow ( ) . any ( |t| ty_is_local ( tcx, t, infer_is_local) )
224
224
}
225
225
226
226
fn fundamental_ty ( tcx : TyCtxt , ty : Ty ) -> bool {
227
227
match ty. sty {
228
- ty:: TyBox ( .. ) | ty :: TyRef ( ..) => true ,
228
+ ty:: TyRef ( ..) => true ,
229
229
ty:: TyAdt ( def, _) => def. is_fundamental ( ) ,
230
230
ty:: TyDynamic ( ref data, ..) => {
231
231
data. principal ( ) . map_or ( false , |p| tcx. has_attr ( p. def_id ( ) , "fundamental" ) )
@@ -234,7 +234,7 @@ fn fundamental_ty(tcx: TyCtxt, ty: Ty) -> bool {
234
234
}
235
235
}
236
236
237
- fn ty_is_local_constructor ( tcx : TyCtxt , ty : Ty , infer_is_local : InferIsLocal ) -> bool {
237
+ fn ty_is_local_constructor ( ty : Ty , infer_is_local : InferIsLocal ) -> bool {
238
238
debug ! ( "ty_is_local_constructor({:?})" , ty) ;
239
239
240
240
match ty. sty {
@@ -265,11 +265,6 @@ fn ty_is_local_constructor(tcx: TyCtxt, ty: Ty, infer_is_local: InferIsLocal)->
265
265
def. did . is_local ( )
266
266
}
267
267
268
- ty:: TyBox ( _) => { // Box<T>
269
- let krate = tcx. lang_items . owned_box ( ) . map ( |d| d. krate ) ;
270
- krate == Some ( LOCAL_CRATE )
271
- }
272
-
273
268
ty:: TyDynamic ( ref tt, ..) => {
274
269
tt. principal ( ) . map_or ( false , |p| p. def_id ( ) . is_local ( ) )
275
270
}
0 commit comments