Improve write! and writeln! error when called without destination#152508
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Feb 15, 2026
Merged
Conversation
Member
|
as far as I can see this requires someone from libs team, since this is r? libs |
Contributor
|
Does this fix the case where someone writes |
Contributor
Author
|
No, |
Member
|
@bors r+ |
Contributor
rust-bors bot
pushed a commit
that referenced
this pull request
Feb 15, 2026
Rollup of 9 pull requests Successful merges: - #150424 (diagnostics: add note when param-env shadows global impl) - #152132 (implement `carryless_mul`) - #152508 (Improve write! and writeln! error when called without destination) - #152534 (Test(lib/win/net): Skip UDS tests when under Win7) - #152578 (ci: Lock cross toolchain version and update docs) - #152188 (Include `library/stdarch` for `CURRENT_RUSTC_VERSION` updates) - #152402 (Add regression test for #141738) - #152472 (unwind/wasm: fix compile error by wrapping wasm_throw in unsafe block) - #152610 (Exchange js_lint message between bless and non-bless)
rust-timer
added a commit
that referenced
this pull request
Feb 15, 2026
Rollup merge of #152508 - arferreira:improve-write-macro-diagnostic, r=Mark-Simulacrum Improve write! and writeln! error when called without destination Fixes #152493 Adds catch-all arms to `write!` and `writeln!` macros so that calling them without a destination (e.g., `write!("S")` instead of `write!(f, "S")`) gives a clear error instead of the cryptic "unexpected end of macro invocation" pointing at macro internals. r? @estebank
github-actions bot
pushed a commit
to rust-lang/stdarch
that referenced
this pull request
Feb 16, 2026
Rollup of 9 pull requests Successful merges: - rust-lang/rust#150424 (diagnostics: add note when param-env shadows global impl) - rust-lang/rust#152132 (implement `carryless_mul`) - rust-lang/rust#152508 (Improve write! and writeln! error when called without destination) - rust-lang/rust#152534 (Test(lib/win/net): Skip UDS tests when under Win7) - rust-lang/rust#152578 (ci: Lock cross toolchain version and update docs) - rust-lang/rust#152188 (Include `library/stdarch` for `CURRENT_RUSTC_VERSION` updates) - rust-lang/rust#152402 (Add regression test for rust-lang/rust#141738) - rust-lang/rust#152472 (unwind/wasm: fix compile error by wrapping wasm_throw in unsafe block) - rust-lang/rust#152610 (Exchange js_lint message between bless and non-bless)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #152493
Adds catch-all arms to
write!andwriteln!macros so that calling them without a destination (e.g.,write!("S")instead ofwrite!(f, "S")) gives a clear error instead of the cryptic "unexpected end of macro invocation" pointing at macro internals.r? @estebank