about summary refs log tree commit diff
path: root/src/liballoc/boxed_test.rs
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2018-07-10 22:32:19 +0200
committerljedrz <ljedrz@gmail.com>2018-07-10 22:32:19 +0200
commitcd44b3ddaddf22ef3c3b00f31491c660b851f8ee (patch)
treee81c86c3a912174e25328f00226b1cc02b95ebe3 /src/liballoc/boxed_test.rs
parent296e72f11c4120c7b38a0cc580ef8990e7a1c36d (diff)
downloadrust-cd44b3ddaddf22ef3c3b00f31491c660b851f8ee.tar.gz
rust-cd44b3ddaddf22ef3c3b00f31491c660b851f8ee.zip
Add missing dyn in liballoc
Diffstat (limited to 'src/liballoc/boxed_test.rs')
-rw-r--r--src/liballoc/boxed_test.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/liballoc/boxed_test.rs b/src/liballoc/boxed_test.rs
index 837f8dfaca1..55995742a4a 100644
--- a/src/liballoc/boxed_test.rs
+++ b/src/liballoc/boxed_test.rs
@@ -31,8 +31,8 @@ struct Test;
 
 #[test]
 fn any_move() {
-    let a = Box::new(8) as Box<Any>;
-    let b = Box::new(Test) as Box<Any>;
+    let a = Box::new(8) as Box<dyn Any>;
+    let b = Box::new(Test) as Box<dyn Any>;
 
     match a.downcast::<i32>() {
         Ok(a) => {
@@ -47,8 +47,8 @@ fn any_move() {
         Err(..) => panic!(),
     }
 
-    let a = Box::new(8) as Box<Any>;
-    let b = Box::new(Test) as Box<Any>;
+    let a = Box::new(8) as Box<dyn Any>;
+    let b = Box::new(Test) as Box<dyn Any>;
 
     assert!(a.downcast::<Box<Test>>().is_err());
     assert!(b.downcast::<Box<i32>>().is_err());
@@ -56,8 +56,8 @@ fn any_move() {
 
 #[test]
 fn test_show() {
-    let a = Box::new(8) as Box<Any>;
-    let b = Box::new(Test) as Box<Any>;
+    let a = Box::new(8) as Box<dyn Any>;
+    let b = Box::new(Test) as Box<dyn Any>;
     let a_str = format!("{:?}", a);
     let b_str = format!("{:?}", b);
     assert_eq!(a_str, "Any");
@@ -65,8 +65,8 @@ fn test_show() {
 
     static EIGHT: usize = 8;
     static TEST: Test = Test;
-    let a = &EIGHT as &Any;
-    let b = &TEST as &Any;
+    let a = &EIGHT as &dyn Any;
+    let b = &TEST as &dyn Any;
     let s = format!("{:?}", a);
     assert_eq!(s, "Any");
     let s = format!("{:?}", b);
@@ -110,12 +110,12 @@ fn raw_trait() {
         }
     }
 
-    let x: Box<Foo> = Box::new(Bar(17));
+    let x: Box<dyn Foo> = Box::new(Bar(17));
     let p = Box::into_raw(x);
     unsafe {
         assert_eq!(17, (*p).get());
         (*p).set(19);
-        let y: Box<Foo> = Box::from_raw(p);
+        let y: Box<dyn Foo> = Box::from_raw(p);
         assert_eq!(19, y.get());
     }
 }