Skip to content

1.95 beta regression: "temporary value dropped while borrowed" #153850

@theemathas

Description

@theemathas

Regression found by the 1.95 beta crater run.

[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]    --> src/lib.rs:229:34
[INFO] [stdout]     |
[INFO] [stdout] 227 | // ...                   dbg!(
[INFO] [stdout] 228 | || ...                       x.value().score / x.value().playouts as f32,
[INFO] [stdout] 229 | || ...                       &x.id(),
[INFO] [stdout]     | ||                            ^^^^^^ creates a temporary value which is freed while still in use
[INFO] [stdout] 230 | || ...                       x.value().playouts,
[INFO] [stdout] 231 | || ...                   )
[INFO] [stdout]     | ||_______________________- temporary value is freed at the end of this statement
[INFO] [stdout] 232 | |  ...                   .0,
[INFO] [stdout]     | |_________________________- borrow later used here
[INFO] [stdout]     |
[INFO] [stdout]     = note: consider using a `let` binding to create a longer lived value
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stderr] error: could not compile `monte_carlo` (lib) due to 1 previous error; 2 warnings emitted
[INFO] [stdout] For more information about this error, try `rustc --explain E0716`.

https://crater-reports.s3.amazonaws.com/beta-1.95-3/1.95.0-beta.3/reg/monte_carlo-0.1.1/log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-destructorsArea: Destructors (`Drop`, …)A-fmtArea: `core::fmt`A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-temporary-lifetime-extensionArea: temporary lifetime extensionC-bugCategory: This is a bug.P-highHigh priorityS-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-libsRelevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions