Skip to content

Third doc backport #25276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/doc/not_found.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ function populate_rust_search() {

// #18540, use a single token

var a = document.createElement("a");
a.href = "http://doc.rust-lang.org/core/?search=" + encodeURIComponent(lt);
a.textContent = lt;
var search = document.getElementById('core-search');
search.innerHTML = "<a href=\"http://doc.rust-lang.org/core/?search=" + lt + "\">" + lt + "</a>";
search.innerHTML = "";
search.appendChild(a);
}
populate_site_search();
populate_rust_search();
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ impl<T> Vec<T> {
///
/// # Panics
///
/// Panics if `i` is out of bounds.
/// Panics if `index` is out of bounds.
///
/// # Examples
///
Expand Down
5 changes: 1 addition & 4 deletions src/libstd/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Networking primitives for TCP/UDP communication
//!
//! > **NOTE**: This module is very much a work in progress and is under active
//! > development.
//! Networking primitives for TCP/UDP communication.

#![stable(feature = "rust1", since = "1.0.0")]

Expand Down
29 changes: 16 additions & 13 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ use thread;
/// ```should_panic
/// use std::process::Command;
///
/// let output = Command::new("/bin/cat").arg("file.txt").output().unwrap_or_else(|e| {
/// panic!("failed to execute child: {}", e)
/// });
/// let contents = output.stdout;
/// assert!(output.status.success());
/// let mut child = Command::new("/bin/cat")
/// .arg("file.txt")
/// .spawn()
/// .unwrap_or_else(|e| { panic!("failed to execute child: {}", e) });
///
/// let ecode = child.wait()
/// .unwrap_or_else(|e| { panic!("failed to wait on child: {}", e) });
///
/// assert!(ecode.success());
/// ```
#[stable(feature = "process", since = "1.0.0")]
pub struct Child {
Expand Down Expand Up @@ -118,9 +122,11 @@ impl Read for ChildStderr {
/// ```
/// use std::process::Command;
///
/// let output = Command::new("sh").arg("-c").arg("echo hello").output().unwrap_or_else(|e| {
/// panic!("failed to execute process: {}", e)
/// });
/// let output = Command::new("sh")
/// .arg("-c")
/// .arg("echo hello")
/// .output()
/// .unwrap_or_else(|e| { panic!("failed to execute process: {}", e) });
/// let hello = output.stdout;
/// ```
#[stable(feature = "process", since = "1.0.0")]
Expand All @@ -140,7 +146,7 @@ impl Command {
/// * No arguments to the program
/// * Inherit the current process's environment
/// * Inherit the current process's working directory
/// * Inherit stdin/stdout/stderr for `run` or `status`, but create pipes for `output`
/// * Inherit stdin/stdout/stderr for `spawn` or `status`, but create pipes for `output`
///
/// Builder methods are provided to change these defaults and
/// otherwise configure the process.
Expand Down Expand Up @@ -202,23 +208,20 @@ impl Command {
}

/// Configuration for the child process's stdin handle (file descriptor 0).
/// Defaults to `CreatePipe(true, false)` so the input can be written to.
#[stable(feature = "process", since = "1.0.0")]
pub fn stdin(&mut self, cfg: Stdio) -> &mut Command {
self.stdin = Some(cfg.0);
self
}

/// Configuration for the child process's stdout handle (file descriptor 1).
/// Defaults to `CreatePipe(false, true)` so the output can be collected.
#[stable(feature = "process", since = "1.0.0")]
pub fn stdout(&mut self, cfg: Stdio) -> &mut Command {
self.stdout = Some(cfg.0);
self
}

/// Configuration for the child process's stderr handle (file descriptor 2).
/// Defaults to `CreatePipe(false, true)` so the output can be collected.
#[stable(feature = "process", since = "1.0.0")]
pub fn stderr(&mut self, cfg: Stdio) -> &mut Command {
self.stderr = Some(cfg.0);
Expand Down Expand Up @@ -356,7 +359,7 @@ pub struct Output {
pub stderr: Vec<u8>,
}

/// Describes what to do with a standard io stream for a child process.
/// Describes what to do with a standard I/O stream for a child process.
#[stable(feature = "process", since = "1.0.0")]
pub struct Stdio(StdioImp);

Expand Down
6 changes: 5 additions & 1 deletion src/libstd/sync/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ impl Once {
/// routine is currently running.
///
/// When this function returns, it is guaranteed that some initialization
/// has run and completed (it may not be the closure specified).
/// has run and completed (it may not be the closure specified). It is also
/// guaranteed that any memory writes performed by the executed closure can
/// be reliably observed by other tasks at this point (there is a
/// happens-before relation between the closure and code executing after the
/// return).
#[stable(feature = "rust1", since = "1.0.0")]
pub fn call_once<F>(&'static self, f: F) where F: FnOnce() {
// Optimize common path: load is much cheaper than fetch_add.
Expand Down
5 changes: 2 additions & 3 deletions src/libstd/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
//! ## Configuring threads
//!
//! A new thread can be configured before it is spawned via the `Builder` type,
//! which currently allows you to set the name, stack size, and writers for
//! `println!` and `panic!` for the child thread:
//! which currently allows you to set the name and stack size for the child thread:
//!
//! ```rust
//! # #![allow(unused_must_use)]
Expand Down Expand Up @@ -264,7 +263,7 @@ impl Builder {
///
/// The child thread may outlive the parent (unless the parent thread
/// is the main thread; the whole process is terminated when the main
/// thread finishes.) The join handle can be used to block on
/// thread finishes). The join handle can be used to block on
/// termination of the child thread, including recovering its panics.
///
/// # Errors
Expand Down