Skip to content

Rollup of 8 pull requests #25624

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 19 commits into from
May 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1ec7a69
std: Add an unstable method Child::id
alexcrichton Apr 16, 2015
1254c34
Add example for from_str_radix
steveklabnik May 18, 2015
733e7ee
fmt.rs: add note about lack of padding support for some types
parkr May 19, 2015
aa570bc
Fix lifetimes trpl typo
cipherself May 19, 2015
afbe15d
Fix description of assert!
peferron May 18, 2015
c9c474c
doc: add missing fences
parir May 19, 2015
3b95cd7
doc: fix a broken link
parir May 19, 2015
01c93a5
mk: Report the prerelease version on beta again. Fixes #25618
brson May 19, 2015
f34ff7a
Auto merge of #25495 - alexcrichton:process-pid, r=aturon
bors May 19, 2015
07c25d4
Rollup merge of #25583 - steveklabnik:gh25517, r=alexcrichton
steveklabnik May 19, 2015
1bcfe5e
Rollup merge of #25585 - sferik:change-default-gender, r=steveklabnik
steveklabnik May 19, 2015
6fc93b8
Rollup merge of #25602 - parkr:patch-1, r=alexcrichton
steveklabnik May 19, 2015
1d961fd
Rollup merge of #25604 - skeuomorf:docs-lifetime, r=steveklabnik
steveklabnik May 19, 2015
7f74212
Rollup merge of #25607 - peferron:doc-macros-assert-fix, r=steveklabnik
steveklabnik May 19, 2015
dd1c68e
Rollup merge of #25611 - parir:patch-1, r=steveklabnik
steveklabnik May 19, 2015
51a0c6a
Rollup merge of #25614 - parir:patch-2, r=alexcrichton
steveklabnik May 19, 2015
ed3c644
Rollup merge of #25620 - brson:betavers, r=alexcrichton
steveklabnik May 19, 2015
55da4c6
Small fix for https://github.com/rust-lang/rust/pull/25611
steveklabnik May 20, 2015
395d01c
Fix for https://github.com/rust-lang/rust/pull/25583
steveklabnik May 20, 2015
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
2 changes: 1 addition & 1 deletion mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/lifetimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/doc/trpl/macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
4 changes: 4 additions & 0 deletions src/libcollections/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
12 changes: 4 additions & 8 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,11 @@ macro_rules! int_impl {
///
/// Leading and trailing whitespace represent an error.
///
/// # Arguments
///
/// * src - A string slice
/// * radix - The base to use. Must lie in the range [2 .. 36]
///
/// # Return value
/// # Examples
///
/// `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> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_unicode/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
6 changes: 6 additions & 0 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,12 @@ impl Child {
unsafe { self.handle.kill() }
}

/// Returns the OS-assigned process identifier associated with this child.
#[unstable(feature = "process_id", reason = "api recently added")]
pub fn id(&self) -> u32 {
self.handle.id()
}

/// Waits for the child to exit completely, returning the status that it
/// exited with. This function will continue to have the same return value
/// after it has been called at least once.
Expand Down
4 changes: 4 additions & 0 deletions src/libstd/sys/unix/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ impl Process {
fail(&mut output)
}

pub fn id(&self) -> u32 {
self.pid as u32
}

pub fn wait(&self) -> io::Result<ExitStatus> {
let mut status = 0 as c_int;
try!(cvt_r(|| unsafe { c::waitpid(self.pid, &mut status, 0) }));
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ extern "system" {
dwMilliseconds: libc::DWORD) -> libc::DWORD;
pub fn SwitchToThread() -> libc::BOOL;
pub fn Sleep(dwMilliseconds: libc::DWORD);
pub fn GetProcessId(handle: libc::HANDLE) -> libc::DWORD;
}

#[link(name = "userenv")]
Expand Down
6 changes: 6 additions & 0 deletions src/libstd/sys/windows/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ impl Process {
Ok(())
}

pub fn id(&self) -> u32 {
unsafe {
c::GetProcessId(self.handle.raw()) as u32
}
}

pub fn wait(&self) -> io::Result<ExitStatus> {
use libc::{STILL_ACTIVE, INFINITE, WAIT_OBJECT_0};
use libc::{GetExitCodeProcess, WaitForSingleObject};
Expand Down