diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-07-11 09:11:39 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-07-11 09:11:39 +0200 |
| commit | 1915cd1dc2d5ea66d322d52958271b8072ec4c97 (patch) | |
| tree | a8925c140f063df3d3a5dbeebcf9a81a2b7365c6 /src/libstd/thread | |
| parent | b29a6fbabcb425f6e238a00946fb1c9869f657e9 (diff) | |
| download | rust-1915cd1dc2d5ea66d322d52958271b8072ec4c97.tar.gz rust-1915cd1dc2d5ea66d322d52958271b8072ec4c97.zip | |
Add missing dyn in tests
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index cc0ec8a5b4d..f7052e4834a 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -1438,7 +1438,7 @@ mod tests { rx.recv().unwrap(); } - fn avoid_copying_the_body<F>(spawnfn: F) where F: FnOnce(Box<Fn() + Send>) { + fn avoid_copying_the_body<F>(spawnfn: F) where F: FnOnce(Box<dyn Fn() + Send>) { let (tx, rx) = channel(); let x: Box<_> = box 1; @@ -1485,7 +1485,7 @@ mod tests { // (well, it would if the constant were 8000+ - I lowered it to be more // valgrind-friendly. try this at home, instead..!) const GENERATIONS: u32 = 16; - fn child_no(x: u32) -> Box<Fn() + Send> { + fn child_no(x: u32) -> Box<dyn Fn() + Send> { return Box::new(move|| { if x < GENERATIONS { thread::spawn(move|| child_no(x+1)()); @@ -1531,10 +1531,10 @@ mod tests { #[test] fn test_try_panic_message_any() { match thread::spawn(move|| { - panic!(box 413u16 as Box<Any + Send>); + panic!(box 413u16 as Box<dyn Any + Send>); }).join() { Err(e) => { - type T = Box<Any + Send>; + type T = Box<dyn Any + Send>; assert!(e.is::<T>()); let any = e.downcast::<T>().unwrap(); assert!(any.is::<u16>()); |
