File tree Expand file tree Collapse file tree 4 files changed +71
-0
lines changed
src/test/run-make/pipelined Expand file tree Collapse file tree 4 files changed +71
-0
lines changed Original file line number Diff line number Diff line change
1
+ -include ../../run-make-fulldeps/tools.mk
2
+
3
+ O =$(TMPDIR )
4
+
5
+ all : $O/main
6
+ $O /main
7
+
8
+ $O/main : $O/libmiddle.rlib $O/libleaf.rlib
9
+ $(RUSTC ) main.rs --extern middle=$O /libmiddle.rlib -Ldependency=$O
10
+
11
+ $O/libmiddle.rlib : middle.rs $O/libleaf.rmeta
12
+ $(RUSTC ) --emit link middle.rs --extern leaf=$O /libleaf.rmeta
13
+
14
+ $O/libleaf.rlib $O/libleaf.rmeta : leaf.rs
15
+ $(RUSTC ) --emit metadata,link leaf.rs
Original file line number Diff line number Diff line change
1
+ #![ crate_type = "rlib" ]
2
+
3
+ pub static FOO : & str = "this is a static" ;
4
+
5
+ #[ derive( Debug ) ]
6
+ pub struct Plain {
7
+ pub a : u32 ,
8
+ pub b : u32 ,
9
+ }
10
+
11
+ #[ derive( Debug ) ]
12
+ pub struct GenericStruct < A > {
13
+ pub a : A ,
14
+ pub b : Option < A > ,
15
+ }
16
+
17
+ pub fn simple ( a : u32 , b : u32 ) -> u32 {
18
+ let c = a + b;
19
+ println ! ( "simple {} + {} => {}" , a, b, c) ;
20
+ c
21
+ }
22
+
23
+ pub fn generic < D : std:: fmt:: Debug > ( d : D ) {
24
+ println ! ( "generically printing {:?}" , d) ;
25
+ }
Original file line number Diff line number Diff line change
1
+ #![ crate_type = "bin" ]
2
+
3
+ fn main ( ) {
4
+ middle:: do_a_thing ( ) ;
5
+
6
+ println ! ( "middle::BAR {}" , middle:: BAR ) ;
7
+
8
+ assert_eq ! ( middle:: simple( 2 , 3 ) , 5 ) ;
9
+ }
Original file line number Diff line number Diff line change
1
+ #![ crate_type = "rlib" ]
2
+
3
+ extern crate leaf;
4
+
5
+ pub static BAR : & str = leaf:: FOO ;
6
+
7
+ pub use leaf:: simple;
8
+
9
+ pub fn do_a_thing ( ) {
10
+ let s = leaf:: GenericStruct {
11
+ a : "hello" ,
12
+ b : Some ( "world" )
13
+ } ;
14
+
15
+ let u = leaf:: GenericStruct {
16
+ a : leaf:: Plain { a : 1 , b : 2 } ,
17
+ b : None
18
+ } ;
19
+
20
+ leaf:: generic ( s) ;
21
+ leaf:: generic ( u) ;
22
+ }
You can’t perform that action at this time.
0 commit comments