-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Avoid tearing dbg! prints #149859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Avoid tearing dbg! prints #149859
Conversation
|
|
|
@joboet The // NOTE: We cannot use `concat!` to make a static string as a format argument
// of `eprintln!` because `file!` could contain a `{` or
// `$val` expression could be a block (`{ .. }`), in which case the `eprintln!`
// will be malformed. |
|
That's different, that's warning against combining the output of |
|
If you'd like to see the other approach I've tried you can see it here: abe2246 It should work in theory, it just refuses to compile because of the unstable macro feature despite enabling that feature, in a way I don't understand. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
I've found another solution: #149869. |
Fixes #136703.
I did attempt a solution which collects all expressions into a tuple
tmpbefore iterating over that tuple using the unstablemacro_metavar_exprtmp.${index()}, but that refused to compile even with#[allow_internal_unstable(macro_metavar_expr)]and/or#![feature(macro_metavar_expr)]:As mentioned in the code comment, the original proposed solution in the issue of simply holding the
stderrlock is undesirable because it can lead to deadlocks.