Skip to content

Commit 8e449ea

Browse files
committed
fmt: cargo fmt --all
Co-Authored-By: internal-model
1 parent c2da37f commit 8e449ea

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

crates/xb-compiler/src/text_ir.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,10 @@ impl TextIrEmitter {
551551
}
552552
None => {
553553
if *is_array && *shared {
554-
out.push_str(&format!("{prefix}dim {sh}{}[]\n", self.emit_symbol(symbol)))
554+
out.push_str(&format!(
555+
"{prefix}dim {sh}{}[]\n",
556+
self.emit_symbol(symbol)
557+
))
555558
} else {
556559
out.push_str(&format!("{prefix}dim {sh}{}\n", self.emit_symbol(symbol)))
557560
}

crates/xb-runtime/tests/cgen_cemitter_sync.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,16 @@ fn build_native_cgen(tmp: &Path) -> PathBuf {
6060
fn cgen_emit(cgen_exe: &Path, ir: &str) -> Vec<u8> {
6161
// Use temp files + shell redirection to avoid pipe deadlock when cgen emits >64KB (facets).
6262
// cgen reads IR from stdin and writes C to stdout, so use sh to redirect.
63-
let tmp_ir = std::env::temp_dir().join(format!("cgen_ir_{}_{:?}.ir", std::process::id(), std::thread::current().id()));
64-
let tmp_out = std::env::temp_dir().join(format!("cgen_out_{}_{:?}.c", std::process::id(), std::thread::current().id()));
63+
let tmp_ir = std::env::temp_dir().join(format!(
64+
"cgen_ir_{}_{:?}.ir",
65+
std::process::id(),
66+
std::thread::current().id()
67+
));
68+
let tmp_out = std::env::temp_dir().join(format!(
69+
"cgen_out_{}_{:?}.c",
70+
std::process::id(),
71+
std::thread::current().id()
72+
));
6573
std::fs::write(&tmp_ir, ir).expect("write ir");
6674
let out = Command::new("sh")
6775
.arg("-c")
@@ -105,7 +113,11 @@ fn cgen_emit(cgen_exe: &Path, ir: &str) -> Vec<u8> {
105113
let data = std::fs::read(&tmp_out).unwrap_or_else(|_| out.stdout.clone());
106114
let _ = std::fs::remove_file(&tmp_ir);
107115
let _ = std::fs::remove_file(&tmp_out);
108-
if data.is_empty() { out.stdout } else { data }
116+
if data.is_empty() {
117+
out.stdout
118+
} else {
119+
data
120+
}
109121
}
110122

111123
/// Compile C source bytes to a native exe, run it with optional raw stdin,

0 commit comments

Comments
 (0)