Skip to content

Commit 583c93d

Browse files
committed
add println!() macro with out any arguments
1 parent eee2d04 commit 583c93d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libstd/macros.rs

+2
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ macro_rules! print {
112112
/// # Examples
113113
///
114114
/// ```
115+
/// println!();
115116
/// println!("hello there!");
116117
/// println!("format {} arguments", "some");
117118
/// ```
118119
#[macro_export]
119120
#[stable(feature = "rust1", since = "1.0.0")]
120121
macro_rules! println {
122+
() -> (print!("\n"));
121123
($fmt:expr) => (print!(concat!($fmt, "\n")));
122124
($fmt:expr, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
123125
}

0 commit comments

Comments
 (0)