Skip to content

Commit aba36cb

Browse files
committed
---
yaml --- r: 191479 b: refs/heads/try c: 97f03e7 h: refs/heads/master i: 191477: 807465e 191475: bde2700 191471: 11f7b98 v: v3
1 parent f7fb4f6 commit aba36cb

File tree

4 files changed

+12
-38
lines changed

4 files changed

+12
-38
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: 809a554fca2d0ebc2ba50077016fe282a4064752
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c64d671671aea2e44ee7fc6eb00ee75fc30ed7b9
5-
refs/heads/try: fda8673531c2ecea13c86216f964feb6091b4ade
5+
refs/heads/try: 97f03e7ad91cec9715fefbc8112519bd7c01e756
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/num/mod.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,6 @@ pub trait Int
345345

346346
/// Saturating integer addition. Computes `self + other`, saturating at
347347
/// the numeric bounds instead of overflowing.
348-
///
349-
/// # Examples
350-
///
351-
/// ```
352-
/// use std::num::Int;
353-
///
354-
/// assert_eq!(5u16.saturating_add(65534), 65535);
355-
/// assert_eq!((-5i16).saturating_add(-32767), -32768);
356-
/// assert_eq!(100u32.saturating_add(4294967294), 4294967295);
357-
/// ```
358348
#[stable(feature = "rust1", since = "1.0.0")]
359349
#[inline]
360350
fn saturating_add(self, other: Self) -> Self {
@@ -367,16 +357,6 @@ pub trait Int
367357

368358
/// Saturating integer subtraction. Computes `self - other`, saturating at
369359
/// the numeric bounds instead of overflowing.
370-
///
371-
/// # Examples
372-
///
373-
/// ```
374-
/// use std::num::Int;
375-
///
376-
/// assert_eq!(5u16.saturating_sub(65534), 0);
377-
/// assert_eq!(5i16.saturating_sub(-32767), 32767);
378-
/// assert_eq!(100u32.saturating_sub(4294967294), 0);
379-
/// ```
380360
#[stable(feature = "rust1", since = "1.0.0")]
381361
#[inline]
382362
fn saturating_sub(self, other: Self) -> Self {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub use self::ip::{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;
28-
pub use self::parser::AddrParseError;
2928

3029
mod ip;
3130
mod addr;

branches/try/src/libstd/net/parser.rs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -296,40 +296,35 @@ impl<'a> Parser<'a> {
296296
}
297297
}
298298

299-
#[stable(feature = "rust1", since = "1.0.0")]
300299
impl FromStr for Ipv4Addr {
301-
type Err = AddrParseError;
302-
fn from_str(s: &str) -> Result<Ipv4Addr, AddrParseError> {
300+
type Err = ParseError;
301+
fn from_str(s: &str) -> Result<Ipv4Addr, ParseError> {
303302
match Parser::new(s).read_till_eof(|p| p.read_ipv4_addr()) {
304303
Some(s) => Ok(s),
305-
None => Err(AddrParseError(()))
304+
None => Err(ParseError)
306305
}
307306
}
308307
}
309308

310-
#[stable(feature = "rust1", since = "1.0.0")]
311309
impl FromStr for Ipv6Addr {
312-
type Err = AddrParseError;
313-
fn from_str(s: &str) -> Result<Ipv6Addr, AddrParseError> {
310+
type Err = ParseError;
311+
fn from_str(s: &str) -> Result<Ipv6Addr, ParseError> {
314312
match Parser::new(s).read_till_eof(|p| p.read_ipv6_addr()) {
315313
Some(s) => Ok(s),
316-
None => Err(AddrParseError(()))
314+
None => Err(ParseError)
317315
}
318316
}
319317
}
320318

321-
#[stable(feature = "rust1", since = "1.0.0")]
322319
impl FromStr for SocketAddr {
323-
type Err = AddrParseError;
324-
fn from_str(s: &str) -> Result<SocketAddr, AddrParseError> {
320+
type Err = ParseError;
321+
fn from_str(s: &str) -> Result<SocketAddr, ParseError> {
325322
match Parser::new(s).read_till_eof(|p| p.read_socket_addr()) {
326323
Some(s) => Ok(s),
327-
None => Err(AddrParseError(())),
324+
None => Err(ParseError),
328325
}
329326
}
330327
}
331328

332-
/// An error returned when parsing an IP address or a socket address.
333-
#[stable(feature = "rust1", since = "1.0.0")]
334-
#[derive(Debug, Clone, PartialEq)]
335-
pub struct AddrParseError(());
329+
#[derive(Debug, Clone, PartialEq, Copy)]
330+
pub struct ParseError;

0 commit comments

Comments
 (0)