File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed
src/test/ui/type-alias-impl-trait Expand file tree Collapse file tree 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() {
1111 assert_eq ! ( bar2( ) . to_string( ) , "bar2" ) ;
1212 let mut x = bar1 ( ) ;
1313 x = bar2 ( ) ;
14- assert_eq ! ( boo:: boo( ) . to_string( ) , "boo" ) ;
1514 assert_eq ! ( my_iter( 42u8 ) . collect:: <Vec <u8 >>( ) , vec![ 42u8 ] ) ;
1615}
1716
@@ -33,15 +32,6 @@ fn bar2() -> Bar {
3332 "bar2"
3433}
3534
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-
4535type MyIter < T > = impl Iterator < Item = T > ;
4636
4737fn my_iter < T > ( t : T ) -> MyIter < T > {
You can’t perform that action at this time.
0 commit comments