File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -461,9 +461,26 @@ pub mod builtin {
461
461
///
462
462
/// # Examples
463
463
///
464
+ /// Assume there are two files in the same directory with the following
465
+ /// contents:
466
+ ///
467
+ /// File 'spanish.in':
468
+ ///
469
+ /// ```text
470
+ /// adiós
471
+ /// ```
472
+ ///
473
+ /// File 'main.rs':
474
+ ///
464
475
/// ```ignore (cannot-doctest-external-file-dependency)
465
- /// let secret_key = include_str!("secret-key.ascii");
476
+ /// fn main() {
477
+ /// let my_str = include_str!("spanish.in");
478
+ /// assert_eq!(my_str, "adiós\n");
479
+ /// print!("{}", my_str);
480
+ /// }
466
481
/// ```
482
+ ///
483
+ /// Compiling 'main.rs' and running the resulting binary will print "adiós".
467
484
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
468
485
#[ macro_export]
469
486
macro_rules! include_str { ( $file: expr) => ( { /* compiler built-in */ } ) }
You can’t perform that action at this time.
0 commit comments