Skip to content

Commit 8421c7c

Browse files
committed
Merge pull request #25276 from steveklabnik/third_doc_backport
Third doc backport
2 parents 750da68 + e88f80a commit 8421c7c

File tree

6 files changed

+30
-23
lines changed

6 files changed

+30
-23
lines changed

src/doc/not_found.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ function populate_rust_search() {
5757

5858
// #18540, use a single token
5959

60+
var a = document.createElement("a");
61+
a.href = "http://doc.rust-lang.org/core/?search=" + encodeURIComponent(lt);
62+
a.textContent = lt;
6063
var search = document.getElementById('core-search');
61-
search.innerHTML = "<a href=\"http://doc.rust-lang.org/core/?search=" + lt + "\">" + lt + "</a>";
64+
search.innerHTML = "";
65+
search.appendChild(a);
6266
}
6367
populate_site_search();
6468
populate_rust_search();

src/libcollections/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl<T> Vec<T> {
536536
///
537537
/// # Panics
538538
///
539-
/// Panics if `i` is out of bounds.
539+
/// Panics if `index` is out of bounds.
540540
///
541541
/// # Examples
542542
///

src/libstd/net/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Networking primitives for TCP/UDP communication
12-
//!
13-
//! > **NOTE**: This module is very much a work in progress and is under active
14-
//! > development.
11+
//! Networking primitives for TCP/UDP communication.
1512
1613
#![stable(feature = "rust1", since = "1.0.0")]
1714

src/libstd/process.rs

+16-13
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ use thread;
4040
/// ```should_panic
4141
/// use std::process::Command;
4242
///
43-
/// let output = Command::new("/bin/cat").arg("file.txt").output().unwrap_or_else(|e| {
44-
/// panic!("failed to execute child: {}", e)
45-
/// });
46-
/// let contents = output.stdout;
47-
/// assert!(output.status.success());
43+
/// let mut child = Command::new("/bin/cat")
44+
/// .arg("file.txt")
45+
/// .spawn()
46+
/// .unwrap_or_else(|e| { panic!("failed to execute child: {}", e) });
47+
///
48+
/// let ecode = child.wait()
49+
/// .unwrap_or_else(|e| { panic!("failed to wait on child: {}", e) });
50+
///
51+
/// assert!(ecode.success());
4852
/// ```
4953
#[stable(feature = "process", since = "1.0.0")]
5054
pub struct Child {
@@ -118,9 +122,11 @@ impl Read for ChildStderr {
118122
/// ```
119123
/// use std::process::Command;
120124
///
121-
/// let output = Command::new("sh").arg("-c").arg("echo hello").output().unwrap_or_else(|e| {
122-
/// panic!("failed to execute process: {}", e)
123-
/// });
125+
/// let output = Command::new("sh")
126+
/// .arg("-c")
127+
/// .arg("echo hello")
128+
/// .output()
129+
/// .unwrap_or_else(|e| { panic!("failed to execute process: {}", e) });
124130
/// let hello = output.stdout;
125131
/// ```
126132
#[stable(feature = "process", since = "1.0.0")]
@@ -140,7 +146,7 @@ impl Command {
140146
/// * No arguments to the program
141147
/// * Inherit the current process's environment
142148
/// * Inherit the current process's working directory
143-
/// * Inherit stdin/stdout/stderr for `run` or `status`, but create pipes for `output`
149+
/// * Inherit stdin/stdout/stderr for `spawn` or `status`, but create pipes for `output`
144150
///
145151
/// Builder methods are provided to change these defaults and
146152
/// otherwise configure the process.
@@ -202,23 +208,20 @@ impl Command {
202208
}
203209

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

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

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

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

src/libstd/sync/once.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ impl Once {
5959
/// routine is currently running.
6060
///
6161
/// When this function returns, it is guaranteed that some initialization
62-
/// has run and completed (it may not be the closure specified).
62+
/// has run and completed (it may not be the closure specified). It is also
63+
/// guaranteed that any memory writes performed by the executed closure can
64+
/// be reliably observed by other tasks at this point (there is a
65+
/// happens-before relation between the closure and code executing after the
66+
/// return).
6367
#[stable(feature = "rust1", since = "1.0.0")]
6468
pub fn call_once<F>(&'static self, f: F) where F: FnOnce() {
6569
// Optimize common path: load is much cheaper than fetch_add.

src/libstd/thread/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@
115115
//! ## Configuring threads
116116
//!
117117
//! A new thread can be configured before it is spawned via the `Builder` type,
118-
//! which currently allows you to set the name, stack size, and writers for
119-
//! `println!` and `panic!` for the child thread:
118+
//! which currently allows you to set the name and stack size for the child thread:
120119
//!
121120
//! ```rust
122121
//! # #![allow(unused_must_use)]
@@ -264,7 +263,7 @@ impl Builder {
264263
///
265264
/// The child thread may outlive the parent (unless the parent thread
266265
/// is the main thread; the whole process is terminated when the main
267-
/// thread finishes.) The join handle can be used to block on
266+
/// thread finishes). The join handle can be used to block on
268267
/// termination of the child thread, including recovering its panics.
269268
///
270269
/// # Errors

0 commit comments

Comments
 (0)