@@ -5,7 +5,6 @@ use std::iter::FromIterator;
55use syntax:: source_map:: Span ;
66use crate :: ty:: subst:: GenericArg ;
77use crate :: ty:: { self , Ty , TyCtxt } ;
8- use crate :: ty:: query:: Providers ;
98
109impl < ' cx , ' tcx > At < ' cx , ' tcx > {
1110 /// Given a type `ty` of some value being dropped, computes a set
@@ -34,7 +33,7 @@ impl<'cx, 'tcx> At<'cx, 'tcx> {
3433 // Quick check: there are a number of cases that we know do not require
3534 // any destructor.
3635 let tcx = self . infcx . tcx ;
37- if tcx . trivial_dropck_outlives ( ty) {
36+ if trivial_dropck_outlives ( tcx , ty) {
3837 return InferOk {
3938 value : vec ! [ ] ,
4039 obligations : vec ! [ ] ,
@@ -208,15 +207,15 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
208207 | ty:: Error => true ,
209208
210209 // [T; N] and [T] have same properties as T.
211- ty:: Array ( ty, _) | ty:: Slice ( ty) => tcx . trivial_dropck_outlives ( ty) ,
210+ ty:: Array ( ty, _) | ty:: Slice ( ty) => trivial_dropck_outlives ( tcx , ty) ,
212211
213212 // (T1..Tn) and closures have same properties as T1..Tn --
214213 // check if *any* of those are trivial.
215- ty:: Tuple ( ref tys) => tys. iter ( ) . all ( |t| tcx . trivial_dropck_outlives ( t. expect_ty ( ) ) ) ,
214+ ty:: Tuple ( ref tys) => tys. iter ( ) . all ( |t| trivial_dropck_outlives ( tcx , t. expect_ty ( ) ) ) ,
216215 ty:: Closure ( def_id, ref substs) => substs
217216 . as_closure ( )
218217 . upvar_tys ( def_id, tcx)
219- . all ( |t| tcx . trivial_dropck_outlives ( t) ) ,
218+ . all ( |t| trivial_dropck_outlives ( tcx , t) ) ,
220219
221220 ty:: Adt ( def, _) => {
222221 if Some ( def. did ) == tcx. lang_items ( ) . manually_drop ( ) {
@@ -244,10 +243,3 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
244243 ty:: UnnormalizedProjection ( ..) => bug ! ( "only used with chalk-engine" ) ,
245244 }
246245}
247-
248- crate fn provide ( p : & mut Providers < ' _ > ) {
249- * p = Providers {
250- trivial_dropck_outlives,
251- ..* p
252- } ;
253- }
0 commit comments