Skip to content

Commit 23077a5

Browse files
authored
Merge pull request #219 from davidOSUL/master
Clarify the limitation of ? in main and tests
2 parents 2782ae5 + 90077f2 commit 23077a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ fn main() -> Result<(), std::io::Error> {
7575

7676
In this case, if say the file doesn't exist and there is an `Err(err)` somewhere,
7777
then `main` will exit with an error code (not `0`) and print out a `Debug`
78-
representation of `err`.
78+
representation of `err`. Note that this will always print out the `Debug` representation.
79+
If you would like to, for example, print out the `Display` representation of `err`,
80+
you will still have to do what you would in Rust 2015.
7981

8082
## More details
8183

0 commit comments

Comments
 (0)