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

Chapter 2 Mandelbrot Set wont compile #39

Closed
Ethan-Arrowood opened this issue Aug 9, 2021 · 1 comment
Closed

Chapter 2 Mandelbrot Set wont compile #39

Ethan-Arrowood opened this issue Aug 9, 2021 · 1 comment

Comments

@Ethan-Arrowood
Copy link

I've seen a couple other issues for this section in particular, but I tried compiling the code from the repo as is and I got the following error:

➜  ch2-mandelbrot git:(1st-edition) ✗ cargo run                   
   Compiling autocfg v1.0.0
   Compiling num-traits v0.2.12
   Compiling num-integer v0.1.43
   Compiling num-bigint v0.3.0
   Compiling num-rational v0.3.0
   Compiling num-iter v0.1.41
   Compiling num-complex v0.3.0
   Compiling num v0.3.0
   Compiling ch2-mandelbrot v0.1.0 (/Users/ethanarrowood/Documents/Programming/rust/rust-in-action/code/ch2/ch2-mandelbrot)
error[E0658]: exclusive range pattern syntax is experimental
  --> src/main.rs:55:9
   |
55 |         0..2 => ' ',
   |         ^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information

error[E0658]: exclusive range pattern syntax is experimental
  --> src/main.rs:56:9
   |
56 |         2..5 => '.',
   |         ^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information

error[E0658]: exclusive range pattern syntax is experimental
  --> src/main.rs:57:9
   |
57 |         5..10 => '•',
   |         ^^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information

error[E0658]: exclusive range pattern syntax is experimental
  --> src/main.rs:58:9
   |
58 |         11..30 => '*',
   |         ^^^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information

error[E0658]: exclusive range pattern syntax is experimental
  --> src/main.rs:59:9
   |
59 |         30..100 => '+',
   |         ^^^^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information

error[E0658]: exclusive range pattern syntax is experimental
  --> src/main.rs:60:9
   |
60 |         100..200 => 'x',
   |         ^^^^^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information

error[E0658]: exclusive range pattern syntax is experimental
  --> src/main.rs:61:9
   |
61 |         200..400 => '$',
   |         ^^^^^^^^
   |
   = note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information

warning: unnecessary parentheses around assigned value
  --> src/main.rs:20:23
   |
20 |       let x_percent = (img_x as f64 / width as f64);
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
   |
   = note: `#[warn(unused_parens)]` on by default

warning: unnecessary parentheses around assigned value
  --> src/main.rs:21:23
   |
21 |       let y_percent = (img_y as f64 / height as f64);
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses

error: aborting due to 7 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0658`.
error: could not compile `ch2-mandelbrot`

To learn more, run the command again with --verbose.

I also ran rustup update stable earlier; do I need to be on a different rust version to run this one? From the referenced github issue it states I should add #![feature(exclusive_range_pattern)] to the top of the file and install the nightly build of rust to run it.

@timClicks
Copy link
Contributor

Sorry about this @Ethan-Arrowood. I've fixed the problem. Please run git pull and the updated code should compile.

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

2 participants