Skip to content

Commit 8184e2d

Browse files
author
Stephen Skeirik
committed
update test file format
1 parent a0eccf9 commit 8184e2d

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tests/ui-fulldeps/stable-mir/smir_serde.rs

+13-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,19 @@ use serde_json::to_string;
3131
const CRATE_NAME: &str = "input";
3232

3333
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(())
4147
}
4248

4349
/// This test will generate and analyze a dummy crate using the stable mir.

0 commit comments

Comments
 (0)