Skip to content

Commit

Permalink
Auto merge of #28047 - steveklabnik:doc_print, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Aug 28, 2015
2 parents 6f28232 + d9819b7 commit ab792ab
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/libstd/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ macro_rules! panic {
/// Note that stdout is frequently line-buffered by default so it may be
/// necessary to use `io::stdout().flush()` to ensure the output is emitted
/// immediately.
///
/// # Examples
///
/// ```
/// use std::io::{self, Write};
///
/// print!("this ");
/// print!("will ");
/// print!("be ");
/// print!("on ");
/// print!("the ");
/// print!("same ");
/// print!("line ");
///
/// io::stdout().flush().unwrap();
///
/// print!("this string has a newline, why not choose println! instead?\n");
///
/// io::stdout().flush().unwrap();
/// ```
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable]
Expand Down

0 comments on commit ab792ab

Please sign in to comment.