File tree 1 file changed +13
-7
lines changed
tests/ui-fulldeps/stable-mir
1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,19 @@ use serde_json::to_string;
31
31
const CRATE_NAME : & str = "input" ;
32
32
33
33
fn serialize_to_json ( _tcx : TyCtxt < ' _ > ) -> ControlFlow < ( ) > {
34
- let path = "output.json" ;
35
- let mut writer = BufWriter :: new ( std:: fs:: File :: create ( path) . expect ( "Failed to create path" ) ) ;
36
- let local_crate = stable_mir:: local_crate ( ) ;
37
- let items: Vec < Body > = stable_mir:: all_local_items ( ) . iter ( ) . map ( |item| { item. body ( ) } ) . collect ( ) ;
38
- let crate_data = ( local_crate. name , items ) ;
39
- writer. write_all ( to_string ( & crate_data) . expect ( "serde_json failed" ) . as_bytes ( ) ) . expect ( "JSON serialization failed" ) ;
40
- ControlFlow :: Continue ( ( ) )
34
+ let path = "output.json" ;
35
+ let mut writer = BufWriter :: new ( std:: fs:: File :: create ( path)
36
+ . expect ( "Failed to create path" ) ) ;
37
+ let local_crate = stable_mir:: local_crate ( ) ;
38
+ let items: Vec < Body > = stable_mir:: all_local_items ( )
39
+ . iter ( )
40
+ . map ( |item| { item. body ( ) } )
41
+ . collect ( ) ;
42
+ let crate_data = ( local_crate. name , items ) ;
43
+ writer. write_all ( to_string ( & crate_data)
44
+ . expect ( "serde_json failed" )
45
+ . as_bytes ( ) ) . expect ( "JSON serialization failed" ) ;
46
+ ControlFlow :: Continue ( ( ) )
41
47
}
42
48
43
49
/// This test will generate and analyze a dummy crate using the stable mir.
You can’t perform that action at this time.
0 commit comments