rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.21k stars 12.56k forks source link

Dining Philosophers example does not compile in Win64 1.0.0 beta build #25649

Closed ElderThorin closed 9 years ago

ElderThorin commented 9 years ago

I installed Rust from the Windows 64 bit beta build available from here: http://doc.rust-lang.org/book/installing-rust.html

The version rustc reports is: rustc 1.0.0-beta (9854143cb 2015-04-02) (built 2015-04-02) I installed it on a Win 7 machine.

Attempting to compile the last couple versions of the dining philosophers code from the following example results in a compile error.

Location: http://doc.rust-lang.org/stable/book/dining-philosophers.html

Error:

src\main.rs:61:18: 61:26 error: type `core::result::Result<(), Box<core::any::Any + Send>>` does not implement any method in scope named `unwrap`
src\main.rs:61         h.join().unwrap();

Code excerpt:

  for h in handles {
      h.join().unwrap();
  }

The compile error can easily be worked around in this example by adding .ok() prior to the .unwrap() call, so for some result the core::result::Result<...> unwrap method is missing, not visible, or something like that (I only just started looking at rest yesterday morning.)

Note that this code works fine in the 'Rust Playground' web application.

Stebalien commented 9 years ago

See: #25493

ElderThorin commented 9 years ago

Thank you, uninstalling the beta version and installing the non-beta 1.0.0 version built 2015-05-14 resolves this problem. I assume this will be marked closed though with the closing of #25493

steveklabnik commented 9 years ago

Yup! Thanks.