File tree 2 files changed +23
-10
lines changed
src/test/ui/type-alias-impl-trait
2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change
1
+ // check-pass
2
+
3
+ #![ feature( type_alias_impl_trait) ]
4
+ #![ allow( dead_code) ]
5
+
6
+ // test that the type alias impl trait defining use is in a submodule
7
+
8
+ fn main ( ) { }
9
+
10
+ type Foo = impl std:: fmt:: Display ;
11
+ type Bar = impl std:: fmt:: Display ;
12
+
13
+ mod foo {
14
+ pub fn foo ( ) -> super :: Foo {
15
+ "foo"
16
+ }
17
+
18
+ pub mod bar {
19
+ pub fn bar ( ) -> crate :: Bar {
20
+ 1
21
+ }
22
+ }
23
+ }
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ fn main() {
11
11
assert_eq ! ( bar2( ) . to_string( ) , "bar2" ) ;
12
12
let mut x = bar1 ( ) ;
13
13
x = bar2 ( ) ;
14
- assert_eq ! ( boo:: boo( ) . to_string( ) , "boo" ) ;
15
14
assert_eq ! ( my_iter( 42u8 ) . collect:: <Vec <u8 >>( ) , vec![ 42u8 ] ) ;
16
15
}
17
16
@@ -33,15 +32,6 @@ fn bar2() -> Bar {
33
32
"bar2"
34
33
}
35
34
36
- // definition in submodule
37
- type Boo = impl std:: fmt:: Display ;
38
-
39
- mod boo {
40
- pub fn boo ( ) -> super :: Boo {
41
- "boo"
42
- }
43
- }
44
-
45
35
type MyIter < T > = impl Iterator < Item = T > ;
46
36
47
37
fn my_iter < T > ( t : T ) -> MyIter < T > {
You can’t perform that action at this time.
0 commit comments