From 3dd455d4e13680a10048814b3f80b2b3bdccbd31 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sat, 14 Mar 2015 17:36:36 -0700 Subject: [PATCH 1/4] Stop recommending old_io in the module doc for std::io Now that `old_io` is deprecated and `std::io` is stable, we should stop recommending the use of `old_io` in the module documentation. --- src/libstd/io/mod.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 3fddaaad8079..821a0a0b06ef 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -9,10 +9,6 @@ // except according to those terms. //! Traits, helpers, and type definitions for core I/O functionality. -//! -//! > **NOTE**: This module is very much a work in progress and is under active -//! > development. At this time it is still recommended to use the `old_io` -//! > module while the details of this module shake out. #![stable(feature = "rust1", since = "1.0.0")] From 3453b5b4a888a1a1c98cf7355bd3e1ae868cf0e3 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sat, 14 Mar 2015 18:08:09 -0700 Subject: [PATCH 2/4] Remove incorrect references to _raw stdio functions std::io does not currently expose the stdin_raw, stdout_raw, or stderr_raw functions. According to the current plans for stdio (see RFC #517), raw access will likely be provided using the platform-specific std::os::{unix,windows} modules. At the moment we don't expose any way to do this. As such, delete all mention of the _raw functions from the stdin/stdout/stderr function documentation. While we're at it, remove a few `pub`s from items that aren't exposed. This is done just to lessen the confusion experienced by anyone who looks at the source in an attempt to find the _raw functions. --- src/libstd/io/stdio.rs | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 3b4e396953d0..0e68be8d9e25 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -21,20 +21,20 @@ use sys::stdio; /// A handle to a raw instance of the standard input stream of this process. /// /// This handle is not synchronized or buffered in any fashion. Constructed via -/// the `std::io::stdin_raw` function. -pub struct StdinRaw(stdio::Stdin); +/// the `std::io::stdio::stdin_raw` function. +struct StdinRaw(stdio::Stdin); /// A handle to a raw instance of the standard output stream of this process. /// /// This handle is not synchronized or buffered in any fashion. Constructed via -/// the `std::io::stdout_raw` function. -pub struct StdoutRaw(stdio::Stdout); +/// the `std::io::stdio::stdout_raw` function. +struct StdoutRaw(stdio::Stdout); /// A handle to a raw instance of the standard output stream of this process. /// /// This handle is not synchronized or buffered in any fashion. Constructed via -/// the `std::io::stderr_raw` function. -pub struct StderrRaw(stdio::Stderr); +/// the `std::io::stdio::stderr_raw` function. +struct StderrRaw(stdio::Stderr); /// Construct a new raw handle to the standard input of this process. /// @@ -43,7 +43,7 @@ pub struct StderrRaw(stdio::Stderr); /// handles is **not** available to raw handles returned from this function. /// /// The returned handle has no external synchronization or buffering. -pub fn stdin_raw() -> StdinRaw { StdinRaw(stdio::Stdin::new()) } +fn stdin_raw() -> StdinRaw { StdinRaw(stdio::Stdin::new()) } /// Construct a new raw handle to the standard input stream of this process. /// @@ -54,7 +54,7 @@ pub fn stdin_raw() -> StdinRaw { StdinRaw(stdio::Stdin::new()) } /// /// The returned handle has no external synchronization or buffering layered on /// top. -pub fn stdout_raw() -> StdoutRaw { StdoutRaw(stdio::Stdout::new()) } +fn stdout_raw() -> StdoutRaw { StdoutRaw(stdio::Stdout::new()) } /// Construct a new raw handle to the standard input stream of this process. /// @@ -63,7 +63,7 @@ pub fn stdout_raw() -> StdoutRaw { StdoutRaw(stdio::Stdout::new()) } /// /// The returned handle has no external synchronization or buffering layered on /// top. -pub fn stderr_raw() -> StderrRaw { StderrRaw(stdio::Stderr::new()) } +fn stderr_raw() -> StderrRaw { StderrRaw(stdio::Stderr::new()) } impl Read for StdinRaw { fn read(&mut self, buf: &mut [u8]) -> io::Result { self.0.read(buf) } @@ -109,9 +109,6 @@ pub struct StdinLock<'a> { /// The `Read` trait is implemented for the returned value but the `BufRead` /// trait is not due to the global nature of the standard input stream. The /// locked version, `StdinLock`, implements both `Read` and `BufRead`, however. -/// -/// To avoid locking and buffering altogether, it is recommended to use the -/// `stdin_raw` constructor. #[stable(feature = "rust1", since = "1.0.0")] pub fn stdin() -> Stdin { static INSTANCE: Lazy>> = lazy_init!(stdin_init); @@ -224,9 +221,6 @@ pub struct StdoutLock<'a> { /// provided via the `lock` method. /// /// The returned handle implements the `Write` trait. -/// -/// To avoid locking and buffering altogether, it is recommended to use the -/// `stdout_raw` constructor. #[stable(feature = "rust1", since = "1.0.0")] pub fn stdout() -> Stdout { static INSTANCE: Lazy>> = lazy_init!(stdout_init); @@ -297,9 +291,6 @@ pub struct StderrLock<'a> { /// this function. No handles are buffered, however. /// /// The returned handle implements the `Write` trait. -/// -/// To avoid locking altogether, it is recommended to use the `stderr_raw` -/// constructor. #[stable(feature = "rust1", since = "1.0.0")] pub fn stderr() -> Stderr { static INSTANCE: Lazy> = lazy_init!(stderr_init); From 3be8380576c57409e0f06a768cfa88c5ae5e9ac5 Mon Sep 17 00:00:00 2001 From: FuGangqiang Date: Sun, 15 Mar 2015 13:47:34 +0800 Subject: [PATCH 3/4] fix typos --- src/libstd/path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 829aaadaeb21..1d44216610b3 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -86,8 +86,8 @@ //! //! * Occurrences of `.` are normalized away, *except* if they are at //! the beginning of the path (in which case they are often meaningful -//! in terms of path searching). So, fore xample, `a/./b`, `a/b/`, -//! `/a/b/.` and `a/b` all ahve components `a` and `b`, but `./a/b` +//! in terms of path searching). So, for example, `a/./b`, `a/b/`, +//! `/a/b/.` and `a/b` all have components `a` and `b`, but `./a/b` //! has a leading current directory component. //! //! No other normalization takes place by default. In particular, From fe9bb26e783fd6f09348019938b83f77f8185206 Mon Sep 17 00:00:00 2001 From: Dabo Ross Date: Sun, 15 Mar 2015 00:00:26 -0700 Subject: [PATCH 4/4] Fix an String -> a String in env.rs documentation Super minor change! The `an String` was introduced in https://github.com/rust-lang/rust/commit/a828e7948069f310dc5b33be8edb65e5e8e0cf9a#diff-b596503c7c33ce457b6d047e351ac12bR423, which changed `an OsString` to `an String`. --- src/libstd/env.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/env.rs b/src/libstd/env.rs index 250c5edbcf14..27f78906ec2d 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -452,7 +452,7 @@ pub fn get_exit_status() -> i32 { EXIT_STATUS.load(Ordering::SeqCst) as i32 } -/// An iterator over the arguments of a process, yielding an `String` value +/// An iterator over the arguments of a process, yielding a `String` value /// for each argument. /// /// This structure is created through the `std::env::args` method.