about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/any.rs2
-rw-r--r--src/libcoretest/any.rs5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index 2ad121b03fa..cb9bf935cdb 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -99,7 +99,7 @@ pub trait Any: Reflect + 'static {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Reflect + 'static> Any for T {
+impl<T: Reflect + 'static + ?Sized > Any for T {
     fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
 }
 
diff --git a/src/libcoretest/any.rs b/src/libcoretest/any.rs
index eeaaa3e217e..a9fc8913182 100644
--- a/src/libcoretest/any.rs
+++ b/src/libcoretest/any.rs
@@ -119,6 +119,11 @@ fn any_fixed_vec() {
     assert!(!test.is::<[usize; 10]>());
 }
 
+#[test]
+fn any_unsized() {
+    fn is_any<T: Any + ?Sized>() {}
+    is_any::<[i32]>();
+}
 
 #[bench]
 fn bench_downcast_ref(b: &mut Bencher) {