Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ macro_rules! eprint {
#[cfg(not(feature = "concrete_playback"))]
#[macro_export]
macro_rules! println {
() => { };
() => { $crate::print!("\n") };
($($x:tt)*) => {{ let _ = format_args!($($x)*); }};
}

#[cfg(not(feature = "concrete_playback"))]
#[macro_export]
macro_rules! eprintln {
() => { };
() => { $crate::eprint!("\n") };
($($x:tt)*) => {{ let _ = format_args!($($x)*); }};
}

Expand Down
17 changes: 17 additions & 0 deletions tests/kani/Print/no_semicolon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright Kani Contributors
// SPDX-License-Identifier: Apache-2.0 OR MIT

// This test checks that the (e)println with no arguments do not require a trailing semicolon

fn println() {
println!()
}
fn eprintln() {
eprintln!()
}

#[kani::proof]
fn main() {
println();
eprintln();
}