这是indexloc提供的服务,不要输入任何密码
Skip to content

regression: temporary value dropped while borrowed #148974

@Mark-Simulacrum

Description

@Mark-Simulacrum
[INFO] [stdout] error[E0716]: temporary value dropped while borrowed
[INFO] [stdout]   --> src/cmd/pretty_term.rs:81:46
[INFO] [stdout]    |
[INFO] [stdout] 80 | /                     match (v.status().success(), v.status().code()) {
[INFO] [stdout] 81 | |                         (false, Some(c)) => &format!("({c}) "),
[INFO] [stdout]    | |                                              ^^^^^^^^^^^^^^^^-
[INFO] [stdout]    | |                                              |               |
[INFO] [stdout]    | |                                              |               temporary value is freed at the end of this statement
[INFO] [stdout]    | |                                              creates a temporary value which is freed while still in use
[INFO] [stdout] 82 | |                         _ => "",
[INFO] [stdout] 83 | |                     }
[INFO] [stdout]    | |_____________________- borrow later used here
[INFO] [stdout]    |
[INFO] [stdout]    = note: consider using a `let` binding to create a longer lived value
[INFO] [stdout]    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-fmtArea: `core::fmt`A-temporary-lifetime-extensionArea: temporary lifetime extensionF-super_letit's super, let's go!I-prioritizeIssue: Indicates that prioritization has been requested for this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamregression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions