Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch9.2 : outdated error quoted #1262

Closed
ghost opened this issue Apr 1, 2018 · 3 comments
Closed

ch9.2 : outdated error quoted #1262

ghost opened this issue Apr 1, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 1, 2018

seen here https://doc.rust-lang.org/stable/book/second-edition/ch09-02-recoverable-errors-with-result.html EDIT: or scroll up 4 lines from this: https://doc.rust-lang.org/stable/book/second-edition/ch09-02-recoverable-errors-with-result.html#matching-on-different-errors
as:

thread 'main' panicked at 'There was a problem opening the file: Error { repr:
Os { code: 2, message: "No such file or directory" } }', src/main.rs:9:12

but actual error, currently, is:

thread 'main' panicked at 'There was a problem opening the file: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:9:13

diff:

--- inbook	2018-04-01 11:48:07.607884299 +0200
+++ shouldbe	2018-04-01 11:48:12.349824685 +0200
@@ -1,2 +1,2 @@
-thread 'main' panicked at 'There was a problem opening the file: Error { repr: Os { code: 2, message: "No such file or directory" } }', src/main.rs:9:12
+thread 'main' panicked at 'There was a problem opening the file: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:9:13
 

screenshot:
untitled

Side note:

The error doesn't include the name of the file, so I imagine this will be hell to track down if the error is just propagated upwards. Oh actually, I do remember one example I've encountered: lukaslueg/built#14

@ghost
Copy link
Author

ghost commented Apr 1, 2018

there are 2 more such outdated errors on that page, just search for thread 'main' panicked at to find them.

@carols10cents
Copy link
Member

The second edition of the book is using Rust 1.21.0 for the purposes of the printed version. Is that the version you're using?

@ghost
Copy link
Author

ghost commented Apr 1, 2018

I guess not. I only hit the Play button on the example which means playground is using latest stable:

rustc 1.25.0 (84203cac6 2018-03-25)
binary: rustc
commit-hash: 84203cac67e65ca8640b8392348411098c856985
commit-date: 2018-03-25
host: x86_64-unknown-linux-gnu
release: 1.25.0
LLVM version: 6.0

My bad then, closing :)
Thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant