Skip to content

regression: temporary value dropped while borrowed #113237

Closed
@Mark-Simulacrum

Description

https://crater-reports.s3.amazonaws.com/beta-1.71-4/beta-2023-06-25/reg/munge-0.3.0/log.txt

[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]    --> src/lib.rs:194:18
[INFO] [stdout]     |
[INFO] [stdout] 194 |         a = &mut MaybeUninit::uninit();
[INFO] [stdout]     |                  ^^^^^^^^^^^^^^^^^^^^^- temporary value is freed at the end of this statement
[INFO] [stdout]     |                  |
[INFO] [stdout]     |                  creates a temporary value which is freed while still in use
[INFO] [stdout] 195 |         b = &mut MaybeUninit::uninit();
[INFO] [stdout] 196 |         let _ = a;
[INFO] [stdout]     |                 - borrow later used here
[INFO] [stdout]     |
[INFO] [stdout] help: consider using a `let` binding to create a longer lived value
[INFO] [stdout]     |
[INFO] [stdout] 194 ~         let binding = MaybeUninit::uninit();
[INFO] [stdout] 195 ~         a = &mut binding;
[INFO] [stdout]     |

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions