diff --git a/tests/ui-fulldeps/stable-mir/smir_serde.rs b/tests/ui-fulldeps/stable-mir/smir_serde.rs index f9a9a4d6a9558..957d840f7a241 100644 --- a/tests/ui-fulldeps/stable-mir/smir_serde.rs +++ b/tests/ui-fulldeps/stable-mir/smir_serde.rs @@ -31,13 +31,19 @@ use serde_json::to_string; const CRATE_NAME: &str = "input"; fn serialize_to_json(_tcx: TyCtxt<'_>) -> ControlFlow<()> { - let path = "output.json"; - let mut writer = BufWriter::new(std::fs::File::create(path).expect("Failed to create path")); - let local_crate = stable_mir::local_crate(); - let items: Vec<Body> = stable_mir::all_local_items().iter().map(|item| { item.body() }).collect(); - let crate_data = ( local_crate.name, items ); - writer.write_all(to_string(&crate_data).expect("serde_json failed").as_bytes()).expect("JSON serialization failed"); - ControlFlow::Continue(()) + let path = "output.json"; + let mut writer = BufWriter::new(std::fs::File::create(path) + .expect("Failed to create path")); + let local_crate = stable_mir::local_crate(); + let items: Vec<Body> = stable_mir::all_local_items() + .iter() + .map(|item| { item.body() }) + .collect(); + let crate_data = ( local_crate.name, items ); + writer.write_all(to_string(&crate_data) + .expect("serde_json failed") + .as_bytes()).expect("JSON serialization failed"); + ControlFlow::Continue(()) } /// This test will generate and analyze a dummy crate using the stable mir.