Skip to content

Commit f857d20

Browse files
committed
---
yaml --- r: 210421 b: refs/heads/try c: 377b1ad h: refs/heads/master i: 210419: c71bbec v: v3
1 parent 08be944 commit f857d20

File tree

41 files changed

+94
-183
lines changed

Some content is hidden

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

41 files changed

+94
-183
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: b402c43f088882db8a03bfcbb5eb8429ef7def0e
5+
refs/heads/try: 377b1adc36af65ed79be2b79a4e1caf240fc457a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcollections/vec.rs

Lines changed: 12 additions & 1 deletion
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};
70+
use core::ops::{Index, IndexMut, Deref, Add};
7171
use core::ops;
7272
use core::ptr;
7373
use core::ptr::Unique;
@@ -1622,6 +1622,17 @@ 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+
16251636
#[stable(feature = "rust1", since = "1.0.0")]
16261637
impl<T> Drop for Vec<T> {
16271638
fn drop(&mut self) {

branches/try/src/libcore/slice.rs

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

633633

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 {
634+
// Use macro to be generic over const/mut
635+
macro_rules! slice_offset {
642636
($ptr:expr, $by:expr) => {{
643637
let ptr = $ptr;
644638
if size_from_ptr(ptr) == 0 {
@@ -649,18 +643,6 @@ macro_rules! slice_add_offset {
649643
}};
650644
}
651645

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-
664646
macro_rules! slice_ref {
665647
($ptr:expr) => {{
666648
let ptr = $ptr;
@@ -690,7 +672,7 @@ macro_rules! iterator {
690672
None
691673
} else {
692674
let old = self.ptr;
693-
self.ptr = slice_add_offset!(self.ptr, 1);
675+
self.ptr = slice_offset!(self.ptr, 1);
694676
Some(slice_ref!(old))
695677
}
696678
}
@@ -732,7 +714,7 @@ macro_rules! iterator {
732714
if self.end == self.ptr {
733715
None
734716
} else {
735-
self.end = slice_sub_offset!(self.end, 1);
717+
self.end = slice_offset!(self.end, -1);
736718
Some(slice_ref!(self.end))
737719
}
738720
}
@@ -794,7 +776,7 @@ impl<'a, T> Iter<'a, T> {
794776
fn iter_nth(&mut self, n: usize) -> Option<&'a T> {
795777
match self.as_slice().get(n) {
796778
Some(elem_ref) => unsafe {
797-
self.ptr = slice_add_offset!(elem_ref as *const _, 1);
779+
self.ptr = slice_offset!(elem_ref as *const _, 1);
798780
Some(slice_ref!(elem_ref))
799781
},
800782
None => {
@@ -867,7 +849,7 @@ impl<'a, T> IterMut<'a, T> {
867849
fn iter_nth(&mut self, n: usize) -> Option<&'a mut T> {
868850
match make_mut_slice!(T => &'a mut [T]: self.ptr, self.end).get_mut(n) {
869851
Some(elem_ref) => unsafe {
870-
self.ptr = slice_add_offset!(elem_ref as *mut _, 1);
852+
self.ptr = slice_offset!(elem_ref as *mut _, 1);
871853
Some(slice_ref!(elem_ref))
872854
},
873855
None => {

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,7 @@ 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-
// 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() {
59+
if !predicate.references_error() {
6560
span_err!(infcx.tcx.sess, obligation.cause.span, E0271,
6661
"type mismatch resolving `{}`: {}",
6762
predicate.user_string(infcx.tcx),
@@ -188,8 +183,7 @@ pub fn report_selection_error<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
188183
let trait_predicate =
189184
infcx.resolve_type_vars_if_possible(trait_predicate);
190185

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

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,7 @@ 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.
412-
///
413-
/// FIXME: the ty_err created here can enter the obligation we create,
414-
/// leading to error messages involving ty_err.
411+
/// that, when fulfilled, will lead to an error
415412
fn normalize_to_error<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>,
416413
projection_ty: ty::ProjectionTy<'tcx>,
417414
cause: ObligationCause<'tcx>,

branches/try/src/librustdoc/html/render.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,9 +1460,7 @@ 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="javascript:void(0)" title="collapse all docs">
1464-
[<span class='inner'>&#x2212;</span>]
1465-
</a>
1463+
<a id="toggle-all-docs" href="#" title="collapse all docs">[&minus;]</a>
14661464
</span>"##));
14671465

14681466
// Write `src` tag

branches/try/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: 1.2ch;
584+
width: 1ch;
585585
text-align: center;
586586
}
587587

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

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -806,35 +806,22 @@
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-
820809
$("#toggle-all-docs").on("click", function() {
821810
var toggle = $("#toggle-all-docs");
822-
if (toggle.hasClass("will-expand")) {
823-
toggle.removeClass("will-expand");
824-
toggle.children(".inner").text(labelForToggleButton(false));
825-
toggle.attr("title", "collapse all docs");
826-
$(".docblock").show();
827-
$(".toggle-label").hide();
828-
$(".toggle-wrapper").removeClass("collapsed");
829-
$(".collapse-toggle").children(".inner").text(labelForToggleButton(false));
830-
} else {
831-
toggle.addClass("will-expand");
832-
toggle.children(".inner").text(labelForToggleButton(true));
811+
if (toggle.html() == "[&minus;]") {
812+
toggle.html("[&plus;]");
833813
toggle.attr("title", "expand all docs");
834814
$(".docblock").hide();
835815
$(".toggle-label").show();
836816
$(".toggle-wrapper").addClass("collapsed");
837-
$(".collapse-toggle").children(".inner").text(labelForToggleButton(true));
817+
$(".collapse-toggle").children(".inner").html("&plus;");
818+
} else {
819+
toggle.html("[&minus;]");
820+
toggle.attr("title", "collapse all docs");
821+
$(".docblock").show();
822+
$(".toggle-label").hide();
823+
$(".toggle-wrapper").removeClass("collapsed");
824+
$(".collapse-toggle").children(".inner").html("&minus;");
838825
}
839826
});
840827

@@ -848,21 +835,20 @@
848835
if (relatedDoc.is(":visible")) {
849836
relatedDoc.slideUp({duration:'fast', easing:'linear'});
850837
toggle.parent(".toggle-wrapper").addClass("collapsed");
851-
toggle.children(".inner").text(labelForToggleButton(true));
838+
toggle.children(".inner").html("&plus;");
852839
toggle.children(".toggle-label").fadeIn();
853840
} else {
854841
relatedDoc.slideDown({duration:'fast', easing:'linear'});
855842
toggle.parent(".toggle-wrapper").removeClass("collapsed");
856-
toggle.children(".inner").text(labelForToggleButton(false));
843+
toggle.children(".inner").html("&minus;");
857844
toggle.children(".toggle-label").hide();
858845
}
859846
}
860847
});
861848

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

867853
$(".method").each(function() {
868854
if ($(this).next().is(".docblock") ||

branches/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/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
}

branches/try/src/libstd/process.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ use fmt;
2121
use io::{self, Error, ErrorKind};
2222
use path;
2323
use sync::mpsc::{channel, Receiver};
24-
use sys::pipe2::{self, AnonPipe};
25-
use sys::process2::Command as CommandImp;
26-
use sys::process2::Process as ProcessImp;
27-
use sys::process2::ExitStatus as ExitStatusImp;
28-
use sys::process2::Stdio as StdioImp2;
24+
use sys::pipe::{self, AnonPipe};
25+
use sys::process::Command as CommandImp;
26+
use sys::process::Process as ProcessImp;
27+
use sys::process::ExitStatus as ExitStatusImp;
28+
use sys::process::Stdio as StdioImp2;
2929
use sys_common::{AsInner, AsInnerMut};
3030
use thread;
3131

@@ -334,7 +334,7 @@ fn setup_io(io: &StdioImp, readable: bool)
334334
Null => (StdioImp2::None, None),
335335
Inherit => (StdioImp2::Inherit, None),
336336
Piped => {
337-
let (reader, writer) = try!(pipe2::anon_pipe());
337+
let (reader, writer) = try!(pipe::anon_pipe());
338338
if readable {
339339
(StdioImp2::Piped(reader), Some(writer))
340340
} else {

branches/try/src/libstd/sys/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use prelude::v1::*;
1515
pub mod backtrace;
1616
pub mod condvar;
1717
pub mod mutex;
18-
pub mod net2;
18+
pub mod net;
1919
pub mod poison;
2020
pub mod remutex;
2121
pub mod rwlock;

branches/try/src/libstd/sys/unix/ext/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl OpenOptionsExt for OpenOptions {
102102
}
103103

104104
#[unstable(feature = "metadata_ext", reason = "recently added API")]
105-
pub struct Metadata(sys::fs2::FileAttr);
105+
pub struct Metadata(sys::fs::FileAttr);
106106

107107
#[unstable(feature = "metadata_ext", reason = "recently added API")]
108108
pub trait MetadataExt {
@@ -111,7 +111,7 @@ pub trait MetadataExt {
111111

112112
impl MetadataExt for fs::Metadata {
113113
fn as_raw(&self) -> &Metadata {
114-
let inner: &sys::fs2::FileAttr = self.as_inner();
114+
let inner: &sys::fs::FileAttr = self.as_inner();
115115
unsafe { mem::transmute(inner) }
116116
}
117117
}
@@ -187,7 +187,7 @@ impl DirEntryExt for fs::DirEntry {
187187
#[stable(feature = "rust1", since = "1.0.0")]
188188
pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()>
189189
{
190-
sys::fs2::symlink(src.as_ref(), dst.as_ref())
190+
sys::fs::symlink(src.as_ref(), dst.as_ref())
191191
}
192192

193193
#[unstable(feature = "dir_builder", reason = "recently added API")]

0 commit comments

Comments
 (0)