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

Temporary value dropped while borrowed #521

Closed
Javantea opened this issue Mar 14, 2025 · 1 comment
Closed

Temporary value dropped while borrowed #521

Javantea opened this issue Mar 14, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Javantea
Copy link

Bug description

Using nightly rust build failed. I got this error and more like it running cargo build.

error[E0716]: temporary value dropped while borrowed
    --> src/spi.rs:1023:53
     |
1023 |         core::pin::pin!(self.transaction_async(&mut [Operation::Read(read)])).await
     |         --------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^--
     |         |                                           |                      |
     |         |                                           |                      temporary value is freed at the end of this statement
     |         |                                           creates a temporary value which is freed while still in use
     |         borrow later used here
     |
     = note: consider using a `let` binding to create a longer lived value
  • Would you like to work on a fix? no

To Reproduce

  1. git clone https://github.com/esp-rs/esp-idf-hal.git
  2. rustup toolchain install nightly
  3. rustup default nightly
  4. cargo build

Expected behavior

Build success.

Environment

  • Crate (esp-idf-hal) version: master 80c674e
  • ESP-IDF branch or tag: ?
  • Target device (MCU): esp32c3
  • OS: Gentoo 23.0
@Javantea Javantea added the bug Something isn't working label Mar 14, 2025
@ivmarkov
Copy link
Collaborator

Fixed with 4ff3452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants