summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-bounded-method-type-parameters.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/regions/regions-bounded-method-type-parameters.rs')
-rw-r--r--tests/ui/regions/regions-bounded-method-type-parameters.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/regions/regions-bounded-method-type-parameters.rs b/tests/ui/regions/regions-bounded-method-type-parameters.rs
new file mode 100644
index 000000000..56e750003
--- /dev/null
+++ b/tests/ui/regions/regions-bounded-method-type-parameters.rs
@@ -0,0 +1,16 @@
+// Check that explicit region bounds are allowed on the various
+// nominal types (but not on other types) and that they are type
+// checked.
+
+struct Foo;
+
+impl Foo {
+ fn some_method<A:'static>(self) { }
+}
+
+fn caller<'a>(x: &isize) {
+ Foo.some_method::<&'a isize>();
+ //~^ ERROR lifetime may not live long enough
+}
+
+fn main() { }