From be613a1b035fa8d580f724b073a3bd6cdff662c8 Mon Sep 17 00:00:00 2001 From: Richo Healey Date: Sun, 26 Apr 2015 21:17:14 -0700 Subject: [PATCH 1/8] thread: right now you can't actually set those printers --- src/libstd/thread/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index c65377e238f8f..93ca089802452 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -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)] From 40fe325037eb4f630d15b541111677fa2ad8ca22 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 27 Apr 2015 16:11:46 +0200 Subject: [PATCH 2/8] doc: it is 'index', not 'i' --- src/libcollections/vec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index a8105d976e599..ba5af6132d4ef 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -540,7 +540,7 @@ impl Vec { /// /// # Panics /// - /// Panics if `i` is out of bounds. + /// Panics if `index` is out of bounds. /// /// # Examples /// From 720f5865c022328ea9996a4599949f5920607a69 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Tue, 28 Apr 2015 13:31:45 +1000 Subject: [PATCH 3/8] Fix #24872, XSS in docs not found page. --- src/doc/not_found.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/doc/not_found.md b/src/doc/not_found.md index eae2bf1925a99..e740bf3c223ae 100644 --- a/src/doc/not_found.md +++ b/src/doc/not_found.md @@ -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 = "" + lt + ""; + search.innerHTML = ""; + search.appendChild(a); } populate_site_search(); populate_rust_search(); From 7a0af01bd4ec35898cbc20b584014864a952d04a Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Tue, 28 Apr 2015 11:18:10 -0400 Subject: [PATCH 4/8] remove stability note from std::net This is served by stability markers. --- src/libstd/net/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libstd/net/mod.rs b/src/libstd/net/mod.rs index 3bfc764e540b2..2e7c0a2c80e59 100644 --- a/src/libstd/net/mod.rs +++ b/src/libstd/net/mod.rs @@ -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")] From b84f018bb48b3ce99d18155b4d8620e04ef058bd Mon Sep 17 00:00:00 2001 From: inrustwetrust Date: Tue, 28 Apr 2015 21:07:21 +0200 Subject: [PATCH 5/8] Clarify Once::call_once memory ordering guarantees in docs --- src/libstd/sync/once.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 948965f5efa9d..7d203e0c980b2 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -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(&'static self, f: F) where F: FnOnce() { // Optimize common path: load is much cheaper than fetch_add. From 5b041fedb433e50737144fe3a3cd780f097914c5 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 28 Apr 2015 23:06:00 -0400 Subject: [PATCH 6/8] Fix punctuation placement in doc-comment --- src/libstd/thread/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 93ca089802452..02e7bacf8a5c9 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -263,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 From d223e4cbbb1636142a4961af369a4bcc33378f98 Mon Sep 17 00:00:00 2001 From: tynopex Date: Wed, 29 Apr 2015 17:00:10 -0400 Subject: [PATCH 7/8] std: Fixup docs for std::process --- src/libstd/process.rs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 610b3b3c019d4..55ea3a5a83642 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -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 { @@ -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")] @@ -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. @@ -202,7 +208,6 @@ 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); @@ -210,7 +215,6 @@ impl Command { } /// 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); @@ -218,7 +222,6 @@ impl Command { } /// 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); @@ -356,7 +359,7 @@ pub struct Output { pub stderr: Vec, } -/// 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); From e88f80a4cab7a08f37716f0d0188335f8e480533 Mon Sep 17 00:00:00 2001 From: tynopex Date: Wed, 29 Apr 2015 18:21:23 -0400 Subject: [PATCH 8/8] Update process.rs Make whitespace consistent --- src/libstd/process.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 55ea3a5a83642..8f8699f4b9fea 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -41,12 +41,12 @@ use thread; /// use std::process::Command; /// /// let mut child = Command::new("/bin/cat") -/// .arg("file.txt") -/// .spawn() -/// .unwrap_or_else(|e| { panic!("failed to execute child: {}", e) }); +/// .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) }); +/// .unwrap_or_else(|e| { panic!("failed to wait on child: {}", e) }); /// /// assert!(ecode.success()); /// ``` @@ -123,10 +123,10 @@ 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) }); +/// .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")]