Skip to content

Rollup of 12 pull requests #25218

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 34 commits into from
May 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dff7676
Fix MIPS build errors in libstd/os/linux/raw.rs
kevinmehall May 5, 2015
6c6b200
Add TCP_* constants for mips/mipsel Linux
kevinmehall May 5, 2015
7150d3c
Change rand version to '*'
bengesoff May 7, 2015
0bc6fe5
Refactor to keep rand version 0.3.0
bengesoff May 7, 2015
0749991
Fix incorrect curly quotes
steveklabnik May 7, 2015
888086d
Undid changes involving misunderstanding of 0.3.x
bengesoff May 7, 2015
377b1ad
std: Rename sys::foo2 modules to sys::foo
alexcrichton May 5, 2015
a031325
std: Remove unused helper_thread.rs file
alexcrichton May 5, 2015
7529bd6
std: Remove a double-box in ReentrantMutex
alexcrichton May 5, 2015
11cb5e5
Add long diagnostic for E0046
May 7, 2015
11a7bad
Add long diagnostic for E0054
May 7, 2015
7ef46e0
doc: the prevailing convention is to use assert_eq! when 2 values are…
tshepang May 7, 2015
2213898
two minor fixes
simonkern May 7, 2015
84c7dfa
deleted unnecessary `the`
simonkern May 7, 2015
468cb05
Expand OS X versions referenced in configure message
carols10cents May 7, 2015
3e76f28
v2 gets a copy of the pointer, not a copy of the data
simonkern May 7, 2015
60c0e75
fixed href for structs
simonkern May 7, 2015
cf76e63
Auto merge of #25136 - alexcrichton:drop-the-two, r=aturon
bors May 8, 2015
391d148
fix logic when describing kinds of borrows
astraw Apr 27, 2015
c65a183
Fix sort in AUTHORS.txt
sharnik May 8, 2015
a4ec372
fixed a mistake
rick68 May 8, 2015
091ba42
Add a reason to the libc & rand instability.
huonw May 8, 2015
8b8cb34
Rollup merge of #24864 - astraw:patch-1, r=steveklabnik
Manishearth May 8, 2015
4c0f7fd
Rollup merge of #25140 - kevinmehall:mips, r=steveklabnik
Manishearth May 8, 2015
61c1cf7
Rollup merge of #25179 - bengesoff:patch-1, r=steveklabnik
Manishearth May 8, 2015
b022709
Rollup merge of #25181 - steveklabnik:fix_curlies, r=alexcrichton
Manishearth May 8, 2015
638deb3
Rollup merge of #25190 - nham:E0046_E0054, r=alexcrichton
Manishearth May 8, 2015
6550420
Rollup merge of #25194 - tshepang:assert-convention, r=steveklabnik
Manishearth May 8, 2015
4b4cb86
Rollup merge of #25195 - simonkern:master, r=steveklabnik
Manishearth May 8, 2015
f7980a3
Rollup merge of #25198 - carols10cents:update-configure-osx, r=alexcr…
Manishearth May 8, 2015
8a6bb9f
Rollup merge of #25203 - sharnik:fix-sort-authors, r=alexcrichton
Manishearth May 8, 2015
a3a3d4e
Rollup merge of #25210 - rick68:patch-1, r=alexcrichton
Manishearth May 8, 2015
dd37250
Rollup merge of #25211 - huonw:libc, r=cmr
Manishearth May 8, 2015
55437b4
Rollup merge of #25215 - acgtyrant:patch-2, r=alexcrichton
Manishearth May 8, 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 AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ Luke Francl <[email protected]>
Luke Metz <[email protected]>
Luke Steensen <[email protected]>
Luqman Aden <[email protected]>
Łukasz Niemier <[email protected]>
Magnus Auvinen <[email protected]>
Mahmut Bulut <[email protected]>
Makoto Nakashima <[email protected]>
Expand Down Expand Up @@ -997,5 +998,4 @@ xales <[email protected]>
zofrex <[email protected]>
zslayton <[email protected]>
zzmp <[email protected]>
Łukasz Niemier <[email protected]>
克雷 <[email protected]>
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ then
CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version")
if [ $? -eq 0 ]
then
step_msg "on OS X 10.9, forcing use of clang"
step_msg "on OS X >=10.9, forcing use of clang"
CFG_ENABLE_CLANG=1
else
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then
Expand Down
11 changes: 5 additions & 6 deletions src/doc/trpl/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,10 @@ rand="0.3.0"
The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
everything that follows it is part of it, until the next section starts.
Cargo uses the dependencies section to know what dependencies on external
crates you have, and what versions you require. In this case, we’ve used `*`,
which means that we’ll use the latest version of `rand`. Cargo understands
[Semantic Versioning][semver], which is a standard for writing version
numbers. If we wanted a specific version or range of versions, we could be
more specific here. [Cargo’s documentation][cargodoc] contains more details.
crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
Cargo understands [Semantic Versioning][semver], which is a standard for writing version
numbers. If we wanted to use the latest version we could use `*` or we could use a range
of versions. [Cargo’s documentation][cargodoc] contains more details.

[semver]: http://semver.org
[cargodoc]: http://doc.crates.io/crates-io.html
Expand Down Expand Up @@ -410,7 +409,7 @@ $ cargo build
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
```

So, we told Cargo we wanted any version of `rand`, and so it fetched the latest
So, we told Cargo we wanted any `0.3.x` version of `rand`, and so it fetched the latest
version at the time this was written, `v0.3.8`. But what happens when next
week, version `v0.3.9` comes out, with an important bugfix? While getting
bugfixes is important, what if `0.3.9` contains a regression that breaks our
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 @@ -116,7 +116,7 @@ fn main() {
}
```

[struct]: structs.html
[structs]: structs.html

As you can see, `struct`s can also have lifetimes. In a similar way to functions,

Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/mutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ safety, and the mechanism by which Rust guarantees it, the
> You may have one or the other of these two kinds of borrows, but not both at
> the same time:
>
> * 0 to N references (`&T`) to a resource.
> * one or more references (`&T`) to a resource.
> * exactly one mutable reference (`&mut T`)

[ownership]: ownership.html
Expand Down
5 changes: 3 additions & 2 deletions src/doc/trpl/ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This guide is one of three presenting Rust’s ownership system. This is one of
Rust’s most unique and compelling features, with which Rust developers should
become quite acquainted. Ownership is how Rust achieves its largest goal,
memory safety. The there are a few distinct concepts, each with its own
memory safety. There are a few distinct concepts, each with its own
chapter:

* ownership, which you’re reading now.
Expand Down Expand Up @@ -59,6 +59,7 @@ deterministically, at the end of the scope.

[vect]: ../std/vec/struct.Vec.html
[heap]: the-stack-and-the-heap.html
[bindings]: variable-bindings.html

# Move semantics

Expand Down Expand Up @@ -122,7 +123,7 @@ let v2 = v;

The first line creates some data for the vector on the [stack][sh], `v`. The
vector’s data, however, is stored on the [heap][sh], and so it contains a
pointer to that data. When we move `v` to `v2`, it creates a copy of that data,
pointer to that data. When we move `v` to `v2`, it creates a copy of that pointer,
for `v2`. Which would mean two pointers to the contents of the vector on the
heap. That would be a problem: it would violate Rust’s safety guarantees by
introducing a data race. Therefore, Rust forbids using `v` after we’ve done the
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/references-and-borrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This guide is one of three presenting Rust’s ownership system. This is one of
Rust’s most unique and compelling features, with which Rust developers should
become quite acquainted. Ownership is how Rust achieves its largest goal,
memory safety. The there are a few distinct concepts, each with its own
memory safety. There are a few distinct concepts, each with its own
chapter:

* [ownership][ownership], ownership, the key concept
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Here’s the error:
```text
error: type `std::fs::File` does not implement any method in scope named `write`

let result = f.write(bwhatever);
let result = f.write(b"whatever");
^~~~~~~~~~~~~~~~~~
```

Expand Down
30 changes: 15 additions & 15 deletions src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub trait Iterator {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert!(a.iter().last().unwrap() == &5);
/// assert_eq!(a.iter().last().unwrap(), &5);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -155,8 +155,8 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter();
/// assert!(it.nth(2).unwrap() == &3);
/// assert!(it.nth(2) == None);
/// assert_eq!(it.nth(2).unwrap(), &3);
/// assert_eq!(it.nth(2), None);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -545,8 +545,8 @@ pub trait Iterator {
/// let mut it = 0..10;
/// // sum the first five values
/// let partial_sum = it.by_ref().take(5).fold(0, |a, b| a + b);
/// assert!(partial_sum == 10);
/// assert!(it.next() == Some(5));
/// assert_eq!(partial_sum, 10);
/// assert_eq!(it.next(), Some(5));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn by_ref(&mut self) -> &mut Self where Self: Sized { self }
Expand Down Expand Up @@ -608,7 +608,7 @@ pub trait Iterator {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert!(a.iter().fold(0, |acc, &item| acc + item) == 15);
/// assert_eq!(a.iter().fold(0, |acc, &item| acc + item), 15);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -773,7 +773,7 @@ pub trait Iterator {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert!(a.iter().max().unwrap() == &5);
/// assert_eq!(a.iter().max().unwrap(), &5);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -796,7 +796,7 @@ pub trait Iterator {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert!(a.iter().min().unwrap() == &1);
/// assert_eq!(a.iter().min().unwrap(), &1);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -834,13 +834,13 @@ pub trait Iterator {
/// assert_eq!(a.iter().min_max(), NoElements);
///
/// let a = [1];
/// assert!(a.iter().min_max() == OneElement(&1));
/// assert_eq!(a.iter().min_max(), OneElement(&1));
///
/// let a = [1, 2, 3, 4, 5];
/// assert!(a.iter().min_max() == MinMax(&1, &5));
/// assert_eq!(a.iter().min_max(), MinMax(&1, &5));
///
/// let a = [1, 1, 1, 1];
/// assert!(a.iter().min_max() == MinMax(&1, &1));
/// assert_eq!(a.iter().min_max(), MinMax(&1, &1));
/// ```
#[unstable(feature = "core", reason = "return type may change")]
fn min_max(mut self) -> MinMaxResult<Self::Item> where Self: Sized, Self::Item: Ord
Expand Down Expand Up @@ -1058,7 +1058,7 @@ pub trait Iterator {
///
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter().cloned();
/// assert!(it.sum::<i32>() == 15);
/// assert_eq!(it.sum::<i32>(), 15);
/// ```
#[unstable(feature="core")]
fn sum<S=<Self as Iterator>::Item>(self) -> S where
Expand All @@ -1078,9 +1078,9 @@ pub trait Iterator {
/// fn factorial(n: u32) -> u32 {
/// (1..).take_while(|&i| i <= n).product()
/// }
/// assert!(factorial(0) == 1);
/// assert!(factorial(1) == 1);
/// assert!(factorial(5) == 120);
/// assert_eq!(factorial(0), 1);
/// assert_eq!(factorial(1), 1);
/// assert_eq!(factorial(5), 120);
/// ```
#[unstable(feature="core")]
fn product<P=<Self as Iterator>::Item>(self) -> P where
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ macro_rules! impls{
/// mismatches by enforcing types in the method implementations:
///
/// ```
/// # trait ResType { fn foo(&self); };
/// # trait ResType { fn foo(&self); }
/// # struct ParamType;
/// # mod foreign_lib {
/// # pub fn new(_: usize) -> *mut () { 42 as *mut () }
Expand Down
27 changes: 26 additions & 1 deletion src/liblibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "libc"]
#![crate_type = "rlib"]
#![cfg_attr(not(feature = "cargo-build"), unstable(feature = "libc"))]
#![cfg_attr(not(feature = "cargo-build"), unstable(feature = "libc",
reason = "use `libc` from crates.io"))]
#![cfg_attr(not(feature = "cargo-build"), feature(staged_api, core, no_std))]
#![cfg_attr(not(feature = "cargo-build"), staged_api)]
#![cfg_attr(not(feature = "cargo-build"), no_std)]
Expand Down Expand Up @@ -3624,6 +3625,30 @@ pub mod consts {
pub const IPV6_DROP_MEMBERSHIP: c_int = 21;

pub const TCP_NODELAY: c_int = 1;
pub const TCP_MAXSEG: c_int = 2;
pub const TCP_CORK: c_int = 3;
pub const TCP_KEEPIDLE: c_int = 4;
pub const TCP_KEEPINTVL: c_int = 5;
pub const TCP_KEEPCNT: c_int = 6;
pub const TCP_SYNCNT: c_int = 7;
pub const TCP_LINGER2: c_int = 8;
pub const TCP_DEFER_ACCEPT: c_int = 9;
pub const TCP_WINDOW_CLAMP: c_int = 10;
pub const TCP_INFO: c_int = 11;
pub const TCP_QUICKACK: c_int = 12;
pub const TCP_CONGESTION: c_int = 13;
pub const TCP_MD5SIG: c_int = 14;
pub const TCP_COOKIE_TRANSACTIONS: c_int = 15;
pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16;
pub const TCP_THIN_DUPACK: c_int = 17;
pub const TCP_USER_TIMEOUT: c_int = 18;
pub const TCP_REPAIR: c_int = 19;
pub const TCP_REPAIR_QUEUE: c_int = 20;
pub const TCP_QUEUE_SEQ: c_int = 21;
pub const TCP_REPAIR_OPTIONS: c_int = 22;
pub const TCP_FASTOPEN: c_int = 23;
pub const TCP_TIMESTAMP: c_int = 24;

pub const SOL_SOCKET: c_int = 65535;

pub const SO_DEBUG: c_int = 0x0001;
Expand Down
3 changes: 2 additions & 1 deletion src/librand/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
html_playground_url = "http://play.rust-lang.org/")]
#![no_std]
#![staged_api]
#![unstable(feature = "rand")]
#![unstable(feature = "rand",
reason = "use `rand` from crates.io")]
#![feature(core)]
#![feature(no_std)]
#![feature(staged_api)]
Expand Down
24 changes: 22 additions & 2 deletions src/librustc_typeck/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,28 @@

register_long_diagnostics! {

E0046: r##"
When trying to make some type implement a trait `Foo`, you must, at minimum,
provide implementations for all of `Foo`'s required methods (meaning the
methods that do not have default implementations), as well as any required
trait items like associated types or constants.
"##,

E0054: r##"
It is not allowed to cast to a bool. If you are trying to cast a numeric type
to a bool, you can compare it with zero instead:

```
let x = 5;

// Ok
let x_is_nonzero = x != 0;

// Not allowed, won't compile
let x_is_nonzero = x as bool;
```
"##,

E0081: r##"
Enum discriminants are used to differentiate enum variants stored in memory.
This error indicates that the same value was used for two or more variants,
Expand Down Expand Up @@ -106,11 +128,9 @@ register_diagnostics! {
E0040, // explicit use of destructor method
E0044,
E0045,
E0046,
E0049,
E0050,
E0053,
E0054,
E0055,
E0057,
E0059,
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use fmt;
use ffi::OsString;
use io::{self, Error, ErrorKind, SeekFrom, Seek, Read, Write};
use path::{Path, PathBuf};
use sys::fs2 as fs_imp;
use sys::fs as fs_imp;
use sys_common::{AsInnerMut, FromInner, AsInner};
use vec::Vec;

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use prelude::v1::*;

use io::{self, Error, ErrorKind};
use sys_common::net2 as net_imp;
use sys_common::net as net_imp;

pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs};
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use io::prelude::*;
use fmt;
use io;
use net::{ToSocketAddrs, SocketAddr, Shutdown};
use sys_common::net2 as net_imp;
use sys_common::net as net_imp;
use sys_common::{AsInner, FromInner};

/// A structure which represents a TCP stream between a local socket and a
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use prelude::v1::*;
use fmt;
use io::{self, Error, ErrorKind};
use net::{ToSocketAddrs, SocketAddr, IpAddr};
use sys_common::net2 as net_imp;
use sys_common::net as net_imp;
use sys_common::{AsInner, FromInner};

/// A User Datagram Protocol socket.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/os/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
pub mod raw;

pub mod fs {
pub use sys::fs2::MetadataExt;
pub use sys::fs::MetadataExt;
}
2 changes: 1 addition & 1 deletion src/libstd/os/bitrig/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
pub mod raw;

pub mod fs {
pub use sys::fs2::MetadataExt;
pub use sys::fs::MetadataExt;
}
2 changes: 1 addition & 1 deletion src/libstd/os/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
pub mod raw;

pub mod fs {
pub use sys::fs2::MetadataExt;
pub use sys::fs::MetadataExt;
}
2 changes: 1 addition & 1 deletion src/libstd/os/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
pub mod raw;

pub mod fs {
pub use sys::fs2::MetadataExt;
pub use sys::fs::MetadataExt;
}
2 changes: 1 addition & 1 deletion src/libstd/os/ios/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
pub mod raw;

pub mod fs {
pub use sys::fs2::MetadataExt;
pub use sys::fs::MetadataExt;
}
2 changes: 1 addition & 1 deletion src/libstd/os/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
pub mod raw;

pub mod fs {
pub use sys::fs2::MetadataExt;
pub use sys::fs::MetadataExt;
}
4 changes: 2 additions & 2 deletions src/libstd/os/linux/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ mod arch {
#[cfg(any(target_arch = "mips",
target_arch = "mipsel"))]
mod arch {
use super::{dev_t, mode_t};
use os::raw::c_long;
use super::mode_t;
use os::raw::{c_long, c_ulong};
use os::unix::raw::{gid_t, uid_t};

pub type blkcnt_t = i32;
Expand Down
Loading