about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jsgf@fb.com>2018-05-18 08:18:44 -0700
committerJeremy Fitzhardinge <jsgf@fb.com>2018-05-31 13:27:08 -0700
commit87c3d7bee52fb99f922c77fa267729b7898bc9a6 (patch)
treeebed46728e877e3d249cacf48c3871106e4e2ee2
parent0c7bf56d805d981bb003a20a4c6b1f6b29790881 (diff)
downloadrust-87c3d7bee52fb99f922c77fa267729b7898bc9a6.tar.gz
rust-87c3d7bee52fb99f922c77fa267729b7898bc9a6.zip
Fix up Any doc examples
Make the Any+Send+Sync examples use the right trait bounds, and fix a small whitespace issue.
-rw-r--r--src/libcore/any.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index d608fed443d..4437c36c15a 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -308,7 +308,7 @@ impl Any+Send {
     /// ```
     /// use std::any::Any;
     ///
-    /// fn modify_if_u32(s: &mut (Any+ Send)) {
+    /// fn modify_if_u32(s: &mut (Any + Send)) {
     ///     if let Some(num) = s.downcast_mut::<u32>() {
     ///         *num = 42;
     ///     }
@@ -366,7 +366,7 @@ impl Any+Send+Sync {
     /// ```
     /// use std::any::Any;
     ///
-    /// fn print_if_string(s: &(Any + Send)) {
+    /// fn print_if_string(s: &(Any + Send + Sync)) {
     ///     if let Some(string) = s.downcast_ref::<String>() {
     ///         println!("It's a string({}): '{}'", string.len(), string);
     ///     } else {
@@ -392,7 +392,7 @@ impl Any+Send+Sync {
     /// ```
     /// use std::any::Any;
     ///
-    /// fn modify_if_u32(s: &mut (Any+ Send)) {
+    /// fn modify_if_u32(s: &mut (Any + Send + Sync)) {
     ///     if let Some(num) = s.downcast_mut::<u32>() {
     ///         *num = 42;
     ///     }