Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdbook 0.4.15 build fail with rustc 1.64, but works on rustc 1.62 #3

Closed
dieterplex opened this issue Oct 12, 2022 · 1 comment
Closed

Comments

@dieterplex
Copy link
Owner

According to rust-lang/rust#99591
Unless we upgrade dependencies or use previous rustc, it would not compile:

> cargo test
   Compiling mdbook v0.4.15
error[E0597]: `local_ctx` does not live long enough
   --> /home/dieter/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/mdbook-0.4.15/src/renderer/html_handlebars/helpers/navigation.rs:154:25
    |
154 |             t.render(r, &local_ctx, &mut local_rc, out)
    |                         ^^^^^^^^^^ borrowed value does not live long enough
155 |         })?;
    |         -
    |         |
    |         `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
warning: build failed, waiting for other jobs to finish...
> rustc -V
rustc 1.64.0 (a55dd71d5 2022-09-19)

For 0.4.15 a workaround may still use 1.62 instead

rustup toolchain intall 1.62
rustup default 1.62
@dieterplex
Copy link
Owner Author

Fix by upgrading mdbook version: 2ead376.

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

No branches or pull requests

1 participant