构建trpl-ebook时遇到错误:没有实体的方法中不允许使用模式

Nab*_*Pal 0 rust rust-cargo

我想为我的Kindle 生成Rust编程语言的epub电子书.

我下载了这个Github项目,重建了第二版草案.当我这样做时cargo run --release,我遇到以下错误:

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
Run Code Online (Sandbox Code Playgroud)

我试图搜索并调试错误但由于我目前对Rust缺乏了解而无法这样做.有没有人遇到这个错误?

我使用的是Ubuntu 16.04,Rust 1.25.0-夜间(b5392f545 2018-01-08),xargo 0.3.10,货物0.25.0-夜间(a88fbace4 2017-12-29)

我还在GitHub回购中提出了一个问题.

She*_*ter 7

rustc-serialize 0.3.19于2016年4月4日发布.它包括以下语法:

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>;
Run Code Online (Sandbox Code Playgroud)

这个语法被错误地允许到201610月21日(Rust 1.14.0),当它变成警告时.201711月4日(Rust 1.23.0),这成了一个错误.

解决方案是更新rustc-serialize的版本:

cargo update -p rustc-serialize
Run Code Online (Sandbox Code Playgroud)