Fix incorrect span label formatting

This commit is contained in:
Esteban Küber 2017-03-05 23:51:46 -03:00 committed by Alex Crichton
parent f573db4f80
commit 7b0dd7bdb8
3 changed files with 61 additions and 28 deletions

View file

@ -0,0 +1,13 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main () {
{println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });}
}

View file

@ -0,0 +1,14 @@
error: `foo` does not live long enough
--> $DIR/issue-40157.rs:12:64
|
12 | {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });}
| ----------------------------------------------------------^-------------
| | | |
| | | `foo` dropped 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
error: aborting due to previous error