about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>2015-12-06 20:21:23 +0200
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2015-12-07 19:36:28 +0200
commit80e191fba095ce8881770db9c51f6bf75cd1672b (patch)
tree1f3cb8d7f1fac0f4cfe06b39a8efc04c130af4f5 /src/test
parent4dbdfb493357427a0f94ce09badef581f5d62bbd (diff)
downloadrust-80e191fba095ce8881770db9c51f6bf75cd1672b.tar.gz
rust-80e191fba095ce8881770db9c51f6bf75cd1672b.zip
introduce a region unification table and use it in dropck
Fixes #29844
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-29844.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-29844.rs b/src/test/run-pass/issue-29844.rs
new file mode 100644
index 00000000000..51df4d60f04
--- /dev/null
+++ b/src/test/run-pass/issue-29844.rs
@@ -0,0 +1,33 @@
+// Copyright 2015 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.
+
+use std::sync::Arc;
+
+pub struct DescriptorSet<'a> {
+    pub slots: Vec<AttachInfo<'a, Resources>>
+}
+
+pub trait ResourcesTrait<'r>: Sized {
+    type DescriptorSet: 'r;
+}
+
+pub struct Resources;
+
+impl<'a> ResourcesTrait<'a> for Resources {
+    type DescriptorSet = DescriptorSet<'a>;
+}
+
+pub enum AttachInfo<'a, R: ResourcesTrait<'a>> {
+    NextDescriptorSet(Arc<R::DescriptorSet>)
+}
+
+fn main() {
+    let _x = DescriptorSet {slots: Vec::new()};
+}