File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -350,16 +350,18 @@ impl<'tcx> LateLintPass<'tcx> for Types {
350
350
351
351
fn check_impl_item ( & mut self , cx : & LateContext < ' tcx > , item : & ' tcx ImplItem < ' _ > ) {
352
352
match item. kind {
353
- ImplItemKind :: Const ( ty, _) | ImplItemKind :: TyAlias ( ty ) => self . check_ty (
353
+ ImplItemKind :: Const ( ty, _) => self . check_ty (
354
354
cx,
355
355
ty,
356
356
CheckTyContext {
357
357
is_in_trait_impl : true ,
358
358
..CheckTyContext :: default ( )
359
359
} ,
360
360
) ,
361
- // methods are covered by check_fn
362
- ImplItemKind :: Fn ( ..) => ( ) ,
361
+ // Methods are covered by check_fn.
362
+ // Type aliases are ignored because oftentimes it's impossible to
363
+ // make type alias declaration in trait simpler, see #1013
364
+ ImplItemKind :: Fn ( ..) | ImplItemKind :: TyAlias ( ..) => ( ) ,
363
365
}
364
366
}
365
367
Original file line number Diff line number Diff line change
1
+ #![ warn( clippy:: type_complexity) ]
2
+ use std:: iter:: { Filter , Map } ;
3
+ use std:: vec:: IntoIter ;
4
+
5
+ struct S ;
6
+
7
+ impl IntoIterator for S {
8
+ type Item = i32 ;
9
+ // Should not warn since there is no way to simplify this
10
+ type IntoIter = Filter < Map < IntoIter < i32 > , fn ( i32 ) -> i32 > , fn ( & i32 ) -> bool > ;
11
+
12
+ fn into_iter ( self ) -> Self :: IntoIter {
13
+ fn m ( a : i32 ) -> i32 {
14
+ a
15
+ }
16
+ fn p ( _: & i32 ) -> bool {
17
+ true
18
+ }
19
+ vec ! [ 1i32 , 2 , 3 ] . into_iter ( ) . map ( m as fn ( _) -> _ ) . filter ( p)
20
+ }
21
+ }
22
+
23
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments