about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-05-10 21:32:33 +0000
committerbors <bors@rust-lang.org>2017-05-10 21:32:33 +0000
commitbb8d51c2ebe8d89c9cdcf06a9383d6e974efc5b6 (patch)
treefa917bb6d1b1844b2ebb951daeeeddb8de25a24d /src/test
parent978d2cfee1ee9da704c960c8047e978a7003b582 (diff)
parentcc4afe0f6504136ed2adc8cbada32e5429e04757 (diff)
Auto merge of #41862 - GuillaumeGomez:improve-e0477, r=nagisa
Improve E0477 error message

Part of #41816.

r? @nagisa
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/static-lifetime.rs16
-rw-r--r--src/test/ui/static-lifetime.stderr10
2 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/static-lifetime.rs b/src/test/ui/static-lifetime.rs
new file mode 100644
index 00000000000..7b1887b2d1a
--- /dev/null
+++ b/src/test/ui/static-lifetime.rs
@@ -0,0 +1,16 @@
+// Copyright 2016 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.
+
+pub trait Arbitrary: Sized + 'static {}
+
+impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+
+fn main() {
+}
\ No newline at end of file
diff --git a/src/test/ui/static-lifetime.stderr b/src/test/ui/static-lifetime.stderr
new file mode 100644
index 00000000000..f73dff4f73d
--- /dev/null
+++ b/src/test/ui/static-lifetime.stderr
@@ -0,0 +1,10 @@
+error[E0477]: the type `std::borrow::Cow<'a, A>` does not fulfill the required lifetime
+  --> $DIR/static-lifetime.rs:13:20
+   |
+13 | impl<'a, A: Clone> Arbitrary for ::std::borrow::Cow<'a, A> {}
+   |                    ^^^^^^^^^
+   |
+   = note: type must satisfy the static lifetime
+
+error: aborting due to previous error
+