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
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]long source line runs into error span marker[/-][+]long source breaks span note formatting[/+][-]long source breaks span note formatting[/-][+]long line breaks span note formatting[/+]sophiajt commentedon Feb 28, 2017
I have a sneaking suspicion that this will require detecting the case where we're about to overwrite the message.
sophiajt commentedon Feb 28, 2017
I'm not sure if we can detect the width of the terminal in a cross platform way. If we can, maybe we can use that to factor in how we draw the message
estebank commentedon Mar 6, 2017
I don't think this is a problem with terminal width, but rather a bug in the positioning of the labels.
Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc
Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc
Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc
Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc
Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc
Rollup merge of rust-lang#40287 - estebank:label-overlap, r=nrc
2 remaining items