@@ -5,7 +5,6 @@ use std::iter::FromIterator;
5
5
use syntax:: source_map:: Span ;
6
6
use crate :: ty:: subst:: GenericArg ;
7
7
use crate :: ty:: { self , Ty , TyCtxt } ;
8
- use crate :: ty:: query:: Providers ;
9
8
10
9
impl < ' cx , ' tcx > At < ' cx , ' tcx > {
11
10
/// Given a type `ty` of some value being dropped, computes a set
@@ -34,7 +33,7 @@ impl<'cx, 'tcx> At<'cx, 'tcx> {
34
33
// Quick check: there are a number of cases that we know do not require
35
34
// any destructor.
36
35
let tcx = self . infcx . tcx ;
37
- if tcx . trivial_dropck_outlives ( ty) {
36
+ if trivial_dropck_outlives ( tcx , ty) {
38
37
return InferOk {
39
38
value : vec ! [ ] ,
40
39
obligations : vec ! [ ] ,
@@ -208,15 +207,15 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
208
207
| ty:: Error => true ,
209
208
210
209
// [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) ,
212
211
213
212
// (T1..Tn) and closures have same properties as T1..Tn --
214
213
// 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 ( ) ) ) ,
216
215
ty:: Closure ( def_id, ref substs) => substs
217
216
. as_closure ( )
218
217
. upvar_tys ( def_id, tcx)
219
- . all ( |t| tcx . trivial_dropck_outlives ( t) ) ,
218
+ . all ( |t| trivial_dropck_outlives ( tcx , t) ) ,
220
219
221
220
ty:: Adt ( def, _) => {
222
221
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 {
244
243
ty:: UnnormalizedProjection ( ..) => bug ! ( "only used with chalk-engine" ) ,
245
244
}
246
245
}
247
-
248
- crate fn provide ( p : & mut Providers < ' _ > ) {
249
- * p = Providers {
250
- trivial_dropck_outlives,
251
- ..* p
252
- } ;
253
- }
0 commit comments