From 7b0dd7bdb80768684195f0175d2feecaefd1f2ac Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Sun, 5 Mar 2017 23:51:46 -0300 Subject: Fix incorrect span label formatting --- src/test/ui/span/issue-40157.rs | 13 +++++++++++++ src/test/ui/span/issue-40157.stderr | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/test/ui/span/issue-40157.rs create mode 100644 src/test/ui/span/issue-40157.stderr (limited to 'src/test/ui/span') diff --git a/src/test/ui/span/issue-40157.rs b/src/test/ui/span/issue-40157.rs new file mode 100644 index 00000000000..8f3a7ae3417 --- /dev/null +++ b/src/test/ui/span/issue-40157.rs @@ -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 or the MIT license +// , 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 });} +} diff --git a/src/test/ui/span/issue-40157.stderr b/src/test/ui/span/issue-40157.stderr new file mode 100644 index 00000000000..ad1c149d2e5 --- /dev/null +++ b/src/test/ui/span/issue-40157.stderr @@ -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 + -- cgit 1.4.1-3-g733a5