diff --git a/src/libcore/any.rs b/src/libcore/any.rs index 2ad121b03fa11..cb9bf935cdb58 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 Any for T { +impl Any for T { fn get_type_id(&self) -> TypeId { TypeId::of::() } } diff --git a/src/libcoretest/any.rs b/src/libcoretest/any.rs index eeaaa3e217e8f..a9fc8913182b3 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() {} + is_any::<[i32]>(); +} #[bench] fn bench_downcast_ref(b: &mut Bencher) {