Skip to content

Conversation

GrigorenkoPV
Copy link
Contributor

@GrigorenkoPV GrigorenkoPV commented May 28, 2024

Change the implementation of println! & eprintln! with no arguments to call print!("\n")
& eprint!("\n") respectively instead of producing no tokens. This is what std does. 12

Probably resolves #320. Haven't tested, sorry. It might also make sense to add a test for this.

Footnotes

  1. https://github.com/rust-lang/rust/blob/8c127df75fde3d5ad8ef9af664962a7676288b52/library/std/src/macros.rs#L140

  2. https://github.com/rust-lang/rust/blob/8c127df75fde3d5ad8ef9af664962a7676288b52/library/std/src/macros.rs#L218

@GrigorenkoPV GrigorenkoPV requested a review from a team as a code owner May 28, 2024 13:24
@github-actions github-actions bot added the Z-EndToEndBenchCI Tag a PR to run benchmark CI label May 28, 2024
@zhassan-aws
Copy link
Contributor

Thanks for the contribution @GrigorenkoPV!

It might also make sense to add a test for this.

Can you please add one? It can be placed under tests/kani/Print.

Thank you!

@zhassan-aws
Copy link
Contributor

Probably resolves #320.

I think you meant #3204

@GrigorenkoPV GrigorenkoPV deleted the patch-1 branch May 29, 2024 10:23
@GrigorenkoPV GrigorenkoPV restored the patch-1 branch May 29, 2024 10:24
@GrigorenkoPV GrigorenkoPV deleted the patch-1 branch May 29, 2024 10:25
@GrigorenkoPV GrigorenkoPV mentioned this pull request May 29, 2024
zhassan-aws pushed a commit that referenced this pull request May 29, 2024
GitHub closed the previous PR (#3205) after I renamed a branch, hooray.

Change the implementation of `println!` & `eprintln!` with no arguments
to call `print!("\n")`
& `eprint!("\n")` respectively instead of producing no tokens. This is
what std does. [^println][^eprintln]

 
[^println]:
https://github.com/rust-lang/rust/blob/8c127df75fde3d5ad8ef9af664962a7676288b52/library/std/src/macros.rs#L140
[^eprintln]:
https://github.com/rust-lang/rust/blob/8c127df75fde3d5ad8ef9af664962a7676288b52/library/std/src/macros.rs#L218

Resolves #3204.

A test included, as per
#3205 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-EndToEndBenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants