Auto merge of #25624 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #25583, #25585, #25602, #25604, #25607, #25611, #25614, #25620 - Failed merges:
This commit is contained in:
commit
f6b446f4a9
@ -32,7 +32,7 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
|
||||
CFG_DISABLE_UNSTABLE_FEATURES=1
|
||||
endif
|
||||
ifeq ($(CFG_RELEASE_CHANNEL),beta)
|
||||
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta
|
||||
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
|
||||
# When building beta distributables just reuse the same "beta" name
|
||||
# so when we upload we'll always override the previous beta. This
|
||||
# doesn't actually impact the version reported by rustc - it's just
|
||||
|
@ -7,20 +7,20 @@ called ‘the dining philosophers’. It was originally conceived by Dijkstra in
|
||||
[paper]: http://www.usingcsp.com/cspbook.pdf
|
||||
|
||||
> In ancient times, a wealthy philanthropist endowed a College to accommodate
|
||||
> five eminent philosophers. Each philosopher had a room in which he could
|
||||
> engage in his professional activity of thinking; there was also a common
|
||||
> five eminent philosophers. Each philosopher had a room in which she could
|
||||
> engage in her professional activity of thinking; there was also a common
|
||||
> dining room, furnished with a circular table, surrounded by five chairs, each
|
||||
> labelled by the name of the philosopher who was to sit in it. They sat
|
||||
> anticlockwise around the table. To the left of each philosopher there was
|
||||
> laid a golden fork, and in the centre stood a large bowl of spaghetti, which
|
||||
> was constantly replenished. A philosopher was expected to spend most of his
|
||||
> time thinking; but when he felt hungry, he went to the dining room, sat down
|
||||
> in his own chair, picked up his own fork on his left, and plunged it into the
|
||||
> was constantly replenished. A philosopher was expected to spend most of her
|
||||
> time thinking; but when she felt hungry, she went to the dining room, sat down
|
||||
> in her own chair, picked up her own fork on her left, and plunged it into the
|
||||
> spaghetti. But such is the tangled nature of spaghetti that a second fork is
|
||||
> required to carry it to the mouth. The philosopher therefore had also to pick
|
||||
> up the fork on his right. When he was finished he would put down both his
|
||||
> forks, get up from his chair, and continue thinking. Of course, a fork can be
|
||||
> used by only one philosopher at a time. If the other philosopher wants it, he
|
||||
> up the fork on her right. When she was finished she would put down both her
|
||||
> forks, get up from her chair, and continue thinking. Of course, a fork can be
|
||||
> used by only one philosopher at a time. If the other philosopher wants it, she
|
||||
> just has to wait until the fork is available again.
|
||||
|
||||
This classic problem shows off a few different elements of concurrency. The
|
||||
|
@ -219,7 +219,7 @@ to it.
|
||||
## Lifetime Elision
|
||||
|
||||
Rust supports powerful local type inference in function bodies, but it’s
|
||||
forbidden in item signatures to allow reasoning about the types just based in
|
||||
forbidden in item signatures to allow reasoning about the types based on
|
||||
the item signature alone. However, for ergonomic reasons a very restricted
|
||||
secondary inference algorithm called “lifetime elision” applies in function
|
||||
signatures. It infers only based on the signature components themselves and not
|
||||
|
@ -683,9 +683,9 @@ let v = vec![0; 100];
|
||||
|
||||
## assert! and assert_eq!
|
||||
|
||||
These two macros are used in tests. `assert!` takes a boolean, and `assert_eq!`
|
||||
takes two values and compares them. Truth passes, success `panic!`s. Like
|
||||
this:
|
||||
These two macros are used in tests. `assert!` takes a boolean. `assert_eq!`
|
||||
takes two values and checks them for equality. `true` passes, `false` `panic!`s.
|
||||
Like this:
|
||||
|
||||
```rust,no_run
|
||||
// A-ok!
|
||||
|
@ -353,6 +353,10 @@
|
||||
//! * `^` - the argument is center-aligned in `width` columns
|
||||
//! * `>` - the argument is right-aligned in `width` columns
|
||||
//!
|
||||
//! Note that alignment may not be implemented by some types. A good way
|
||||
//! to ensure padding is applied is to format your input, then use this
|
||||
//! resulting string to pad your output.
|
||||
//!
|
||||
//! ## Sign/#/0
|
||||
//!
|
||||
//! These can all be interpreted as flags for a particular formatter.
|
||||
|
@ -1841,8 +1841,12 @@ impl str {
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(collections)]
|
||||
///
|
||||
/// let s = "HELLO";
|
||||
/// assert_eq!(s.to_lowercase(), "hello");
|
||||
/// ```
|
||||
#[unstable(feature = "collections")]
|
||||
pub fn to_lowercase(&self) -> String {
|
||||
let mut s = String::with_capacity(self.len());
|
||||
@ -1854,8 +1858,12 @@ impl str {
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(collections)]
|
||||
///
|
||||
/// let s = "hello";
|
||||
/// assert_eq!(s.to_uppercase(), "HELLO");
|
||||
/// ```
|
||||
#[unstable(feature = "collections")]
|
||||
pub fn to_uppercase(&self) -> String {
|
||||
let mut s = String::with_capacity(self.len());
|
||||
|
@ -132,15 +132,11 @@ macro_rules! int_impl {
|
||||
///
|
||||
/// Leading and trailing whitespace represent an error.
|
||||
///
|
||||
/// # Arguments
|
||||
/// # Examples
|
||||
///
|
||||
/// * src - A string slice
|
||||
/// * radix - The base to use. Must lie in the range [2 .. 36]
|
||||
///
|
||||
/// # Return value
|
||||
///
|
||||
/// `Err(ParseIntError)` if the string did not represent a valid number.
|
||||
/// Otherwise, `Ok(n)` where `n` is the integer represented by `src`.
|
||||
/// ```
|
||||
/// assert_eq!(u32::from_str_radix("A", 16), Ok(10));
|
||||
/// ```
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[allow(deprecated)]
|
||||
pub fn from_str_radix(src: &str, radix: u32) -> Result<$T, ParseIntError> {
|
||||
|
@ -429,7 +429,7 @@ impl char {
|
||||
///
|
||||
/// [1]: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
|
||||
///
|
||||
/// [`SpecialCasing`.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
|
||||
/// [`SpecialCasing.txt`]: ftp://ftp.unicode.org/Public/UNIDATA/SpecialCasing.txt
|
||||
///
|
||||
/// [2]: http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf#G33992
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
Loading…
Reference in New Issue
Block a user