@@ -169,7 +169,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
169
169
// because we don't want to lint functions returning empty arrays
170
170
is_must_use_ty ( cx, * ty)
171
171
} ,
172
- ty:: Tuple ( substs) => substs. types ( ) . any ( |ty| is_must_use_ty ( cx, ty) ) ,
172
+ ty:: Tuple ( substs) => substs. iter ( ) . any ( |ty| is_must_use_ty ( cx, ty) ) ,
173
173
ty:: Opaque ( ref def_id, _) => {
174
174
for ( predicate, _) in cx. tcx . explicit_item_bounds ( * def_id) {
175
175
if let ty:: PredicateKind :: Trait ( trait_predicate) = predicate. kind ( ) . skip_binder ( ) {
@@ -249,11 +249,11 @@ pub fn is_non_aggregate_primitive_type(ty: Ty<'_>) -> bool {
249
249
/// Returns `true` if the given type is a primitive (a `bool` or `char`, any integer or
250
250
/// floating-point number type, a `str`, or an array, slice, or tuple of those types).
251
251
pub fn is_recursively_primitive_type ( ty : Ty < ' _ > ) -> bool {
252
- match ty. kind ( ) {
252
+ match * ty. kind ( ) {
253
253
ty:: Bool | ty:: Char | ty:: Int ( _) | ty:: Uint ( _) | ty:: Float ( _) | ty:: Str => true ,
254
254
ty:: Ref ( _, inner, _) if * inner. kind ( ) == ty:: Str => true ,
255
- ty:: Array ( inner_type, _) | ty:: Slice ( inner_type) => is_recursively_primitive_type ( * inner_type) ,
256
- ty:: Tuple ( inner_types) => inner_types. types ( ) . all ( is_recursively_primitive_type) ,
255
+ ty:: Array ( inner_type, _) | ty:: Slice ( inner_type) => is_recursively_primitive_type ( inner_type) ,
256
+ ty:: Tuple ( inner_types) => inner_types. iter ( ) . all ( is_recursively_primitive_type) ,
257
257
_ => false ,
258
258
}
259
259
}
@@ -393,9 +393,9 @@ pub fn same_type_and_consts<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
393
393
394
394
/// Checks if a given type looks safe to be uninitialized.
395
395
pub fn is_uninit_value_valid_for_ty ( cx : & LateContext < ' _ > , ty : Ty < ' _ > ) -> bool {
396
- match ty. kind ( ) {
397
- ty:: Array ( component, _) => is_uninit_value_valid_for_ty ( cx, * component) ,
398
- ty:: Tuple ( types) => types. types ( ) . all ( |ty| is_uninit_value_valid_for_ty ( cx, ty) ) ,
396
+ match * ty. kind ( ) {
397
+ ty:: Array ( component, _) => is_uninit_value_valid_for_ty ( cx, component) ,
398
+ ty:: Tuple ( types) => types. iter ( ) . all ( |ty| is_uninit_value_valid_for_ty ( cx, ty) ) ,
399
399
ty:: Adt ( adt, _) => cx. tcx . lang_items ( ) . maybe_uninit ( ) == Some ( adt. did ) ,
400
400
_ => false ,
401
401
}
@@ -426,8 +426,8 @@ impl<'tcx> ExprFnSig<'tcx> {
426
426
pub fn input ( self , i : usize ) -> Binder < ' tcx , Ty < ' tcx > > {
427
427
match self {
428
428
Self :: Sig ( sig) => sig. input ( i) ,
429
- Self :: Closure ( sig) => sig. input ( 0 ) . map_bound ( |ty| ty. tuple_element_ty ( i ) . unwrap ( ) ) ,
430
- Self :: Trait ( inputs, _) => inputs. map_bound ( |ty| ty. tuple_element_ty ( i ) . unwrap ( ) ) ,
429
+ Self :: Closure ( sig) => sig. input ( 0 ) . map_bound ( |ty| ty. tuple_fields ( ) [ i ] ) ,
430
+ Self :: Trait ( inputs, _) => inputs. map_bound ( |ty| ty. tuple_fields ( ) [ i ] ) ,
431
431
}
432
432
}
433
433
0 commit comments