From 7a76323459bab16d18b364d97ab35c6558f89825 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 22 Sep 2011 16:20:36 -0700 Subject: [PATCH] Allow vectors to contain unique boxes. Closes #952 Issue #409 --- src/comp/middle/ty.rs | 2 +- src/test/run-pass/unique-in-vec.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/test/run-pass/unique-in-vec.rs diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index ab836a22e01..c48e3fe03dc 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1235,7 +1235,7 @@ fn type_is_pod(cx: ctxt, ty: t) -> bool { result = true; } // Boxed types - ty_str. | ty_box(_) | ty_vec(_) | ty_fn(_, _, _, _, _) | + ty_str. | ty_box(_) | ty_uniq(_) | ty_vec(_) | ty_fn(_, _, _, _, _) | ty_native_fn(_, _, _) | ty_obj(_) { result = false; } diff --git a/src/test/run-pass/unique-in-vec.rs b/src/test/run-pass/unique-in-vec.rs new file mode 100644 index 00000000000..0f5bbce050f --- /dev/null +++ b/src/test/run-pass/unique-in-vec.rs @@ -0,0 +1,3 @@ +fn main() { + assert [~100][0] == ~100; +} \ No newline at end of file