Skip to content

Temporary value dropped while borrowed #521

@Javantea

Description

@Javantea

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions