We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b38776 commit 8a472a5Copy full SHA for 8a472a5
src/libstd/macros.rs
@@ -470,11 +470,26 @@ pub mod builtin {
470
///
471
/// # Examples
472
473
+ /// Assume there are two files in the same directory with the following
474
+ /// contents:
475
+ ///
476
+ /// File 'my_str.in':
477
478
/// ```ignore
- /// fn foo() {
- /// include!("/path/to/a/file")
479
+ /// "Hello World!"
480
+ /// ```
481
482
+ /// File 'main.rs':
483
484
+ /// ```ignore
485
+ /// fn main() {
486
+ /// let my_str = include!("my_str.in");
487
+ /// println!("{}", my_str);
488
/// }
489
/// ```
490
491
+ /// Compiling 'main.rs' and running the resulting binary will print "Hello
492
+ /// World!".
493
#[stable(feature = "rust1", since = "1.0.0")]
494
#[macro_export]
495
macro_rules! include { ($file:expr) => ({ /* compiler built-in */ }) }
0 commit comments