From aa4f73c845f29188acf51a42db7d3d86b827cb6f Mon Sep 17 00:00:00 2001 From: Alva Snædís Date: Fri, 7 Sep 2018 23:16:55 +0000 Subject: Update documentation for fill_buf in std::io::BufRead Brings the documentation in line with the BufReader implementation. Fixes #48022. --- src/libstd/io/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index b83f3fbe7a5..278ee7951b3 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1330,7 +1330,8 @@ fn read_until(r: &mut R, delim: u8, buf: &mut Vec) /// #[stable(feature = "rust1", since = "1.0.0")] pub trait BufRead: Read { - /// Fills the internal buffer of this object, returning the buffer contents. + /// Returns the contents of the internal buffer, filling it with more data + /// from the inner reader if it is empty. /// /// This function is a lower-level call. It needs to be paired with the /// [`consume`] method to function properly. When calling this -- cgit 1.4.1-3-g733a5 From 0ec351d528f95298afc399a3ac65f794394d6c58 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Sat, 8 Sep 2018 20:00:57 +0300 Subject: `&CStr`, not `CStr`, is the counterpart of `&str` --- src/libstd/ffi/c_str.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 2b87094926c..372f3e83e3d 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -33,7 +33,7 @@ use sys; /// type is a static guarantee that the underlying bytes contain no interior 0 /// bytes ("nul characters") and that the final byte is 0 ("nul terminator"). /// -/// `CString` is to [`CStr`] as [`String`] is to [`&str`]: the former +/// `CString` is to [`&CStr`] as [`String`] is to [`&str`]: the former /// in each pair are owned strings; the latter are borrowed /// references. /// @@ -88,6 +88,7 @@ use sys; /// [slice.len]: ../primitive.slice.html#method.len /// [`Deref`]: ../ops/trait.Deref.html /// [`CStr`]: struct.CStr.html +/// [`&CStr`]: struct.CStr.html /// /// # Examples /// @@ -137,7 +138,7 @@ pub struct CString { /// converted to a Rust [`&str`] by performing UTF-8 validation, or /// into an owned [`CString`]. /// -/// `CStr` is to [`CString`] as [`&str`] is to [`String`]: the former +/// `&CStr` is to [`CString`] as [`&str`] is to [`String`]: the former /// in each pair are borrowed references; the latter are owned /// strings. /// -- cgit 1.4.1-3-g733a5 From 2fb5d5df89897115cb4c7fba6b8da41ed665f75d Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 9 Sep 2018 15:43:28 +0200 Subject: stabilize `#[used]` closes #40289 --- src/libstd/lib.rs | 2 +- src/libsyntax/feature_gate.rs | 11 ++++------- src/test/run-make-fulldeps/used/used.rs | 1 - src/test/ui/run-pass/issues/issue-41628.rs | 1 - src/test/ui/used.rs | 2 -- 5 files changed, 5 insertions(+), 12 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 4278926b042..5c9e88dc57c 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -307,7 +307,7 @@ #![feature(doc_cfg)] #![feature(doc_masked)] #![feature(doc_spotlight)] -#![cfg_attr(windows, feature(used))] +#![cfg_attr(all(windows, stage0), feature(used))] #![feature(doc_alias)] #![feature(doc_keyword)] #![feature(panic_info_message)] diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 0270e36db11..cbadbf8ee16 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -349,9 +349,6 @@ declare_features! ( // Allows the `try {...}` expression (active, try_blocks, "1.29.0", Some(31436), None), - // Used to preserve symbols (see llvm.used) - (active, used, "1.18.0", Some(40289), None), - // Allows module-level inline assembly by way of global_asm!() (active, global_asm, "1.18.0", Some(35119), None), @@ -674,6 +671,9 @@ declare_features! ( // Allows all literals in attribute lists and values of key-value pairs. (accepted, attr_literals, "1.30.0", Some(34981), None), (accepted, panic_handler, "1.30.0", Some(44489), None), + // Used to preserve symbols (see llvm.used) + (accepted, used, "1.29.0", Some(40289), None), + ); // If you change this, please modify src/doc/unstable-book as well. You must @@ -1064,10 +1064,7 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG "unwind_attributes", "#[unwind] is experimental", cfg_fn!(unwind_attributes))), - ("used", Whitelisted, Gated( - Stability::Unstable, "used", - "the `#[used]` attribute is an experimental feature", - cfg_fn!(used))), + ("used", Whitelisted, Ungated), // used in resolve ("prelude_import", Whitelisted, Gated(Stability::Unstable, diff --git a/src/test/run-make-fulldeps/used/used.rs b/src/test/run-make-fulldeps/used/used.rs index 186cd0fdf5e..6992dd94af3 100644 --- a/src/test/run-make-fulldeps/used/used.rs +++ b/src/test/run-make-fulldeps/used/used.rs @@ -9,7 +9,6 @@ // except according to those terms. #![crate_type = "lib"] -#![feature(used)] #[used] static FOO: u32 = 0; diff --git a/src/test/ui/run-pass/issues/issue-41628.rs b/src/test/ui/run-pass/issues/issue-41628.rs index 75924274f1c..f4b9588ff05 100644 --- a/src/test/ui/run-pass/issues/issue-41628.rs +++ b/src/test/ui/run-pass/issues/issue-41628.rs @@ -10,7 +10,6 @@ // run-pass #![deny(dead_code)] -#![feature(used)] #[used] static FOO: u32 = 0; diff --git a/src/test/ui/used.rs b/src/test/ui/used.rs index f170d9c25f5..b3ed8601988 100644 --- a/src/test/ui/used.rs +++ b/src/test/ui/used.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(used)] - #[used] static FOO: u32 = 0; // OK -- cgit 1.4.1-3-g733a5 From abe0f027ae23b47dfabeb217aaa56b155d565ae3 Mon Sep 17 00:00:00 2001 From: Val Date: Mon, 10 Sep 2018 09:02:16 -0700 Subject: fix typos in growth algo description modified to read "the first table overflows into the second, and the second into the first." plus smaller typos --- src/libstd/collections/hash/map.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 3e54b502234..804d43f4fc6 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -166,14 +166,14 @@ impl DefaultResizePolicy { // Our hash generation scheme consists of generating a 64-bit hash and // truncating the most significant bits. When moving to the new table, we // simply introduce a new bit to the front of the hash. Therefore, if an -// elements has ideal index i in the old table, it can have one of two ideal +// element has ideal index i in the old table, it can have one of two ideal // locations in the new table. If the new bit is 0, then the new ideal index // is i. If the new bit is 1, then the new ideal index is n + i. Intuitively, // we are producing two independent tables of size n, and for each element we // independently choose which table to insert it into with equal probability. -// However the rather than wrapping around themselves on overflowing their -// indexes, the first table overflows into the first, and the first into the -// second. Visually, our new table will look something like: +// However, rather than wrapping around themselves on overflowing their +// indexes, the first table overflows into the second, and the second into the +// first. Visually, our new table will look something like: // // [yy_xxx_xxxx_xxx|xx_yyy_yyyy_yyy] // -- cgit 1.4.1-3-g733a5