Skip to content

Commit 10a45a8

Browse files
committed
---
yaml --- r: 216738 b: refs/heads/stable c: 61c1cf7 h: refs/heads/master v: v3
1 parent 316de5f commit 10a45a8

File tree

56 files changed

+412
-289
lines changed

Some content is hidden

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

56 files changed

+412
-289
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ refs/heads/tmp: 378a370ff2057afeb1eae86eb6e78c476866a4a6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 888086d959e7d1b840b0d7644e4e49b6941ecf73
32+
refs/heads/stable: 61c1cf7f74849e087672bbe2f1607e0c83573dca
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375

branches/stable/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/stable/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/stable/src/libcore/slice.rs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,14 @@ fn size_from_ptr<T>(_: *const T) -> usize {
631631
}
632632

633633

634-
// Use macro to be generic over const/mut
635-
macro_rules! slice_offset {
634+
// Use macros to be generic over const/mut
635+
//
636+
// They require non-negative `$by` because otherwise the expression
637+
// `(ptr as usize + $by)` would interpret `-1` as `usize::MAX` (and
638+
// thus trigger a panic when overflow checks are on).
639+
640+
// Use this to do `$ptr + $by`, where `$by` is non-negative.
641+
macro_rules! slice_add_offset {
636642
($ptr:expr, $by:expr) => {{
637643
let ptr = $ptr;
638644
if size_from_ptr(ptr) == 0 {
@@ -643,6 +649,18 @@ macro_rules! slice_offset {
643649
}};
644650
}
645651

652+
// Use this to do `$ptr - $by`, where `$by` is non-negative.
653+
macro_rules! slice_sub_offset {
654+
($ptr:expr, $by:expr) => {{
655+
let ptr = $ptr;
656+
if size_from_ptr(ptr) == 0 {
657+
transmute(ptr as usize - $by)
658+
} else {
659+
ptr.offset(-$by)
660+
}
661+
}};
662+
}
663+
646664
macro_rules! slice_ref {
647665
($ptr:expr) => {{
648666
let ptr = $ptr;
@@ -672,7 +690,7 @@ macro_rules! iterator {
672690
None
673691
} else {
674692
let old = self.ptr;
675-
self.ptr = slice_offset!(self.ptr, 1);
693+
self.ptr = slice_add_offset!(self.ptr, 1);
676694
Some(slice_ref!(old))
677695
}
678696
}
@@ -714,7 +732,7 @@ macro_rules! iterator {
714732
if self.end == self.ptr {
715733
None
716734
} else {
717-
self.end = slice_offset!(self.end, -1);
735+
self.end = slice_sub_offset!(self.end, 1);
718736
Some(slice_ref!(self.end))
719737
}
720738
}
@@ -776,7 +794,7 @@ impl<'a, T> Iter<'a, T> {
776794
fn iter_nth(&mut self, n: usize) -> Option<&'a T> {
777795
match self.as_slice().get(n) {
778796
Some(elem_ref) => unsafe {
779-
self.ptr = slice_offset!(elem_ref as *const _, 1);
797+
self.ptr = slice_add_offset!(elem_ref as *const _, 1);
780798
Some(slice_ref!(elem_ref))
781799
},
782800
None => {
@@ -849,7 +867,7 @@ impl<'a, T> IterMut<'a, T> {
849867
fn iter_nth(&mut self, n: usize) -> Option<&'a mut T> {
850868
match make_mut_slice!(T => &'a mut [T]: self.ptr, self.end).get_mut(n) {
851869
Some(elem_ref) => unsafe {
852-
self.ptr = slice_offset!(elem_ref as *mut _, 1);
870+
self.ptr = slice_add_offset!(elem_ref as *mut _, 1);
853871
Some(slice_ref!(elem_ref))
854872
},
855873
None => {

branches/stable/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/stable/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/stable/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/stable/src/librustdoc/html/render.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,9 @@ impl<'a> fmt::Display for Item<'a> {
14601460
try!(write!(fmt, "<span class='out-of-band'>"));
14611461
try!(write!(fmt,
14621462
r##"<span id='render-detail'>
1463-
<a id="toggle-all-docs" href="#" title="collapse all docs">[&minus;]</a>
1463+
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
1464+
[<span class='inner'>&#x2212;</span>]
1465+
</a>
14641466
</span>"##));
14651467

14661468
// Write `src` tag

branches/stable/src/librustdoc/html/static/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ pre.rust { position: relative; }
581581

582582
.collapse-toggle > .inner {
583583
display: inline-block;
584-
width: 1ch;
584+
width: 1.2ch;
585585
text-align: center;
586586
}
587587

branches/stable/src/librustdoc/html/static/main.js

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -806,22 +806,35 @@
806806
window.location = $('.srclink').attr('href');
807807
}
808808

809+
function labelForToggleButton(sectionIsCollapsed) {
810+
if (sectionIsCollapsed) {
811+
// button will expand the section
812+
return "+";
813+
} else {
814+
// button will collapse the section
815+
// note that this text is also set in the HTML template in render.rs
816+
return "\u2212"; // "\u2212" is '−' minus sign
817+
}
818+
}
819+
809820
$("#toggle-all-docs").on("click", function() {
810821
var toggle = $("#toggle-all-docs");
811-
if (toggle.html() == "[&minus;]") {
812-
toggle.html("[&plus;]");
813-
toggle.attr("title", "expand all docs");
814-
$(".docblock").hide();
815-
$(".toggle-label").show();
816-
$(".toggle-wrapper").addClass("collapsed");
817-
$(".collapse-toggle").children(".inner").html("&plus;");
818-
} else {
819-
toggle.html("[&minus;]");
822+
if (toggle.hasClass("will-expand")) {
823+
toggle.removeClass("will-expand");
824+
toggle.children(".inner").text(labelForToggleButton(false));
820825
toggle.attr("title", "collapse all docs");
821826
$(".docblock").show();
822827
$(".toggle-label").hide();
823828
$(".toggle-wrapper").removeClass("collapsed");
824-
$(".collapse-toggle").children(".inner").html("&minus;");
829+
$(".collapse-toggle").children(".inner").text(labelForToggleButton(false));
830+
} else {
831+
toggle.addClass("will-expand");
832+
toggle.children(".inner").text(labelForToggleButton(true));
833+
toggle.attr("title", "expand all docs");
834+
$(".docblock").hide();
835+
$(".toggle-label").show();
836+
$(".toggle-wrapper").addClass("collapsed");
837+
$(".collapse-toggle").children(".inner").text(labelForToggleButton(true));
825838
}
826839
});
827840

@@ -835,20 +848,21 @@
835848
if (relatedDoc.is(":visible")) {
836849
relatedDoc.slideUp({duration:'fast', easing:'linear'});
837850
toggle.parent(".toggle-wrapper").addClass("collapsed");
838-
toggle.children(".inner").html("&plus;");
851+
toggle.children(".inner").text(labelForToggleButton(true));
839852
toggle.children(".toggle-label").fadeIn();
840853
} else {
841854
relatedDoc.slideDown({duration:'fast', easing:'linear'});
842855
toggle.parent(".toggle-wrapper").removeClass("collapsed");
843-
toggle.children(".inner").html("&minus;");
856+
toggle.children(".inner").text(labelForToggleButton(false));
844857
toggle.children(".toggle-label").hide();
845858
}
846859
}
847860
});
848861

849862
$(function() {
850863
var toggle = $("<a/>", {'href': 'javascript:void(0)', 'class': 'collapse-toggle'})
851-
.html("[<span class='inner'>&minus;</span>]");
864+
.html("[<span class='inner'></span>]");
865+
toggle.children(".inner").text(labelForToggleButton(false));
852866

853867
$(".method").each(function() {
854868
if ($(this).next().is(".docblock") ||

branches/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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/stable/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)