about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-03-26 14:04:25 +0000
committerbors <bors@rust-lang.org>2017-03-26 14:04:25 +0000
commit7846dbe0c8de17f59cdfc3d2b914d58faad7eade (patch)
tree87a4a8f5945327ad7b3c9700160dcdfa83133245 /src/test
parentbcfd5c48b7ec96cc28bef2cc5e29b4ae0ce6c3ac (diff)
parentdc52625d61e11f5cbdde5debdcf9b1e1fc48324f (diff)
downloadrust-7846dbe0c8de17f59cdfc3d2b914d58faad7eade.tar.gz
rust-7846dbe0c8de17f59cdfc3d2b914d58faad7eade.zip
Auto merge of #40826 - frewsxcv:rollup, r=frewsxcv
Rollup of 7 pull requests

- Successful merges: #40642, #40734, #40740, #40771, #40807, #40820, #40821
- Failed merges:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/static-lifetime-bound.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/compile-fail/static-lifetime-bound.rs b/src/test/compile-fail/static-lifetime-bound.rs
new file mode 100644
index 00000000000..38534ab0a36
--- /dev/null
+++ b/src/test/compile-fail/static-lifetime-bound.rs
@@ -0,0 +1,16 @@
+// 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 f<'a: 'static>(_: &'a i32) {} //~WARN unnecessary lifetime parameter `'a`
+
+fn main() {
+    let x = 0;
+    f(&x); //~ERROR does not live long enough
+}