Skip to content

Commit 38a2cb3

Browse files
DaniPopesMerkleBoy
authored andcommitted
fix: Shell deadlock 2 (foundry-rs#11535)
* test: shell deadlock 2 * fix it
1 parent 0a8b0eb commit 38a2cb3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/common/src/io/macros.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ macro_rules! __sh_dispatch {
146146
// Ensure that the global shell lock is held for as little time as possible.
147147
// Also avoids deadlocks in case of nested calls.
148148
(@impl $f:ident $shell:expr, $($args:tt)*) => {
149-
match ::core::format_args!($($args)*) {
149+
match format!($($args)*) {
150150
fmt => $crate::Shell::$f($shell, fmt),
151151
}
152152
};
@@ -178,7 +178,10 @@ mod tests {
178178

179179
sh_println!("{:?}", {
180180
sh_println!("hi")?;
181-
"nested"
181+
solar::data_structures::fmt::from_fn(|f| {
182+
let _ = sh_println!("even more nested");
183+
write!(f, "hi 2")
184+
})
182185
})?;
183186

184187
Ok(())

0 commit comments

Comments
 (0)