funkill / mdbook-i18n

MIT License
21 stars 6 forks source link

Unable to compile #23

Closed Alsan closed 1 year ago

Alsan commented 1 year ago

While build with master branch:

   Compiling mdbook v0.3.7
error[E0597]: `local_ctx` does not live long enough
   --> /home/alsan/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/mdbook-0.3.7/src/renderer/html_handlebars/helpers/navigation.rs:155:25
    |
155 |             t.render(r, &local_ctx, &mut local_rc, out)
    |                         ^^^^^^^^^^ borrowed value does not live long enough
156 |         })?;
    |         -
    |         |
    |         `local_ctx` dropped here while still borrowed
    |         borrow might be used here, when `local_rc` is dropped and runs the destructor for type `handlebars::RenderContext<'_, '_>`
    |
    = note: values in a scope are dropped in the opposite order they are defined

For more information about this error, try `rustc --explain E0597`.
error: could not compile `mdbook` due to previous error

and, build with dependabot/cargo/mdbook-0.4.12 branch:

   Compiling mdbook v0.4.21
   Compiling mdbook-i18n v0.1.0 (/home/alsan/Documents/4.3rd-party/mdbook-i18n)
error[E0277]: the trait bound `mdbook::errors::Error: std::error::Error` is not satisfied
  --> src/original_render.rs:10:13
   |
10 | /             MDBook::load_with_config(item.root, item.mdbook_config)
11 | |                 .and_then(|mdbook| mdbook.build())
12 | |                 .map_err(super::error_from_unsync)?;
   | |__________________________________________________^ the trait `std::error::Error` is not implemented for `mdbook::errors::Error`
   |
note: required by a bound in `error_from_unsync`
  --> src/main.rs:33:25
   |
33 | fn error_from_unsync<E: std::error::Error + Send + 'static>(e: E) -> Error {
   |                         ^^^^^^^^^^^^^^^^^ required by this bound in `error_from_unsync`

error[E0277]: the trait bound `mdbook::errors::Error: std::error::Error` is not satisfied
  --> src/original_render.rs:12:26
   |
12 |                 .map_err(super::error_from_unsync)?;
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `mdbook::errors::Error`
   |
note: required by a bound in `error_from_unsync`
  --> src/main.rs:33:25
   |
33 | fn error_from_unsync<E: std::error::Error + Send + 'static>(e: E) -> Error {
   |                         ^^^^^^^^^^^^^^^^^ required by this bound in `error_from_unsync`

error[E0277]: the trait bound `mdbook::errors::Error: std::error::Error` is not satisfied
  --> src/main.rs:27:5
   |
27 | /     RenderContext::from_json(&mut stdin)
28 | |         .map_err(error_from_unsync)?
   | |___________________________________^ the trait `std::error::Error` is not implemented for `mdbook::errors::Error`
   |
note: required by a bound in `error_from_unsync`
  --> src/main.rs:33:25
   |
33 | fn error_from_unsync<E: std::error::Error + Send + 'static>(e: E) -> Error {
   |                         ^^^^^^^^^^^^^^^^^ required by this bound in `error_from_unsync`

error[E0277]: the trait bound `mdbook::errors::Error: std::error::Error` is not satisfied
  --> src/main.rs:28:18
   |
28 |         .map_err(error_from_unsync)?
   |                  ^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `mdbook::errors::Error`
   |
note: required by a bound in `error_from_unsync`
  --> src/main.rs:33:25
   |
33 | fn error_from_unsync<E: std::error::Error + Send + 'static>(e: E) -> Error {
   |                         ^^^^^^^^^^^^^^^^^ required by this bound in `error_from_unsync`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `mdbook-i18n` due to 4 previous errors
funkill commented 1 year ago

Fixed, new version 0.1.2 released