From 310ab5ea747110941f14d6aa8dc69cb794f1335d Mon Sep 17 00:00:00 2001 From: fbergr Date: Sun, 14 Feb 2016 14:31:20 +0200 Subject: [PATCH 1/6] doc: Remove trailing whitespace --- src/doc/book/strings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/book/strings.md b/src/doc/book/strings.md index 751619d544a4a..68c7235975e8c 100644 --- a/src/doc/book/strings.md +++ b/src/doc/book/strings.md @@ -39,7 +39,7 @@ The second, with a `\`, trims the spaces and the newline: ```rust let s = "foo\ - bar"; + bar"; assert_eq!("foobar", s); ``` From b499e5a08906658e2fb1652f773670b7910a7855 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 12 Feb 2016 11:55:31 -0500 Subject: [PATCH 2/6] Remove incorrect documentation Fixes #31599 --- src/libcore/ptr.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index a826f2bb4440f..3cbb2f17be78b 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -127,8 +127,7 @@ pub unsafe fn read(src: *const T) -> T { tmp } -/// Variant of read_and_zero that writes the specific drop-flag byte -/// (which may be more appropriate than zero). +#[allow(missing_docs)] #[inline(always)] #[unstable(feature = "filling_drop", reason = "may play a larger role in std::ptr future extensions", From 36c00f810722b2e6aebe0c4db3d3d90ade7a32d3 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sun, 14 Feb 2016 17:44:22 +0000 Subject: [PATCH 3/6] Fix signed int checked_neg docs --- src/libcore/num/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index d094f05374b78..ed370bb91648f 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -479,7 +479,7 @@ macro_rules! int_impl { } } - /// Checked negation. Computes `!self`, returning `None` if `self == + /// Checked negation. Computes `-self`, returning `None` if `self == /// MIN`. /// /// # Examples From bc8495abd83f18fb9431b24681faa7f08e58a442 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sun, 14 Feb 2016 17:52:05 +0000 Subject: [PATCH 4/6] Fix doc error for Utf8Error --- src/libcore/str/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index fa169416a1081..1b0d0c8a2dcaa 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -157,7 +157,7 @@ impl Utf8Error { /// // std::str::from_utf8 returns a Utf8Error /// let error = str::from_utf8(&sparkle_heart).unwrap_err(); /// - /// // the first byte is invalid here + /// // the second byte is invalid here /// assert_eq!(1, error.valid_up_to()); /// ``` #[stable(feature = "utf8_error", since = "1.5.0")] From 9673ace3395c39d1605342b4cc5dcfe73f4468f2 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sun, 14 Feb 2016 18:38:37 +0000 Subject: [PATCH 5/6] Fix a couple of issues in from_utf8 docs --- src/libcore/str/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 1b0d0c8a2dcaa..4d367cfd432f9 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -174,10 +174,10 @@ impl Utf8Error { /// /// If you are sure that the byte slice is valid UTF-8, and you don't want to /// incur the overhead of the validity check, there is an unsafe version of -/// this function, [`from_utf8_unchecked()`][fromutf8], which has the same +/// this function, [`from_utf8_unchecked()`][fromutf8u], which has the same /// behavior but skips the check. /// -/// [fromutf8]: fn.from_utf8.html +/// [fromutf8u]: fn.from_utf8_unchecked.html /// /// If you need a `String` instead of a `&str`, consider /// [`String::from_utf8()`][string]. @@ -275,7 +275,7 @@ unsafe fn from_raw_parts_mut<'a>(p: *mut u8, len: usize) -> &'a mut str { /// Converts a slice of bytes to a string slice without checking /// that the string contains valid UTF-8. /// -/// See the safe version, [`from_utf8()`][fromutf8], for more. +/// See the safe version, [`from_utf8()`][fromutf8], for more information. /// /// [fromutf8]: fn.from_utf8.html /// From 3eebec697ca4031b98aa32939701ed80e3a41706 Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Sun, 14 Feb 2016 20:50:12 +0100 Subject: [PATCH 6/6] doc: fix compiler output In the Rust code above, the function is called print_sum, so use the same function name in the error message. --- src/doc/book/functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/book/functions.md b/src/doc/book/functions.md index be905599c6441..31c9da3fadae2 100644 --- a/src/doc/book/functions.md +++ b/src/doc/book/functions.md @@ -68,7 +68,7 @@ You get this error: ```text expected one of `!`, `:`, or `@`, found `)` -fn print_number(x, y) { +fn print_sum(x, y) { ``` This is a deliberate design decision. While full-program inference is possible,