File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -461,9 +461,26 @@ pub mod builtin {
461461 ///
462462 /// # Examples
463463 ///
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+ ///
464475 /// ```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+ /// }
466481 /// ```
482+ ///
483+ /// Compiling 'main.rs' and running the resulting binary will print "adiós".
467484 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
468485 #[ macro_export]
469486 macro_rules! include_str { ( $file: expr) => ( { /* compiler built-in */ } ) }
You can’t perform that action at this time.
0 commit comments