33// Fns with that type used only in their body are also recompiled, but
44// their callers are not.
55
6- //@ revisions:cfail1 cfail2
6+ //@ revisions: bfail1 bfail2
77//@ compile-flags: -Z query-dep-graph
88//@ build-pass
99//@ ignore-backends: gcc
1313#![ crate_type = "rlib" ]
1414
1515// These are expected to require codegen.
16- #![ rustc_partition_codegened( module="struct_point-point" , cfg="cfail2 " ) ]
17- #![ rustc_partition_codegened( module="struct_point-fn_with_type_in_sig" , cfg="cfail2 " ) ]
18- #![ rustc_partition_codegened( module="struct_point-call_fn_with_type_in_sig" , cfg="cfail2 " ) ]
19- #![ rustc_partition_codegened( module="struct_point-fn_with_type_in_body" , cfg="cfail2 " ) ]
20- #![ rustc_partition_codegened( module="struct_point-fn_make_struct" , cfg="cfail2 " ) ]
21- #![ rustc_partition_codegened( module="struct_point-fn_read_field" , cfg="cfail2 " ) ]
22- #![ rustc_partition_codegened( module="struct_point-fn_write_field" , cfg="cfail2 " ) ]
16+ #![ rustc_partition_codegened( module="struct_point-point" , cfg="bfail2 " ) ]
17+ #![ rustc_partition_codegened( module="struct_point-fn_with_type_in_sig" , cfg="bfail2 " ) ]
18+ #![ rustc_partition_codegened( module="struct_point-call_fn_with_type_in_sig" , cfg="bfail2 " ) ]
19+ #![ rustc_partition_codegened( module="struct_point-fn_with_type_in_body" , cfg="bfail2 " ) ]
20+ #![ rustc_partition_codegened( module="struct_point-fn_make_struct" , cfg="bfail2 " ) ]
21+ #![ rustc_partition_codegened( module="struct_point-fn_read_field" , cfg="bfail2 " ) ]
22+ #![ rustc_partition_codegened( module="struct_point-fn_write_field" , cfg="bfail2 " ) ]
2323
24- #![ rustc_partition_reused( module="struct_point-call_fn_with_type_in_body" , cfg="cfail2 " ) ]
24+ #![ rustc_partition_reused( module="struct_point-call_fn_with_type_in_body" , cfg="bfail2 " ) ]
2525
2626pub mod point {
27- #[ cfg( cfail1 ) ]
27+ #[ cfg( bfail1 ) ]
2828 pub struct Point {
2929 pub x : f32 ,
3030 pub y : f32 ,
3131 }
3232
33- #[ cfg( cfail2 ) ]
33+ #[ cfg( bfail2 ) ]
3434 pub struct Point {
3535 pub x : f32 ,
3636 pub y : f32 ,
@@ -39,18 +39,18 @@ pub mod point {
3939
4040 impl Point {
4141 pub fn origin ( ) -> Point {
42- #[ cfg( cfail1 ) ]
42+ #[ cfg( bfail1 ) ]
4343 return Point { x : 0.0 , y : 0.0 } ;
4444
45- #[ cfg( cfail2 ) ]
45+ #[ cfg( bfail2 ) ]
4646 return Point { x : 0.0 , y : 0.0 , z : 0.0 } ;
4747 }
4848
4949 pub fn total ( & self ) -> f32 {
50- #[ cfg( cfail1 ) ]
50+ #[ cfg( bfail1 ) ]
5151 return self . x + self . y ;
5252
53- #[ cfg( cfail2 ) ]
53+ #[ cfg( bfail2 ) ]
5454 return self . x + self . y + self . z ;
5555 }
5656
@@ -70,7 +70,7 @@ pub mod point {
7070pub mod fn_with_type_in_sig {
7171 use point:: Point ;
7272
73- #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="cfail2 " ) ]
73+ #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="bfail2 " ) ]
7474 pub fn boop ( p : Option < & Point > ) -> f32 {
7575 p. map ( |p| p. total ( ) ) . unwrap_or ( 0.0 )
7676 }
@@ -86,7 +86,7 @@ pub mod fn_with_type_in_sig {
8686pub mod call_fn_with_type_in_sig {
8787 use fn_with_type_in_sig;
8888
89- #[ rustc_clean( except="typeck_root,optimized_mir" , cfg="cfail2 " ) ]
89+ #[ rustc_clean( except="typeck_root,optimized_mir" , cfg="bfail2 " ) ]
9090 pub fn bip ( ) -> f32 {
9191 fn_with_type_in_sig:: boop ( None )
9292 }
@@ -102,7 +102,7 @@ pub mod call_fn_with_type_in_sig {
102102pub mod fn_with_type_in_body {
103103 use point:: Point ;
104104
105- #[ rustc_clean( except="typeck_root,optimized_mir" , cfg="cfail2 " ) ]
105+ #[ rustc_clean( except="typeck_root,optimized_mir" , cfg="bfail2 " ) ]
106106 pub fn boop ( ) -> f32 {
107107 Point :: origin ( ) . total ( )
108108 }
@@ -115,7 +115,7 @@ pub mod fn_with_type_in_body {
115115pub mod call_fn_with_type_in_body {
116116 use fn_with_type_in_body;
117117
118- #[ rustc_clean( cfg="cfail2 " ) ]
118+ #[ rustc_clean( cfg="bfail2 " ) ]
119119 pub fn bip ( ) -> f32 {
120120 fn_with_type_in_body:: boop ( )
121121 }
@@ -125,7 +125,7 @@ pub mod call_fn_with_type_in_body {
125125pub mod fn_make_struct {
126126 use point:: Point ;
127127
128- #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="cfail2 " ) ]
128+ #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="bfail2 " ) ]
129129 pub fn make_origin ( p : Point ) -> Point {
130130 Point { ..p }
131131 }
@@ -135,7 +135,7 @@ pub mod fn_make_struct {
135135pub mod fn_read_field {
136136 use point:: Point ;
137137
138- #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="cfail2 " ) ]
138+ #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="bfail2 " ) ]
139139 pub fn get_x ( p : Point ) -> f32 {
140140 p. x
141141 }
@@ -145,7 +145,7 @@ pub mod fn_read_field {
145145pub mod fn_write_field {
146146 use point:: Point ;
147147
148- #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="cfail2 " ) ]
148+ #[ rustc_clean( except="typeck_root,fn_sig,optimized_mir" , cfg="bfail2 " ) ]
149149 pub fn inc_x ( p : & mut Point ) {
150150 p. x += 1.0 ;
151151 }
0 commit comments