@@ -169,7 +169,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
169169 // because we don't want to lint functions returning empty arrays
170170 is_must_use_ty ( cx, * ty)
171171 } ,
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) ) ,
173173 ty:: Opaque ( ref def_id, _) => {
174174 for ( predicate, _) in cx. tcx . explicit_item_bounds ( * def_id) {
175175 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 {
249249/// Returns `true` if the given type is a primitive (a `bool` or `char`, any integer or
250250/// floating-point number type, a `str`, or an array, slice, or tuple of those types).
251251pub fn is_recursively_primitive_type ( ty : Ty < ' _ > ) -> bool {
252- match ty. kind ( ) {
252+ match * ty. kind ( ) {
253253 ty:: Bool | ty:: Char | ty:: Int ( _) | ty:: Uint ( _) | ty:: Float ( _) | ty:: Str => true ,
254254 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) ,
257257 _ => false ,
258258 }
259259}
@@ -393,9 +393,9 @@ pub fn same_type_and_consts<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
393393
394394/// Checks if a given type looks safe to be uninitialized.
395395pub 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) ) ,
399399 ty:: Adt ( adt, _) => cx. tcx . lang_items ( ) . maybe_uninit ( ) == Some ( adt. did ) ,
400400 _ => false ,
401401 }
@@ -426,8 +426,8 @@ impl<'tcx> ExprFnSig<'tcx> {
426426 pub fn input ( self , i : usize ) -> Binder < ' tcx , Ty < ' tcx > > {
427427 match self {
428428 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 ] ) ,
431431 }
432432 }
433433
0 commit comments