Skip to content

Commit 5de3317

Browse files
committed
---
yaml --- r: 226973 b: refs/heads/master c: e1fa00b h: refs/heads/master i: 226971: df9ec2b v: v3
1 parent d67e046 commit 5de3317

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9f3f69efab08afc14674647667f7561d669e76c3
2+
refs/heads/master: e1fa00bced4c020c7765786d76e2b53c7ae803cd
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Regression test for issue #27591.
12+
13+
fn write<'a, F: ::std::ops::FnOnce()->::std::fmt::Arguments<'a> + 'a>(fcn: F) {
14+
use std::fmt::Write;
15+
let _ = match fcn() { a => write!(&mut Stream, "{}", a), };
16+
}
17+
18+
struct Stream;
19+
impl ::std::fmt::Write for Stream {
20+
fn write_str(&mut self, _s: &str) -> ::std::fmt::Result {
21+
Ok( () )
22+
}
23+
}
24+
25+
fn main() {
26+
write(|| format_args!("{}", "Hello world"));
27+
//~^ ERROR borrowed value does not live long enough
28+
//~| ERROR borrowed value does not live long enough
29+
}

0 commit comments

Comments
 (0)