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

error[E0597]: local_ctx does not live long enough #63

Closed
niaiwomattt opened this issue Nov 27, 2022 · 5 comments
Closed

error[E0597]: local_ctx does not live long enough #63

niaiwomattt opened this issue Nov 27, 2022 · 5 comments

Comments

@niaiwomattt
Copy link

error[E0597]: `local_ctx` does not live long enough
   --> /root/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/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
warning: build failed, waiting for other jobs to finish...
error: failed to compile `mdbook-epub v0.3.0`, intermediate artifacts can be found at `/tmp/cargo-installeVRNpc`
@blandger
Copy link
Collaborator

Pls give more details. Rust compiler version, platform, that is the branch ? Thanks.

@niaiwomattt
Copy link
Author

niaiwomattt commented Nov 28, 2022

rustc 1.65.0 (897e37553 2022-11-02)
cargo 1.65.0 (4bc8f24d3 2022-10-20)
Ubuntu 22.04(docker) and macOS 10.14.6(Real machine)

command: cargo install mdbook-epub

@dieterplex
Copy link
Contributor

I believe it's rust-lang/rust#99591.
Before releasing next version, consider to install with

cargo install --git https://github.com/Michael-F-Bryan/mdbook-epub

@niaiwomattt
Copy link
Author

niaiwomattt commented Nov 28, 2022

I believe it's rust-lang/rust#99591. Before releasing next version, consider to install with

cargo install --git https://github.com/Michael-F-Bryan/mdbook-epub

The rustc stable version rustc 1.65.0 (897e37553 2022-11-02) cannot be installed successfully with the command cargo install --git https://github.com/Michael-F-Bryan/mdbook-epub, and an error is still reported. After installing the nightly version, you can successfully install this plug-in.

Thank you. After installing nightly-x86_64-unknown-linux-gnu installed - rustc 1.67.0-nightly (1eb62b123 2022-11-27) version, I successfully installed cargo install --git https://github.com/Michael-F-Bryan/mdbook-epub using the command you provided

@blandger
Copy link
Collaborator

New updated version 0.4.25 is published on crates.io.

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

3 participants