Skip to content

mdBook fails cargo install due to handlebars change #852

@ehuss

Description

@ehuss
Contributor

Because Cargo.lock is not published by default, running cargo install mdbook is now failing because it is picking up a new version of handlebars which is incompatible. See sunng87/handlebars-rust#249. I am getting these errors:

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/navigation.rs:55:23
   |
55 |     let chapters = rc.evaluate_absolute(ctx, "chapters", true).and_then(|c| {
   |                       ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0308]: mismatched types
  --> src/renderer/html_handlebars/helpers/navigation.rs:56:57
   |
56 |         serde_json::value::from_value::<Vec<StringMap>>(c.clone())
   |                                                         ^^^^^^^^^ expected enum `handlebars::Value`, found enum `std::option::Option`
   |
   = note: expected type `handlebars::Value`
              found type `std::option::Option<&handlebars::Value>`

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/navigation.rs:61:10
   |
61 |         .evaluate_absolute(ctx, "path", true)?
   |          ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
  --> src/renderer/html_handlebars/helpers/navigation.rs:62:10
   |
62 |         .as_str()
   |          ^^^^^^

error[E0277]: the size for values of type `str` cannot be known at compilation time
  --> src/renderer/html_handlebars/helpers/navigation.rs:60:9
   |
60 |     let base_path = rc
   |         ^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `str`
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
   --> src/renderer/html_handlebars/helpers/navigation.rs:100:10
    |
100 |         .evaluate_absolute(ctx, "path", false)?
    |          ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
   --> src/renderer/html_handlebars/helpers/navigation.rs:101:10
    |
101 |         .as_str()
    |          ^^^^^^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/theme.rs:20:10
   |
20 |         .evaluate_absolute(ctx, "default_theme", true)?
   |          ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
  --> src/renderer/html_handlebars/helpers/theme.rs:21:10
   |
21 |         .as_str()
   |          ^^^^^^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/toc.rs:28:27
   |
28 |         let chapters = rc.evaluate_absolute(ctx, "chapters", true).and_then(|c| {
   |                           ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0308]: mismatched types
  --> src/renderer/html_handlebars/helpers/toc.rs:29:76
   |
29 |             serde_json::value::from_value::<Vec<BTreeMap<String, String>>>(c.clone())
   |                                                                            ^^^^^^^^^ expected enum `handlebars::Value`, found enum `std::option::Option`
   |
   = note: expected type `handlebars::Value`
              found type `std::option::Option<&handlebars::Value>`

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/toc.rs:33:14
   |
33 |             .evaluate_absolute(ctx, "path", true)?
   |              ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
  --> src/renderer/html_handlebars/helpers/toc.rs:34:14
   |
34 |             .as_str()
   |              ^^^^^^

error: aborting due to 13 previous errors

Activity

added a commit that references this issue on Dec 14, 2018
ehuss

ehuss commented on Dec 16, 2018

@ehuss
ContributorAuthor

Handlebars 1.2 has been yanked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ehuss

        Issue actions

          mdBook fails `cargo install` due to handlebars change · Issue #852 · rust-lang/mdBook