Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Error while installing #49

Closed
palnabarun opened this issue Jan 20, 2018 · 10 comments
Closed

Error while installing #49

palnabarun opened this issue Jan 20, 2018 · 10 comments

Comments

@palnabarun
Copy link
Contributor

I am new to rust and I wanted to generate the epub format ebook for my kindle.

I downloaded the project to rebuild the book the second edition draft. When I do cargo run --release, I encounter the following error:

nabarun@pal:~/codesl/trpl-ebook (git:master) $ cargo run --release
   Compiling rustc-serialize v0.3.19
   Compiling memchr v0.1.11
   Compiling kernel32-sys v0.2.2
error[E0642]: patterns aren't allowed in methods without bodies
   --> /home/nabarun/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.19/src/serialize.rs:147:45
    |
147 |                                             &f_name: &str,
    |                                             ^^^^^^^

   Compiling aho-corasick v0.5.3
   Compiling thread-id v2.0.0
   Compiling thread_local v0.2.7
   Compiling regex v0.1.77
error: aborting due to previous error

error: Could not compile `rustc-serialize`.
warning: build failed, waiting for other jobs to finish...
error: build failed

I tried to search and debug the error but couldn't do so owing to my lack of knowledge of rust at the moment. Did anyone else encounter this error?

@shepmaster
Copy link

This was cross-posted to Stack Overflow.

@palnabarun
Copy link
Contributor Author

Thanks @shepmaster for cross-referencing the posts.

@killercup
Copy link
Owner

killercup commented Jan 20, 2018 via email

@shepmaster
Copy link

shepmaster commented Jan 20, 2018

Cross-posting my answer:


rustc-serialize 0.3.19 was released on April 4, 2016. It includes the syntax:

fn read_enum_struct_variant_field<T, F>(
    &mut self,
    &f_name: &str, // This is no longer allowed
    f_idx: usize,
    f: F,
) -> Result<T, Self::Error>;

This syntax was erroneously allowed until Oct 21, 2016 (Rust 1.14.0) when it was turned into a warning. On Nov 4, 2017 (Rust 1.23.0), this became an error.

The solution is to update the version of rustc-serialize.

@shepmaster
Copy link

@killercup the real fix would be to move away from rustc-serialize, but I'm guessing you know that ;-).

@palnabarun
Copy link
Contributor Author

palnabarun commented Jan 20, 2018

Well, it worked but cropped up another issue which according to me is a different thread altogether

Thanks @shepmaster for the help.

@killercup
Copy link
Owner

the real fix would be to move away from rustc-serialize, but I'm guessing you know that ;-).

@shepmaster the real fix would be to move this functionality into mdBook, but I'm guessing you know that ;-).

@shepmaster
Copy link

Seems like this issue should remain open until the master branch has been updated?

@killercup
Copy link
Owner

Indeed!

@palnabarun can you open a PR that updates the Cargo.lock file so the project compiles again?

@killercup killercup reopened this Jan 20, 2018
@palnabarun
Copy link
Contributor Author

Sure. @killercup

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants