Closed
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