Skip to content

Rollup of 13 pull requests #36864

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 27 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fe62b41
Clarify Index/IndexMut trait docs
bluss Sep 16, 2016
f6ab636
Update to new macro url syntax
GuillaumeGomez Sep 16, 2016
dfa0940
Add missing urls for Box doc
GuillaumeGomez Sep 19, 2016
323701e
Fix some typos and improve doc comments style
GuillaumeGomez Sep 21, 2016
0a72b4d
Suggesting a change to a comment that puzzled me
pcn Sep 25, 2016
4e7338a
Add missing links on cmp module
GuillaumeGomez Sep 26, 2016
c30eb31
Use "through"
pcn Sep 27, 2016
5cec065
Add missing urls for ops module
GuillaumeGomez Sep 28, 2016
e5e632b
Fix typo in RELEASES.md
apasel422 Sep 29, 2016
01a57a2
Reword description of SystemTimeError.
tmiasko Sep 28, 2016
3176ba4
Improve process module doc a bit
GuillaumeGomez Sep 29, 2016
e9d3e62
Fixed wrong link in release notes
deepinthebuild Sep 29, 2016
1e8f692
Fix BufRead::{read_until, read_line} documentation.
tmiasko Sep 29, 2016
a5244dd
Add `Send` and `Sync` traits to the reference
wesleywiser Sep 30, 2016
f6497ea
Rollup merge of #36529 - bluss:index-doc, r=GuillaumeGomez
steveklabnik Sep 30, 2016
dcec48d
Rollup merge of #36535 - GuillaumeGomez:macro_url, r=steveklabnik
steveklabnik Sep 30, 2016
71a4bde
Rollup merge of #36576 - GuillaumeGomez:box_urls, r=steveklabnik
steveklabnik Sep 30, 2016
cabfa99
Rollup merge of #36623 - GuillaumeGomez:doc_typos, r=steveklabnik
steveklabnik Sep 30, 2016
431c037
Rollup merge of #36711 - pcn:patch-1, r=steveklabnik
steveklabnik Sep 30, 2016
083af27
Rollup merge of #36750 - GuillaumeGomez:cmp_doc, r=steveklabnik
steveklabnik Sep 30, 2016
fb880df
Rollup merge of #36810 - GuillaumeGomez:ops_doc, r=steveklabnik
steveklabnik Sep 30, 2016
c2977ea
Rollup merge of #36829 - apasel422:releases-typo, r=alexcrichton
steveklabnik Sep 30, 2016
a6f0a41
Rollup merge of #36833 - tmiasko:system-time-error, r=steveklabnik
steveklabnik Sep 30, 2016
e3e5f1f
Rollup merge of #36841 - GuillaumeGomez:process_doc, r=steveklabnik
steveklabnik Sep 30, 2016
ce8c6f6
Rollup merge of #36842 - cjm00:release-notes-fix, r=brson
steveklabnik Sep 30, 2016
ebd1ad3
Rollup merge of #36851 - tmiasko:fix-read-until-docs, r=bluss
steveklabnik Sep 30, 2016
af1df98
Rollup merge of #36860 - wesleywiser:patch-2, r=Manishearth
steveklabnik Sep 30, 2016
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: 3 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Diagnostics
Most common editors supporting Rust have been updated to work with it. It was
previously described [on the Rust blog]
(https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html).
* [In error descriptions, references are now described in plain english,
* [In error descriptions, references are now described in plain English,
instead of as "&-ptr"]
(https://github.com/rust-lang/rust/pull/35611)
* [In error type descriptions, unknown numeric types are named `{integer}` or
Expand Down Expand Up @@ -148,7 +148,7 @@ Libraries
(https://github.com/rust-lang/rust/pull/34946)
* [`hash_map::Entry`, `hash_map::VacantEntry` and `hash_map::OccupiedEntry`
implement `Debug`]
(https://github.com/rust-lang/rust/pull/34946)
(https://github.com/rust-lang/rust/pull/34937)
* [`btree_map::Entry`, `btree_map::VacantEntry` and `btree_map::OccupiedEntry`
implement `Debug`]
(https://github.com/rust-lang/rust/pull/34885)
Expand Down Expand Up @@ -885,7 +885,7 @@ Cargo
Performance
-----------

* [The time complexity of comparing variables for equivalence during type
* [The time complexity of comparing variables for equivalence during type
unification is reduced from _O_(_n_!) to _O_(_n_)][1.9tu]. This leads
to major compilation time improvement in some scenarios.
* [`ToString` is specialized for `str`, giving it the same performance
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/references-and-borrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn main() {
return v.iter().fold(0, |a, &b| a + b);
}
// Borrow two vectors and sum them.
// This kind of borrowing does not allow mutation to the borrowed.
// This kind of borrowing does not allow mutation through the borrowed reference.
fn foo(v1: &Vec<i32>, v2: &Vec<i32>) -> i32 {
// do stuff with v1 and v2
let s1 = sum_vec(v1);
Expand Down
10 changes: 10 additions & 0 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3959,6 +3959,16 @@ the top-level type for the implementation of the called method. If no such metho
found, `.deref()` is called and the compiler continues to search for the method
implementation in the returned type `U`.

## The `Send` trait

The `Send` trait indicates that a value of this type is safe to send from one
thread to another.

## The 'Sync' trait

The 'Sync' trait indicates that a value of this type is safe to share between
multiple threads.

# Memory model

A Rust program's memory consists of a static set of *items* and a *heap*.
Expand Down
8 changes: 6 additions & 2 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,14 @@ impl<T: ?Sized> Box<T> {
/// the destructor of `T` and free the allocated memory. Since the
/// way `Box` allocates and releases memory is unspecified, the
/// only valid pointer to pass to this function is the one taken
/// from another `Box` via the `Box::into_raw` function.
/// from another `Box` via the [`Box::into_raw`] function.
///
/// This function is unsafe because improper use may lead to
/// memory problems. For example, a double-free may occur if the
/// function is called twice on the same raw pointer.
///
/// [`Box::into_raw`]: struct.Box.html#method.into_raw
///
/// # Examples
///
/// ```
Expand All @@ -269,12 +271,14 @@ impl<T: ?Sized> Box<T> {
/// memory previously managed by the `Box`. In particular, the
/// caller should properly destroy `T` and release the memory. The
/// proper way to do so is to convert the raw pointer back into a
/// `Box` with the `Box::from_raw` function.
/// `Box` with the [`Box::from_raw`] function.
///
/// Note: this is an associated function, which means that you have
/// to call it as `Box::into_raw(b)` instead of `b.into_raw()`. This
/// is so that there is no conflict with a method on the inner type.
///
/// [`Box::from_raw`]: struct.Box.html#method.from_raw
///
/// # Examples
///
/// ```
Expand Down
48 changes: 25 additions & 23 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl<T> [T] {
core_slice::SliceExt::len(self)
}

/// Returns true if the slice has a length of 0
/// Returns true if the slice has a length of 0.
///
/// # Example
///
Expand Down Expand Up @@ -402,7 +402,7 @@ impl<T> [T] {
core_slice::SliceExt::get_unchecked_mut(self, index)
}

/// Returns an raw pointer to the slice's buffer
/// Returns an raw pointer to the slice's buffer.
///
/// The caller must ensure that the slice outlives the pointer this
/// function returns, or else it will end up pointing to garbage.
Expand Down Expand Up @@ -468,7 +468,7 @@ impl<T> [T] {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = ["a", "b", "c", "d"];
/// v.swap(1, 3);
/// assert!(v == ["a", "d", "c", "b"]);
Expand All @@ -483,7 +483,7 @@ impl<T> [T] {
///
/// # Example
///
/// ```rust
/// ```
/// let mut v = [1, 2, 3];
/// v.reverse();
/// assert!(v == [3, 2, 1]);
Expand Down Expand Up @@ -567,9 +567,9 @@ impl<T> [T] {
}

/// Returns an iterator over `size` elements of the slice at a
/// time. The chunks are slices and do not overlap. If `size` does not divide the
/// length of the slice, then the last chunk will not have length
/// `size`.
/// time. The chunks are slices and do not overlap. If `size` does
/// not divide the length of the slice, then the last chunk will
/// not have length `size`.
///
/// # Panics
///
Expand Down Expand Up @@ -656,7 +656,7 @@ impl<T> [T] {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [1, 2, 3, 4, 5, 6];
///
/// // scoped to restrict the lifetime of the borrows
Expand Down Expand Up @@ -754,7 +754,7 @@ impl<T> [T] {
}

/// Returns an iterator over subslices separated by elements that match
/// `pred`, limited to returning at most `n` items. The matched element is
/// `pred`, limited to returning at most `n` items. The matched element is
/// not contained in the subslices.
///
/// The last element returned, if any, will contain the remainder of the
Expand All @@ -781,7 +781,7 @@ impl<T> [T] {
}

/// Returns an iterator over subslices separated by elements that match
/// `pred`, limited to returning at most `n` items. The matched element is
/// `pred`, limited to returning at most `n` items. The matched element is
/// not contained in the subslices.
///
/// The last element returned, if any, will contain the remainder of the
Expand Down Expand Up @@ -835,7 +835,7 @@ impl<T> [T] {

/// Returns an iterator over subslices separated by elements that match
/// `pred` limited to returning at most `n` items. This starts at the end of
/// the slice and works backwards. The matched element is not contained in
/// the slice and works backwards. The matched element is not contained in
/// the subslices.
///
/// The last element returned, if any, will contain the remainder of the
Expand Down Expand Up @@ -922,9 +922,9 @@ impl<T> [T] {
///
/// Looks up a series of four elements. The first is found, with a
/// uniquely determined position; the second and third are not
/// found; the fourth could match any position in `[1,4]`.
/// found; the fourth could match any position in `[1, 4]`.
///
/// ```rust
/// ```
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
///
/// assert_eq!(s.binary_search(&13), Ok(9));
Expand Down Expand Up @@ -956,9 +956,9 @@ impl<T> [T] {
///
/// Looks up a series of four elements. The first is found, with a
/// uniquely determined position; the second and third are not
/// found; the fourth could match any position in `[1,4]`.
/// found; the fourth could match any position in `[1, 4]`.
///
/// ```rust
/// ```
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
///
/// let seek = 13;
Expand All @@ -982,21 +982,23 @@ impl<T> [T] {
/// Binary search a sorted slice with a key extraction function.
///
/// Assumes that the slice is sorted by the key, for instance with
/// `sort_by_key` using the same key extraction function.
/// [`sort_by_key`] using the same key extraction function.
///
/// If a matching value is found then returns `Ok`, containing the
/// index for the matched element; if no match is found then `Err`
/// is returned, containing the index where a matching element could
/// be inserted while maintaining sorted order.
///
/// [`sort_by_key`]: #method.sort_by_key
///
/// # Examples
///
/// Looks up a series of four elements in a slice of pairs sorted by
/// their second elements. The first is found, with a uniquely
/// determined position; the second and third are not found; the
/// fourth could match any position in `[1,4]`.
/// fourth could match any position in `[1, 4]`.
///
/// ```rust
/// ```
/// let s = [(0, 0), (2, 1), (4, 1), (5, 1), (3, 1),
/// (1, 2), (2, 3), (4, 5), (5, 8), (3, 13),
/// (1, 21), (2, 34), (4, 55)];
Expand All @@ -1023,7 +1025,7 @@ impl<T> [T] {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [-5, 4, 1, -3, 2];
///
/// v.sort();
Expand All @@ -1045,7 +1047,7 @@ impl<T> [T] {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [-5i32, 4, 1, -3, 2];
///
/// v.sort_by_key(|k| k.abs());
Expand All @@ -1067,7 +1069,7 @@ impl<T> [T] {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [5, 4, 1, 3, 2];
/// v.sort_by(|a, b| a.cmp(b));
/// assert!(v == [1, 2, 3, 4, 5]);
Expand All @@ -1094,7 +1096,7 @@ impl<T> [T] {
///
/// # Example
///
/// ```rust
/// ```
/// let mut dst = [0, 0, 0];
/// let src = [1, 2, 3];
///
Expand All @@ -1116,7 +1118,7 @@ impl<T> [T] {
///
/// # Example
///
/// ```rust
/// ```
/// let mut dst = [0, 0, 0];
/// let src = [1, 2, 3];
///
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ impl str {
///
/// Basic usage:
///
/// ```rust
/// ```
/// let bananas = "bananas";
///
/// assert!(bananas.ends_with("anas"));
Expand Down Expand Up @@ -900,7 +900,7 @@ impl str {
///
/// It does _not_ give you:
///
/// ```rust,ignore
/// ```,ignore
/// assert_eq!(d, &["a", "b", "c"]);
/// ```
///
Expand Down
6 changes: 3 additions & 3 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//!
//! There are multiple ways to create a new `String` from a string literal:
//!
//! ```rust
//! ```
//! let s = "Hello".to_string();
//!
//! let s = String::from("world");
Expand All @@ -31,7 +31,7 @@
//! You can create a new `String` from an existing one by concatenating with
//! `+`:
//!
//! ```rust
//! ```
//! let s = "Hello".to_string();
//!
//! let message = s + " world!";
Expand All @@ -40,7 +40,7 @@
//! If you have a vector of valid UTF-8 bytes, you can make a `String` out of
//! it. You can do the reverse too.
//!
//! ```rust
//! ```
//! let sparkle_heart = vec![240, 159, 146, 150];
//!
//! // We know these bytes are valid, so we'll use `unwrap()`.
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,7 @@ impl<T> IntoIter<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// # #![feature(vec_into_iter_as_slice)]
/// let vec = vec!['a', 'b', 'c'];
/// let mut into_iter = vec.into_iter();
Expand All @@ -1788,7 +1788,7 @@ impl<T> IntoIter<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// # #![feature(vec_into_iter_as_slice)]
/// let vec = vec!['a', 'b', 'c'];
/// let mut into_iter = vec.into_iter();
Expand Down
9 changes: 6 additions & 3 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@

//! Functionality for ordering and comparison.
//!
//! This module defines both `PartialOrd` and `PartialEq` traits which are used
//! This module defines both [`PartialOrd`] and [`PartialEq`] traits which are used
//! by the compiler to implement comparison operators. Rust programs may
//! implement `PartialOrd` to overload the `<`, `<=`, `>`, and `>=` operators,
//! and may implement `PartialEq` to overload the `==` and `!=` operators.
//! implement [`PartialOrd`] to overload the `<`, `<=`, `>`, and `>=` operators,
//! and may implement [`PartialEq`] to overload the `==` and `!=` operators.
//!
//! [`PartialOrd`]: trait.PartialOrd.html
//! [`PartialEq`]: trait.PartialEq.html
//!
//! # Examples
//!
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ pub trait UpperExp {
/// assert_eq!(output, "Hello world!");
/// ```
///
/// Please note that using [`write!`][write_macro] might be preferrable. Example:
/// Please note that using [`write!`] might be preferrable. Example:
///
/// ```
/// use std::fmt::Write;
Expand All @@ -805,7 +805,7 @@ pub trait UpperExp {
/// assert_eq!(output, "Hello world!");
/// ```
///
/// [write_macro]: ../../std/macro.write!.html
/// [`write!`]: ../../std/macro.write.html
#[stable(feature = "rust1", since = "1.0.0")]
pub fn write(output: &mut Write, args: Arguments) -> Result {
let mut formatter = Formatter {
Expand Down
Loading