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[E0716]: temporary value dropped while borrowed when cargo install marmite on Ubunt 24.04 LTS #213

Closed
aentinger opened this issue Jan 26, 2025 · 4 comments

Comments

@aentinger
Copy link

Hi @rochacbruno β˜• πŸ‘‹

When I run cargo install marmite on my Ubuntu 24.04 LTS version is fails with

   Compiling marmite v0.2.4
error[E0716]: temporary value dropped while borrowed
   --> /home/alex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/marmite-0.2.4/src/site.rs:731:18
    |
728 |               let author = if let Some(author) = site_data.site.authors.get(*username) {
    |                   ------ borrow later stored here
...
731 |                   &Author {
    |  __________________^
732 | |                     name: (*username).to_string(),
733 | |                     bio: None,
734 | |                     avatar: Some("static/avatar-placeholder.png".to_string()),
735 | |                     links: None,
736 | |                 }
    | |_________________^ creates a temporary value which is freed while still in use
737 |               };
    |               - temporary value is freed at the end of this statement
    |
    = note: consider using a `let` binding to create a longer lived value

For more information about this error, try `rustc --explain E0716`.
error: could not compile `marmite` (bin "marmite") due to previous error
error: failed to compile `marmite v0.2.4`, intermediate artifacts can be found at `/tmp/cargo-install0k2SBf`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Do you have any idea about how to resolve this?

@rochacbruno
Copy link
Owner

Hi @aentinger which Rust version are you using?

I just tried on a docker container

# cargo --version
cargo 1.84.0 (66221abde 2024-11-19)
# cat /etc/issue
Ubuntu 24.04.1 LTS
root@60bcef6639d4:/# cargo install marmite
    Updating crates.io index
  Installing marmite v0.2.4
    Updating crates.io index
     Locking 284 packages to latest compatible versions
   Compiling proc-macro2 v1.0.93
   Compiling unicode-ident v1.0.15
   ...
   Compiling comrak v0.35.0
   Compiling tera v1.20.0
   Compiling marmite v0.2.4
    Finished `release` profile [optimized] target(s) in 1m 23s
  Installing /root/.cargo/bin/marmite
   Installed package `marmite v0.2.4` (executable `marmite`)
# ~/.cargo/bin/marmite --version
marmite 0.2.4

@aentinger
Copy link
Author

Hi @rochacbruno β˜• πŸ‘‹

I've got an older version of cargo (though its the default one shipped by apt-get with 24.04.1 LTS):

# cargo --version
cargo 1.75.0
# cat /etc/issue
Ubuntu 24.04.1 LTS
# apt list -a cargo
Listing... Done
cargo/noble-updates,now 1.75.0+dfsg0ubuntu1-0ubuntu7.1 amd64 [installed]
cargo/noble 1.75.0+dfsg0ubuntu1-0ubuntu7 amd64

rochacbruno added a commit that referenced this issue Jan 27, 2025
Avoid returning unbound reference.
@rochacbruno
Copy link
Owner

rochacbruno commented Jan 27, 2025

I pushed a fix 43544d1

will be part of the next release.

For now you can try:

cargo install --git https://github.com/rochacbruno/marmite/

To check if issue has gone.

@aentinger
Copy link
Author

Thank you @rochacbruno , I can confirm the issue is gone now πŸ‘

# marmite --version
marmite 0.2.4

Thank you for your help πŸ˜‰

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

2 participants