Skip to content

Commit 96fd58b

Browse files
committed
---
yaml --- r: 194527 b: refs/heads/snap-stage3 c: 8165bc1 h: refs/heads/master i: 194525: ede6522 194523: 4a776d0 194519: 7b68004 194511: 64ca655 194495: a04c0f0 v: v3
1 parent f88d2ab commit 96fd58b

File tree

15 files changed

+106
-80
lines changed

15 files changed

+106
-80
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 242ed0b7c0f6a21096f2cc3e1ad1bdb176d02545
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: b0fd67b3e75dc2cc52a941733bd5dde574338779
4+
refs/heads/snap-stage3: 8165bc14fbc8456c35dc54fb6255456bea30db59
55
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/mk/tests.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,6 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
569569
CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
570570
endif
571571

572-
ifeq ($(findstring android, $(CFG_TARGET)), android)
573-
CTEST_DISABLE_debuginfo-gdb =
574-
CTEST_DISABLE_debuginfo-lldb = "lldb tests are disabled on android"
575-
endif
576-
577572
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
578573
# test group to be disabled *unless* the target is able to build a
579574
# compiler (i.e. when the target triple is in the set of of host

branches/snap-stage3/src/libcore/ops.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,10 +995,8 @@ impl fmt::Debug for RangeFull {
995995
#[stable(feature = "rust1", since = "1.0.0")]
996996
pub struct Range<Idx> {
997997
/// The lower bound of the range (inclusive).
998-
#[stable(feature = "rust1", since = "1.0.0")]
999998
pub start: Idx,
1000999
/// The upper bound of the range (exclusive).
1001-
#[stable(feature = "rust1", since = "1.0.0")]
10021000
pub end: Idx,
10031001
}
10041002

@@ -1015,10 +1013,11 @@ impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
10151013
#[stable(feature = "rust1", since = "1.0.0")]
10161014
pub struct RangeFrom<Idx> {
10171015
/// The lower bound of the range (inclusive).
1018-
#[stable(feature = "rust1", since = "1.0.0")]
10191016
pub start: Idx,
10201017
}
10211018

1019+
1020+
10221021
#[stable(feature = "rust1", since = "1.0.0")]
10231022
impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
10241023
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
@@ -1032,7 +1031,6 @@ impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
10321031
#[stable(feature = "rust1", since = "1.0.0")]
10331032
pub struct RangeTo<Idx> {
10341033
/// The upper bound of the range (exclusive).
1035-
#[stable(feature = "rust1", since = "1.0.0")]
10361034
pub end: Idx,
10371035
}
10381036

@@ -1043,6 +1041,7 @@ impl<Idx: fmt::Debug> fmt::Debug for RangeTo<Idx> {
10431041
}
10441042
}
10451043

1044+
10461045
/// The `Deref` trait is used to specify the functionality of dereferencing
10471046
/// operations like `*v`.
10481047
///

branches/snap-stage3/src/librustc/middle/infer/error_reporting.rs

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,23 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
357357
}
358358
};
359359

360+
let message_root_str = match trace.origin {
361+
infer::Misc(_) => "mismatched types",
362+
infer::MethodCompatCheck(_) => "method not compatible with trait",
363+
infer::ExprAssignable(_) => "mismatched types",
364+
infer::RelateTraitRefs(_) => "mismatched traits",
365+
infer::RelateSelfType(_) => "mismatched types",
366+
infer::RelateOutputImplTypes(_) => "mismatched types",
367+
infer::MatchExpressionArm(_, _) => "match arms have incompatible types",
368+
infer::IfExpression(_) => "if and else have incompatible types",
369+
infer::IfExpressionWithNoElse(_) => "if may be missing an else clause",
370+
infer::RangeExpression(_) => "start and end of range have incompatible types",
371+
infer::EquatePredicate(_) => "equality predicate not satisfied",
372+
};
373+
360374
span_err!(self.tcx.sess, trace.origin.span(), E0308,
361375
"{}: {} ({})",
362-
trace.origin,
376+
message_root_str,
363377
expected_found_str,
364378
ty::type_err_to_str(self.tcx, terr));
365379

@@ -1481,38 +1495,38 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
14811495
infer::Subtype(ref trace) => {
14821496
let desc = match trace.origin {
14831497
infer::Misc(_) => {
1484-
"types are compatible"
1498+
format!("types are compatible")
14851499
}
14861500
infer::MethodCompatCheck(_) => {
1487-
"method type is compatible with trait"
1501+
format!("method type is compatible with trait")
14881502
}
14891503
infer::ExprAssignable(_) => {
1490-
"expression is assignable"
1504+
format!("expression is assignable")
14911505
}
14921506
infer::RelateTraitRefs(_) => {
1493-
"traits are compatible"
1507+
format!("traits are compatible")
14941508
}
14951509
infer::RelateSelfType(_) => {
1496-
"self type matches impl self type"
1510+
format!("self type matches impl self type")
14971511
}
14981512
infer::RelateOutputImplTypes(_) => {
1499-
"trait type parameters matches those \
1500-
specified on the impl"
1513+
format!("trait type parameters matches those \
1514+
specified on the impl")
15011515
}
15021516
infer::MatchExpressionArm(_, _) => {
1503-
"match arms have compatible types"
1517+
format!("match arms have compatible types")
15041518
}
15051519
infer::IfExpression(_) => {
1506-
"if and else have compatible types"
1520+
format!("if and else have compatible types")
15071521
}
15081522
infer::IfExpressionWithNoElse(_) => {
1509-
"if may be missing an else clause"
1523+
format!("if may be missing an else clause")
15101524
}
15111525
infer::RangeExpression(_) => {
1512-
"start and end of range have compatible types"
1526+
format!("start and end of range have compatible types")
15131527
}
15141528
infer::EquatePredicate(_) => {
1515-
"equality where clause is satisfied"
1529+
format!("equality where clause is satisfied")
15161530
}
15171531
};
15181532

@@ -1652,8 +1666,8 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
16521666
infer::RelateRegionParamBound(span) => {
16531667
self.tcx.sess.span_note(
16541668
span,
1655-
"...so that the declared lifetime parameter bounds \
1656-
are satisfied");
1669+
&format!("...so that the declared lifetime parameter bounds \
1670+
are satisfied"));
16571671
}
16581672
infer::SafeDestructor(span) => {
16591673
self.tcx.sess.span_note(

branches/snap-stage3/src/librustc/middle/infer/mod.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use middle::ty::replace_late_bound_regions;
2929
use middle::ty::{self, Ty};
3030
use middle::ty_fold::{TypeFolder, TypeFoldable};
3131
use std::cell::{RefCell};
32-
use std::fmt;
3332
use std::rc::Rc;
3433
use syntax::ast;
3534
use syntax::codemap;
@@ -129,30 +128,6 @@ pub enum TypeOrigin {
129128
EquatePredicate(Span),
130129
}
131130

132-
impl TypeOrigin {
133-
fn as_str(&self) -> &'static str {
134-
match self {
135-
&TypeOrigin::Misc(_) |
136-
&TypeOrigin::RelateSelfType(_) |
137-
&TypeOrigin::RelateOutputImplTypes(_) |
138-
&TypeOrigin::ExprAssignable(_) => "mismatched types",
139-
&TypeOrigin::RelateTraitRefs(_) => "mismatched traits",
140-
&TypeOrigin::MethodCompatCheck(_) => "method not compatible with trait",
141-
&TypeOrigin::MatchExpressionArm(_, _) => "match arms have incompatible types",
142-
&TypeOrigin::IfExpression(_) => "if and else have incompatible types",
143-
&TypeOrigin::IfExpressionWithNoElse(_) => "if may be missing an else clause",
144-
&TypeOrigin::RangeExpression(_) => "start and end of range have incompatible types",
145-
&TypeOrigin::EquatePredicate(_) => "equality predicate not satisfied",
146-
}
147-
}
148-
}
149-
150-
impl fmt::Display for TypeOrigin {
151-
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(),fmt::Error> {
152-
fmt::Display::fmt(self.as_str(), f)
153-
}
154-
}
155-
156131
/// See `error_reporting.rs` for more details
157132
#[derive(Clone, Debug)]
158133
pub enum ValuePairs<'tcx> {

branches/snap-stage3/src/libstd/net/addr.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use hash;
1515
use io;
1616
use libc::{self, socklen_t, sa_family_t};
1717
use mem;
18-
use net::{lookup_host, ntoh, hton, Ipv4Addr, Ipv6Addr};
18+
use net::{lookup_host, ntoh, hton, IpAddr, Ipv4Addr, Ipv6Addr};
1919
use option;
2020
use sys_common::{FromInner, AsInner, IntoInner};
2121
use vec;
@@ -47,6 +47,15 @@ pub struct SocketAddrV4 { inner: libc::sockaddr_in }
4747
pub struct SocketAddrV6 { inner: libc::sockaddr_in6 }
4848

4949
impl SocketAddr {
50+
/// Gets the IP address associated with this socket address.
51+
#[unstable(feature = "ip_addr", reason = "recent addition")]
52+
pub fn ip(&self) -> IpAddr {
53+
match *self {
54+
SocketAddr::V4(ref a) => IpAddr::V4(*a.ip()),
55+
SocketAddr::V6(ref a) => IpAddr::V6(*a.ip()),
56+
}
57+
}
58+
5059
/// Gets the port number associated with this socket address
5160
#[stable(feature = "rust1", since = "1.0.0")]
5261
pub fn port(&self) -> u16 {
@@ -333,6 +342,18 @@ impl ToSocketAddrs for SocketAddrV6 {
333342
}
334343
}
335344

345+
#[stable(feature = "rust1", since = "1.0.0")]
346+
impl ToSocketAddrs for (IpAddr, u16) {
347+
type Iter = option::IntoIter<SocketAddr>;
348+
fn to_socket_addrs(&self) -> io::Result<option::IntoIter<SocketAddr>> {
349+
let (ip, port) = *self;
350+
match ip {
351+
IpAddr::V4(ref a) => (*a, port).to_socket_addrs(),
352+
IpAddr::V6(ref a) => (*a, port).to_socket_addrs(),
353+
}
354+
}
355+
}
356+
336357
#[stable(feature = "rust1", since = "1.0.0")]
337358
impl ToSocketAddrs for (Ipv4Addr, u16) {
338359
type Iter = option::IntoIter<SocketAddr>;

branches/snap-stage3/src/libstd/net/ip.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ use libc;
2121
use sys_common::{AsInner, FromInner};
2222
use net::{hton, ntoh};
2323

24+
/// An IP address, either a IPv4 or IPv6 address.
25+
#[unstable(feature = "ip_addr", reason = "recent addition")]
26+
#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash, PartialOrd, Ord)]
27+
pub enum IpAddr {
28+
/// Representation of an IPv4 address.
29+
V4(Ipv4Addr),
30+
/// Representation of an IPv6 address.
31+
V6(Ipv6Addr),
32+
}
33+
2434
/// Representation of an IPv4 address.
2535
#[derive(Copy)]
2636
#[stable(feature = "rust1", since = "1.0.0")]
@@ -139,6 +149,16 @@ impl Ipv4Addr {
139149

140150
}
141151

152+
#[stable(feature = "rust1", since = "1.0.0")]
153+
impl fmt::Display for IpAddr {
154+
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
155+
match *self {
156+
IpAddr::V4(ref a) => a.fmt(fmt),
157+
IpAddr::V6(ref a) => a.fmt(fmt),
158+
}
159+
}
160+
}
161+
142162
#[stable(feature = "rust1", since = "1.0.0")]
143163
impl fmt::Display for Ipv4Addr {
144164
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {

branches/snap-stage3/src/libstd/net/mod.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use io::{self, Error, ErrorKind};
2121
use num::Int;
2222
use sys_common::net2 as net_imp;
2323

24-
pub use self::ip::{Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
24+
pub use self::ip::{IpAddr, Ipv4Addr, Ipv6Addr, Ipv6MulticastScope};
2525
pub use self::addr::{SocketAddr, SocketAddrV4, SocketAddrV6, ToSocketAddrs};
2626
pub use self::tcp::{TcpStream, TcpListener};
2727
pub use self::udp::UdpSocket;
@@ -74,10 +74,14 @@ fn each_addr<A: ToSocketAddrs, F, T>(addr: A, mut f: F) -> io::Result<T>
7474
}
7575

7676
/// An iterator over `SocketAddr` values returned from a host lookup operation.
77-
#[stable(feature = "rust1", since = "1.0.0")]
77+
#[unstable(feature = "lookup_host", reason = "unsure about the returned \
78+
iterator and returning socket \
79+
addresses")]
7880
pub struct LookupHost(net_imp::LookupHost);
7981

80-
#[stable(feature = "rust1", since = "1.0.0")]
82+
#[unstable(feature = "lookup_host", reason = "unsure about the returned \
83+
iterator and returning socket \
84+
addresses")]
8185
impl Iterator for LookupHost {
8286
type Item = io::Result<SocketAddr>;
8387
fn next(&mut self) -> Option<io::Result<SocketAddr>> { self.0.next() }
@@ -91,7 +95,7 @@ impl Iterator for LookupHost {
9195
/// # Examples
9296
///
9397
/// ```no_run
94-
/// # #![feature(net)]
98+
/// # #![feature(lookup_host)]
9599
/// use std::net;
96100
///
97101
/// # fn foo() -> std::io::Result<()> {
@@ -101,7 +105,9 @@ impl Iterator for LookupHost {
101105
/// # Ok(())
102106
/// # }
103107
/// ```
104-
#[stable(feature = "rust1", since = "1.0.0")]
108+
#[unstable(feature = "lookup_host", reason = "unsure about the returned \
109+
iterator and returning socket \
110+
addresses")]
105111
pub fn lookup_host(host: &str) -> io::Result<LookupHost> {
106112
net_imp::lookup_host(host).map(LookupHost)
107113
}

branches/snap-stage3/src/libstd/net/udp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use prelude::v1::*;
1515

1616
use io::{self, Error, ErrorKind};
17-
use net::{ToSocketAddrs, SocketAddr};
17+
use net::{ToSocketAddrs, SocketAddr, IpAddr};
1818
use sys_common::net2 as net_imp;
1919
use sys_common::AsInner;
2020

@@ -116,12 +116,12 @@ impl UdpSocket {
116116
}
117117

118118
/// Joins a multicast IP address (becomes a member of it)
119-
pub fn join_multicast(&self, multi: &SocketAddr) -> io::Result<()> {
119+
pub fn join_multicast(&self, multi: &IpAddr) -> io::Result<()> {
120120
self.0.join_multicast(multi)
121121
}
122122

123123
/// Leaves a multicast IP address (drops membership from it)
124-
pub fn leave_multicast(&self, multi: &SocketAddr) -> io::Result<()> {
124+
pub fn leave_multicast(&self, multi: &IpAddr) -> io::Result<()> {
125125
self.0.leave_multicast(multi)
126126
}
127127

branches/snap-stage3/src/libstd/process.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@ mod tests {
748748
cmd
749749
}
750750

751-
#[cfg(not(target_arch = "aarch64"))]
752751
#[test]
753752
fn test_keep_current_working_dir() {
754753
use os;

0 commit comments

Comments
 (0)