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 @@ -478,9 +478,26 @@ pub mod builtin {
478478 ///
479479 /// # Examples
480480 ///
481+ /// Assume there are two files in the same directory with the following
482+ /// contents:
483+ ///
484+ /// File 'spanish.in':
485+ ///
486+ /// ```text
487+ /// adiós
488+ /// ```
489+ ///
490+ /// File 'main.rs':
491+ ///
481492 /// ```ignore (cannot-doctest-external-file-dependency)
482- /// let secret_key = include_bytes!("secret-key.bin");
493+ /// fn main() {
494+ /// let bytes = include_bytes!("spanish.in");
495+ /// assert_eq!(bytes, b"adi\xc3\xb3s\n");
496+ /// print!("{}", String::from_utf8_lossy(bytes));
497+ /// }
483498 /// ```
499+ ///
500+ /// Compiling 'main.rs' and running the resulting binary will print "adiós".
484501 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
485502 #[ macro_export]
486503 macro_rules! include_bytes { ( $file: expr) => ( { /* compiler built-in */ } ) }
You can’t perform that action at this time.
0 commit comments