summaryrefslogtreecommitdiffstats
path: root/src/test/ui/regions/regions-creating-enums3.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/regions/regions-creating-enums3.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/regions/regions-creating-enums3.rs b/src/test/ui/regions/regions-creating-enums3.rs
new file mode 100644
index 000000000..39dbb3d8a
--- /dev/null
+++ b/src/test/ui/regions/regions-creating-enums3.rs
@@ -0,0 +1,12 @@
+enum Ast<'a> {
+ Num(usize),
+ Add(&'a Ast<'a>, &'a Ast<'a>)
+}
+
+fn mk_add_bad1<'a,'b>(x: &'a Ast<'a>, y: &'b Ast<'b>) -> Ast<'a> {
+ Ast::Add(x, y)
+ //~^ ERROR lifetime may not live long enough
+}
+
+fn main() {
+}