Skip to content

Commit faab66e

Browse files
committed
---
yaml --- r: 206559 b: refs/heads/beta c: 4b4cb86 h: refs/heads/master i: 206557: e07c39e 206555: 5260555 206551: c864fe9 206543: e551812 206527: beef084 v: v3
1 parent 2dcea22 commit faab66e

File tree

46 files changed

+178
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+178
-284
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3030
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3131
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
32-
refs/heads/beta: 60c0e75e748dd18917736cdfd36de5a8ed23dce0
32+
refs/heads/beta: 4b4cb86248ef3540fd531a25d53c13069887a018
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3535
refs/heads/tmp: 579e31929feff51dcaf8d444648eff8de735f91a

branches/beta/src/doc/trpl/guessing-game.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,10 @@ rand="0.3.0"
358358
The `[dependencies]` section of `Cargo.toml` is like the `[package]` section:
359359
everything that follows it is part of it, until the next section starts.
360360
Cargo uses the dependencies section to know what dependencies on external
361-
crates you have, and what versions you require. In this case, we’ve used `*`,
362-
which means that we’ll use the latest version of `rand`. Cargo understands
363-
[Semantic Versioning][semver], which is a standard for writing version
364-
numbers. If we wanted a specific version or range of versions, we could be
365-
more specific here. [Cargo’s documentation][cargodoc] contains more details.
361+
crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
362+
Cargo understands [Semantic Versioning][semver], which is a standard for writing version
363+
numbers. If we wanted to use the latest version we could use `*` or we could use a range
364+
of versions. [Cargo’s documentation][cargodoc] contains more details.
366365

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

413-
So, we told Cargo we wanted any version of `rand`, and so it fetched the latest
412+
So, we told Cargo we wanted any `0.3.x` version of `rand`, and so it fetched the latest
414413
version at the time this was written, `v0.3.8`. But what happens when next
415414
week, version `v0.3.9` comes out, with an important bugfix? While getting
416415
bugfixes is important, what if `0.3.9` contains a regression that breaks our

branches/beta/src/doc/trpl/mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ safety, and the mechanism by which Rust guarantees it, the
8585
> You may have one or the other of these two kinds of borrows, but not both at
8686
> the same time:
8787
>
88-
> * 0 to N references (`&T`) to a resource.
88+
> * one or more references (`&T`) to a resource.
8989
> * exactly one mutable reference (`&mut T`)
9090
9191
[ownership]: ownership.html

branches/beta/src/doc/trpl/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Here’s the error:
192192
```text
193193
error: type `std::fs::File` does not implement any method in scope named `write`
194194
195-
let result = f.write(bwhatever);
195+
let result = f.write(b"whatever");
196196
^~~~~~~~~~~~~~~~~~
197197
```
198198

branches/beta/src/libcollections/vec.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use core::intrinsics::assume;
6767
use core::iter::{repeat, FromIterator};
6868
use core::marker::PhantomData;
6969
use core::mem;
70-
use core::ops::{Index, IndexMut, Deref, Add};
70+
use core::ops::{Index, IndexMut, Deref};
7171
use core::ops;
7272
use core::ptr;
7373
use core::ptr::Unique;
@@ -1622,17 +1622,6 @@ impl<T: Ord> Ord for Vec<T> {
16221622
}
16231623
}
16241624

1625-
#[stable(feature = "rust1", since = "1.0.0")]
1626-
impl<'a, T: Clone> Add<&'a [T]> for Vec<T> {
1627-
type Output = Vec<T>;
1628-
1629-
#[inline]
1630-
fn add(mut self, rhs: &[T]) -> Vec<T> {
1631-
self.push_all(rhs);
1632-
self
1633-
}
1634-
}
1635-
16361625
#[stable(feature = "rust1", since = "1.0.0")]
16371626
impl<T> Drop for Vec<T> {
16381627
fn drop(&mut self) {

branches/beta/src/libcore/iter.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub trait Iterator {
137137
///
138138
/// ```
139139
/// let a = [1, 2, 3, 4, 5];
140-
/// assert!(a.iter().last().unwrap() == &5);
140+
/// assert_eq!(a.iter().last().unwrap(), &5);
141141
/// ```
142142
#[inline]
143143
#[stable(feature = "rust1", since = "1.0.0")]
@@ -155,8 +155,8 @@ pub trait Iterator {
155155
/// ```
156156
/// let a = [1, 2, 3, 4, 5];
157157
/// let mut it = a.iter();
158-
/// assert!(it.nth(2).unwrap() == &3);
159-
/// assert!(it.nth(2) == None);
158+
/// assert_eq!(it.nth(2).unwrap(), &3);
159+
/// assert_eq!(it.nth(2), None);
160160
/// ```
161161
#[inline]
162162
#[stable(feature = "rust1", since = "1.0.0")]
@@ -545,8 +545,8 @@ pub trait Iterator {
545545
/// let mut it = 0..10;
546546
/// // sum the first five values
547547
/// let partial_sum = it.by_ref().take(5).fold(0, |a, b| a + b);
548-
/// assert!(partial_sum == 10);
549-
/// assert!(it.next() == Some(5));
548+
/// assert_eq!(partial_sum, 10);
549+
/// assert_eq!(it.next(), Some(5));
550550
/// ```
551551
#[stable(feature = "rust1", since = "1.0.0")]
552552
fn by_ref(&mut self) -> &mut Self where Self: Sized { self }
@@ -608,7 +608,7 @@ pub trait Iterator {
608608
///
609609
/// ```
610610
/// let a = [1, 2, 3, 4, 5];
611-
/// assert!(a.iter().fold(0, |acc, &item| acc + item) == 15);
611+
/// assert_eq!(a.iter().fold(0, |acc, &item| acc + item), 15);
612612
/// ```
613613
#[inline]
614614
#[stable(feature = "rust1", since = "1.0.0")]
@@ -773,7 +773,7 @@ pub trait Iterator {
773773
///
774774
/// ```
775775
/// let a = [1, 2, 3, 4, 5];
776-
/// assert!(a.iter().max().unwrap() == &5);
776+
/// assert_eq!(a.iter().max().unwrap(), &5);
777777
/// ```
778778
#[inline]
779779
#[stable(feature = "rust1", since = "1.0.0")]
@@ -796,7 +796,7 @@ pub trait Iterator {
796796
///
797797
/// ```
798798
/// let a = [1, 2, 3, 4, 5];
799-
/// assert!(a.iter().min().unwrap() == &1);
799+
/// assert_eq!(a.iter().min().unwrap(), &1);
800800
/// ```
801801
#[inline]
802802
#[stable(feature = "rust1", since = "1.0.0")]
@@ -834,13 +834,13 @@ pub trait Iterator {
834834
/// assert_eq!(a.iter().min_max(), NoElements);
835835
///
836836
/// let a = [1];
837-
/// assert!(a.iter().min_max() == OneElement(&1));
837+
/// assert_eq!(a.iter().min_max(), OneElement(&1));
838838
///
839839
/// let a = [1, 2, 3, 4, 5];
840-
/// assert!(a.iter().min_max() == MinMax(&1, &5));
840+
/// assert_eq!(a.iter().min_max(), MinMax(&1, &5));
841841
///
842842
/// let a = [1, 1, 1, 1];
843-
/// assert!(a.iter().min_max() == MinMax(&1, &1));
843+
/// assert_eq!(a.iter().min_max(), MinMax(&1, &1));
844844
/// ```
845845
#[unstable(feature = "core", reason = "return type may change")]
846846
fn min_max(mut self) -> MinMaxResult<Self::Item> where Self: Sized, Self::Item: Ord
@@ -1058,7 +1058,7 @@ pub trait Iterator {
10581058
///
10591059
/// let a = [1, 2, 3, 4, 5];
10601060
/// let mut it = a.iter().cloned();
1061-
/// assert!(it.sum::<i32>() == 15);
1061+
/// assert_eq!(it.sum::<i32>(), 15);
10621062
/// ```
10631063
#[unstable(feature="core")]
10641064
fn sum<S=<Self as Iterator>::Item>(self) -> S where
@@ -1078,9 +1078,9 @@ pub trait Iterator {
10781078
/// fn factorial(n: u32) -> u32 {
10791079
/// (1..).take_while(|&i| i <= n).product()
10801080
/// }
1081-
/// assert!(factorial(0) == 1);
1082-
/// assert!(factorial(1) == 1);
1083-
/// assert!(factorial(5) == 120);
1081+
/// assert_eq!(factorial(0), 1);
1082+
/// assert_eq!(factorial(1), 1);
1083+
/// assert_eq!(factorial(5), 120);
10841084
/// ```
10851085
#[unstable(feature="core")]
10861086
fn product<P=<Self as Iterator>::Item>(self) -> P where

branches/beta/src/liblibc/lib.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3624,6 +3624,30 @@ pub mod consts {
36243624
pub const IPV6_DROP_MEMBERSHIP: c_int = 21;
36253625

36263626
pub const TCP_NODELAY: c_int = 1;
3627+
pub const TCP_MAXSEG: c_int = 2;
3628+
pub const TCP_CORK: c_int = 3;
3629+
pub const TCP_KEEPIDLE: c_int = 4;
3630+
pub const TCP_KEEPINTVL: c_int = 5;
3631+
pub const TCP_KEEPCNT: c_int = 6;
3632+
pub const TCP_SYNCNT: c_int = 7;
3633+
pub const TCP_LINGER2: c_int = 8;
3634+
pub const TCP_DEFER_ACCEPT: c_int = 9;
3635+
pub const TCP_WINDOW_CLAMP: c_int = 10;
3636+
pub const TCP_INFO: c_int = 11;
3637+
pub const TCP_QUICKACK: c_int = 12;
3638+
pub const TCP_CONGESTION: c_int = 13;
3639+
pub const TCP_MD5SIG: c_int = 14;
3640+
pub const TCP_COOKIE_TRANSACTIONS: c_int = 15;
3641+
pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16;
3642+
pub const TCP_THIN_DUPACK: c_int = 17;
3643+
pub const TCP_USER_TIMEOUT: c_int = 18;
3644+
pub const TCP_REPAIR: c_int = 19;
3645+
pub const TCP_REPAIR_QUEUE: c_int = 20;
3646+
pub const TCP_QUEUE_SEQ: c_int = 21;
3647+
pub const TCP_REPAIR_OPTIONS: c_int = 22;
3648+
pub const TCP_FASTOPEN: c_int = 23;
3649+
pub const TCP_TIMESTAMP: c_int = 24;
3650+
36273651
pub const SOL_SOCKET: c_int = 65535;
36283652

36293653
pub const SO_DEBUG: c_int = 0x0001;

branches/beta/src/librustc/middle/traits/error_reporting.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ pub fn report_projection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
5656
{
5757
let predicate =
5858
infcx.resolve_type_vars_if_possible(&obligation.predicate);
59-
if !predicate.references_error() {
59+
// The ty_err created by normalize_to_error can end up being unified
60+
// into all obligations: for example, if our obligation is something
61+
// like `$X = <() as Foo<$X>>::Out` and () does not implement Foo<_>,
62+
// then $X will be unified with ty_err, but the error still needs to be
63+
// reported.
64+
if !infcx.tcx.sess.has_errors() || !predicate.references_error() {
6065
span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
6166
"type mismatch resolving `{}`: {}",
6267
predicate.user_string(infcx.tcx),
@@ -183,7 +188,8 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
183188
let trait_predicate =
184189
infcx.resolve_type_vars_if_possible(trait_predicate);
185190

186-
if !trait_predicate.references_error() {
191+
if !infcx.tcx.sess.has_errors() ||
192+
!trait_predicate.references_error() {
187193
let trait_ref = trait_predicate.to_poly_trait_ref();
188194
span_err!(infcx.tcx.sess, obligation.cause.span, E0277,
189195
"the trait `{}` is not implemented for the type `{}`",

branches/beta/src/librustc/middle/traits/project.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,10 @@ fn opt_normalize_projection_type<'a,'b,'tcx>(
408408
}
409409

410410
/// in various error cases, we just set ty_err and return an obligation
411-
/// that, when fulfilled, will lead to an error
411+
/// that, when fulfilled, will lead to an error.
412+
///
413+
/// FIXME: the ty_err created here can enter the obligation we create,
414+
/// leading to error messages involving ty_err.
412415
fn normalize_to_error<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>,
413416
projection_ty: ty::ProjectionTy<'tcx>,
414417
cause: ObligationCause<'tcx>,

branches/beta/src/librustc_typeck/diagnostics.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,28 @@
1212

1313
register_long_diagnostics! {
1414

15+
E0046: r##"
16+
When trying to make some type implement a trait `Foo`, you must, at minimum,
17+
provide implementations for all of `Foo`'s required methods (meaning the
18+
methods that do not have default implementations), as well as any required
19+
trait items like associated types or constants.
20+
"##,
21+
22+
E0054: r##"
23+
It is not allowed to cast to a bool. If you are trying to cast a numeric type
24+
to a bool, you can compare it with zero instead:
25+
26+
```
27+
let x = 5;
28+
29+
// Ok
30+
let x_is_nonzero = x != 0;
31+
32+
// Not allowed, won't compile
33+
let x_is_nonzero = x as bool;
34+
```
35+
"##,
36+
1537
E0081: r##"
1638
Enum discriminants are used to differentiate enum variants stored in memory.
1739
This error indicates that the same value was used for two or more variants,
@@ -106,11 +128,9 @@ register_diagnostics! {
106128
E0040, // explicit use of destructor method
107129
E0044,
108130
E0045,
109-
E0046,
110131
E0049,
111132
E0050,
112133
E0053,
113-
E0054,
114134
E0055,
115135
E0057,
116136
E0059,

branches/beta/src/libstd/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use fmt;
2323
use ffi::OsString;
2424
use io::{self, Error, ErrorKind, SeekFrom, Seek, Read, Write};
2525
use path::{Path, PathBuf};
26-
use sys::fs2 as fs_imp;
26+
use sys::fs as fs_imp;
2727
use sys_common::{AsInnerMut, FromInner, AsInner};
2828
use vec::Vec;
2929

branches/beta/src/libstd/net/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use prelude::v1::*;
1616

1717
use io::{self, Error, ErrorKind};
18-
use sys_common::net2 as net_imp;
18+
use sys_common::net as net_imp;
1919

2020
pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
2121
pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs};

branches/beta/src/libstd/net/tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use io::prelude::*;
1717
use fmt;
1818
use io;
1919
use net::{ToSocketAddrs, SocketAddr, Shutdown};
20-
use sys_common::net2 as net_imp;
20+
use sys_common::net as net_imp;
2121
use sys_common::{AsInner, FromInner};
2222

2323
/// A structure which represents a TCP stream between a local socket and a

branches/beta/src/libstd/net/udp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use prelude::v1::*;
1616
use fmt;
1717
use io::{self, Error, ErrorKind};
1818
use net::{ToSocketAddrs, SocketAddr, IpAddr};
19-
use sys_common::net2 as net_imp;
19+
use sys_common::net as net_imp;
2020
use sys_common::{AsInner, FromInner};
2121

2222
/// A User Datagram Protocol socket.

branches/beta/src/libstd/os/android/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/bitrig/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/dragonfly/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/freebsd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/ios/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/linux/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/linux/raw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ mod arch {
6060
#[cfg(any(target_arch = "mips",
6161
target_arch = "mipsel"))]
6262
mod arch {
63-
use super::{dev_t, mode_t};
64-
use os::raw::c_long;
63+
use super::mode_t;
64+
use os::raw::{c_long, c_ulong};
6565
use os::unix::raw::{gid_t, uid_t};
6666

6767
pub type blkcnt_t = i32;

branches/beta/src/libstd/os/macos/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/nacl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

branches/beta/src/libstd/os/openbsd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
pub mod raw;
1616

1717
pub mod fs {
18-
pub use sys::fs2::MetadataExt;
18+
pub use sys::fs::MetadataExt;
1919
}

0 commit comments

Comments
 (0)