@@ -489,7 +489,7 @@ impl Box<dyn Any> {
489489 /// ```
490490 /// use std::any::Any;
491491 ///
492- /// fn print_if_string(value: Box<Any>) {
492+ /// fn print_if_string(value: Box<dyn Any>) {
493493 /// if let Ok(string) = value.downcast::<String>() {
494494 /// println!("String ({}): {}", string.len(), string);
495495 /// }
@@ -523,7 +523,7 @@ impl Box<dyn Any + Send> {
523523 /// ```
524524 /// use std::any::Any;
525525 ///
526- /// fn print_if_string(value: Box<Any + Send>) {
526+ /// fn print_if_string(value: Box<dyn Any + Send>) {
527527 /// if let Ok(string) = value.downcast::<String>() {
528528 /// println!("String ({}): {}", string.len(), string);
529529 /// }
@@ -618,18 +618,18 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}
618618
619619/// `FnBox` is a version of the `FnOnce` intended for use with boxed
620620/// closure objects. The idea is that where one would normally store a
621- /// `Box<FnOnce()>` in a data structure, you should use
622- /// `Box<FnBox()>`. The two traits behave essentially the same, except
621+ /// `Box<dyn FnOnce()>` in a data structure, you should use
622+ /// `Box<dyn FnBox()>`. The two traits behave essentially the same, except
623623/// that a `FnBox` closure can only be called if it is boxed. (Note
624- /// that `FnBox` may be deprecated in the future if `Box<FnOnce()>`
624+ /// that `FnBox` may be deprecated in the future if `Box<dyn FnOnce()>`
625625/// closures become directly usable.)
626626///
627627/// # Examples
628628///
629629/// Here is a snippet of code which creates a hashmap full of boxed
630630/// once closures and then removes them one by one, calling each
631631/// closure as it is removed. Note that the type of the closures
632- /// stored in the map is `Box<FnBox() -> i32>` and not `Box<FnOnce()
632+ /// stored in the map is `Box<dyn FnBox() -> i32>` and not `Box<dyn FnOnce()
633633/// -> i32>`.
634634///
635635/// ```
@@ -638,8 +638,8 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}
638638/// use std::boxed::FnBox;
639639/// use std::collections::HashMap;
640640///
641- /// fn make_map() -> HashMap<i32, Box<FnBox() -> i32>> {
642- /// let mut map: HashMap<i32, Box<FnBox() -> i32>> = HashMap::new();
641+ /// fn make_map() -> HashMap<i32, Box<dyn FnBox() -> i32>> {
642+ /// let mut map: HashMap<i32, Box<dyn FnBox() -> i32>> = HashMap::new();
643643/// map.insert(1, Box::new(|| 22));
644644/// map.insert(2, Box::new(|| 44));
645645/// map
0 commit comments