killercup / trpl-ebook

UNMAINTAINED
http://killercup.github.io/trpl-ebook/
478 stars 56 forks source link

Error while installing #49

Closed palnabarun closed 6 years ago

palnabarun commented 6 years ago

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 commented 6 years ago

This was cross-posted to Stack Overflow.

palnabarun commented 6 years ago

Thanks @shepmaster for cross-referencing the posts.

killercup commented 6 years ago

Can you run cargo update (to try and get the latest versions of the dependencies) and see if this fixes the build?

Nabarun Pal notifications@github.com schrieb am Sa. 20. Jan. 2018 um 16:22:

Thanks @shepmaster https://github.com/shepmaster for cross-referencing the posts.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/killercup/trpl-ebook/issues/49#issuecomment-359178819, or mute the thread https://github.com/notifications/unsubscribe-auth/AABOX9kfDgOnFgHmX4t9dRd957p17vvBks5tMgS5gaJpZM4Rld9E .

shepmaster commented 6 years ago

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 commented 6 years ago

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

palnabarun commented 6 years ago

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

Thanks @shepmaster for the help.

killercup commented 6 years ago

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 commented 6 years ago

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

killercup commented 6 years ago

Indeed!

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

palnabarun commented 6 years ago

Sure. @killercup