-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The note after line 5 is supposed to say `foo` dropped here while still borrowed
.
$ cargo script -e 'println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });'
Compiling expr v0.1.0 (file:///Users/alex/.cargo/.cargo/script-cache/expr-fbc7431f17311f94)
error: `foo` does not live long enough
--> /Users/alex/.cargo/.cargo/script-cache/expr-fbc7431f17311f94/expr.rs:5:60
|
5 | {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });}
| ----------------------------------------------------------^-------------d here while still borrowed
| | |
| | |
| | borrow occurs here
| borrowed value needs to live until here
|
= note: this error originates in a macro outside of the current crate
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.