Skip to content

Commit 5ce4f32

Browse files
---
yaml --- r: 105407 b: refs/heads/master c: 5db7f7e h: refs/heads/master i: 105405: 4552796 105403: 258a904 105399: 4064360 105391: 8810cf8 105375: 954b81b 105343: 29db2b1 v: v3
1 parent e43c6b9 commit 5ce4f32

File tree

9 files changed

+29
-203
lines changed

9 files changed

+29
-203
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: eb68beec4b809c1e091ce678a2c18347701497c2
2+
refs/heads/master: 5db7f7ed2413476e2006af6068d1b3a53e00db38
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b8601a3d8b91ad3b653d143307611f2f5c75617e
55
refs/heads/try: db814977d07bd798feb24f6b74c00800ef458a13

trunk/src/libgetopts/lib.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,34 +98,27 @@ use std::vec;
9898

9999
/// Name of an option. Either a string or a single char.
100100
#[deriving(Clone, Eq)]
101+
#[allow(missing_doc)]
101102
pub enum Name {
102-
/// A string representing the long name of an option.
103-
/// For example: "help"
104103
Long(~str),
105-
/// A char representing the short name of an option.
106-
/// For example: 'h'
107104
Short(char),
108105
}
109106

110107
/// Describes whether an option has an argument.
111108
#[deriving(Clone, Eq)]
109+
#[allow(missing_doc)]
112110
pub enum HasArg {
113-
/// The option requires an argument.
114111
Yes,
115-
/// The option is just a flag, therefore no argument.
116112
No,
117-
/// The option argument is optional and it could or not exist.
118113
Maybe,
119114
}
120115

121116
/// Describes how often an option may occur.
122117
#[deriving(Clone, Eq)]
118+
#[allow(missing_doc)]
123119
pub enum Occur {
124-
/// The option occurs once.
125120
Req,
126-
/// The option could or not occur.
127121
Optional,
128-
/// The option occurs once or multiple times.
129122
Multi,
130123
}
131124

@@ -183,16 +176,12 @@ pub struct Matches {
183176
/// expected format. Call the `to_err_msg` method to retrieve the
184177
/// error as a string.
185178
#[deriving(Clone, Eq, Show)]
179+
#[allow(missing_doc)]
186180
pub enum Fail_ {
187-
/// The option requires an argument but none was passed.
188181
ArgumentMissing(~str),
189-
/// The passed option is not declared among the possible options.
190182
UnrecognizedOption(~str),
191-
/// A required option is not present.
192183
OptionMissing(~str),
193-
/// A single occurence option is being used multiple times.
194184
OptionDuplicated(~str),
195-
/// There's an argument being passed to a non-argument option.
196185
UnexpectedArgument(~str),
197186
}
198187

trunk/src/librustc/middle/typeck/check/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,13 +2317,11 @@ fn check_expr_with_unifier(fcx: @FnCtxt,
23172317
fcx.type_error_message(
23182318
expr.span,
23192319
|actual| {
2320-
format!("attempted to take value of method `{}` on type `{}`",
2320+
format!("attempted to take value of method `{}` on type `{}` \
2321+
(try writing an anonymous function)",
23212322
token::get_name(field), actual)
23222323
},
23232324
expr_t, None);
2324-
2325-
tcx.sess.span_note(expr.span,
2326-
"maybe a missing `()` to call it? If not, try an anonymous function.");
23272325
}
23282326

23292327
None => {

trunk/src/libstd/mem.rs

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -99,127 +99,32 @@ pub unsafe fn move_val_init<T>(dst: &mut T, src: T) {
9999
intrinsics::move_val_init(dst, src)
100100
}
101101

102-
/// Convert an i16 to little endian from the target's endianness.
103-
///
104-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
105102
#[cfg(target_endian = "little")] #[inline] pub fn to_le16(x: i16) -> i16 { x }
106-
107-
/// Convert an i16 to little endian from the target's endianness.
108-
///
109-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
110103
#[cfg(target_endian = "big")] #[inline] pub fn to_le16(x: i16) -> i16 { unsafe { bswap16(x) } }
111-
112-
/// Convert an i32 to little endian from the target's endianness.
113-
///
114-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
115104
#[cfg(target_endian = "little")] #[inline] pub fn to_le32(x: i32) -> i32 { x }
116-
117-
/// Convert an i32 to little endian from the target's endianness.
118-
///
119-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
120105
#[cfg(target_endian = "big")] #[inline] pub fn to_le32(x: i32) -> i32 { unsafe { bswap32(x) } }
121-
122-
/// Convert an i64 to little endian from the target's endianness.
123-
///
124-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
125106
#[cfg(target_endian = "little")] #[inline] pub fn to_le64(x: i64) -> i64 { x }
126-
127-
/// Convert an i64 to little endian from the target's endianness.
128-
///
129-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
130107
#[cfg(target_endian = "big")] #[inline] pub fn to_le64(x: i64) -> i64 { unsafe { bswap64(x) } }
131108

132-
133-
/// Convert an i16 to big endian from the target's endianness.
134-
///
135-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
136109
#[cfg(target_endian = "little")] #[inline] pub fn to_be16(x: i16) -> i16 { unsafe { bswap16(x) } }
137-
138-
/// Convert an i16 to big endian from the target's endianness.
139-
///
140-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
141110
#[cfg(target_endian = "big")] #[inline] pub fn to_be16(x: i16) -> i16 { x }
142-
143-
/// Convert an i32 to big endian from the target's endianness.
144-
///
145-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
146111
#[cfg(target_endian = "little")] #[inline] pub fn to_be32(x: i32) -> i32 { unsafe { bswap32(x) } }
147-
148-
/// Convert an i32 to big endian from the target's endianness.
149-
///
150-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
151112
#[cfg(target_endian = "big")] #[inline] pub fn to_be32(x: i32) -> i32 { x }
152-
153-
/// Convert an i64 to big endian from the target's endianness.
154-
///
155-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
156113
#[cfg(target_endian = "little")] #[inline] pub fn to_be64(x: i64) -> i64 { unsafe { bswap64(x) } }
157-
158-
/// Convert an i64 to big endian from the target's endianness.
159-
///
160-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
161114
#[cfg(target_endian = "big")] #[inline] pub fn to_be64(x: i64) -> i64 { x }
162115

163-
164-
/// Convert an i16 from little endian to the target's endianness.
165-
///
166-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
167116
#[cfg(target_endian = "little")] #[inline] pub fn from_le16(x: i16) -> i16 { x }
168-
169-
/// Convert an i16 from little endian to the target's endianness.
170-
///
171-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
172117
#[cfg(target_endian = "big")] #[inline] pub fn from_le16(x: i16) -> i16 { unsafe { bswap16(x) } }
173-
174-
/// Convert an i32 from little endian to the target's endianness.
175-
///
176-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
177118
#[cfg(target_endian = "little")] #[inline] pub fn from_le32(x: i32) -> i32 { x }
178-
179-
/// Convert an i32 from little endian to the target's endianness.
180-
///
181-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
182119
#[cfg(target_endian = "big")] #[inline] pub fn from_le32(x: i32) -> i32 { unsafe { bswap32(x) } }
183-
184-
/// Convert an i64 from little endian to the target's endianness.
185-
///
186-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
187120
#[cfg(target_endian = "little")] #[inline] pub fn from_le64(x: i64) -> i64 { x }
188-
189-
/// Convert an i64 from little endian to the target's endianness.
190-
///
191-
/// On little endian, this is a no-op. On big endian, the bytes are swapped.
192121
#[cfg(target_endian = "big")] #[inline] pub fn from_le64(x: i64) -> i64 { unsafe { bswap64(x) } }
193122

194-
195-
/// Convert an i16 from big endian to the target's endianness.
196-
///
197-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
198123
#[cfg(target_endian = "little")] #[inline] pub fn from_be16(x: i16) -> i16 { unsafe { bswap16(x) } }
199-
200-
/// Convert an i16 from big endian to the target's endianness.
201-
///
202-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
203124
#[cfg(target_endian = "big")] #[inline] pub fn from_be16(x: i16) -> i16 { x }
204-
205-
/// Convert an i32 from big endian to the target's endianness.
206-
///
207-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
208125
#[cfg(target_endian = "little")] #[inline] pub fn from_be32(x: i32) -> i32 { unsafe { bswap32(x) } }
209-
210-
/// Convert an i32 from big endian to the target's endianness.
211-
///
212-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
213126
#[cfg(target_endian = "big")] #[inline] pub fn from_be32(x: i32) -> i32 { x }
214-
215-
/// Convert an i64 from big endian to the target's endianness.
216-
///
217-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
218127
#[cfg(target_endian = "little")] #[inline] pub fn from_be64(x: i64) -> i64 { unsafe { bswap64(x) } }
219-
220-
/// Convert an i64 from big endian to the target's endianness.
221-
///
222-
/// On big endian, this is a no-op. On little endian, the bytes are swapped.
223128
#[cfg(target_endian = "big")] #[inline] pub fn from_be64(x: i64) -> i64 { x }
224129

225130

trunk/src/libstd/option.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@ impl<T> Option<T> {
311311
/// Fails if the value equals `None`.
312312
#[inline]
313313
pub fn take_unwrap(&mut self) -> T {
314-
match self.take() {
315-
Some(x) => x,
316-
None => fail!("called `Option::take_unwrap()` on a `None` value")
314+
if self.is_none() {
315+
fail!("called `Option::take_unwrap()` on a `None` value")
317316
}
317+
self.take().unwrap()
318318
}
319319

320320
/// Gets an immutable reference to the value inside an option.

trunk/src/libstd/vec_ng.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,7 @@ impl<T> Vec<T> {
415415
unsafe { // infallible
416416
// The spot to put the new value
417417
{
418-
let slice = self.as_mut_slice();
419-
let p = slice.as_mut_ptr().offset(index as int);
418+
let p = self.as_mut_ptr().offset(index as int);
420419
// Shift everything over to make space. (Duplicating the
421420
// `index`th element into two consecutive places.)
422421
ptr::copy_memory(p.offset(1), &*p, len - index);
@@ -434,9 +433,8 @@ impl<T> Vec<T> {
434433
unsafe { // infallible
435434
let ret;
436435
{
437-
let slice = self.as_mut_slice();
438436
// the place we are taking from.
439-
let ptr = slice.as_mut_ptr().offset(index as int);
437+
let ptr = self.as_mut_ptr().offset(index as int);
440438
// copy it out, unsafely having a copy of the value on
441439
// the stack and in the vector at the same time.
442440
ret = Some(ptr::read(ptr as *T));
@@ -499,6 +497,11 @@ impl<T> Vec<T> {
499497
pub fn as_ptr(&self) -> *T {
500498
self.as_slice().as_ptr()
501499
}
500+
501+
#[inline]
502+
pub fn as_mut_ptr(&mut self) -> *mut T {
503+
self.as_mut_slice().as_mut_ptr()
504+
}
502505
}
503506

504507
impl<T> Mutable for Vec<T> {

trunk/src/libtime/lib.rs

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -187,51 +187,20 @@ pub fn tzset() {
187187
}
188188
}
189189

190-
/// Holds a calendar date and time broken down into its components (year, month, day, and so on),
191-
/// also called a broken-down time value.
192190
#[deriving(Clone, Eq, Encodable, Decodable, Show)]
193191
pub struct Tm {
194-
/// Seconds after the minute – [0, 60]
195-
tm_sec: i32,
196-
197-
/// Minutes after the hour – [0, 59]
198-
tm_min: i32,
199-
200-
/// Hours after midnight – [0, 23]
201-
tm_hour: i32,
202-
203-
/// Day of the month – [1, 31]
204-
tm_mday: i32,
205-
206-
/// Months since January – [0, 11]
207-
tm_mon: i32,
208-
209-
/// Years since 1900
210-
tm_year: i32,
211-
212-
/// Days since Sunday – [0, 6]. 0 = Sunday, 1 = Monday, …, 6 = Saturday.
213-
tm_wday: i32,
214-
215-
/// Days since January 1 – [0, 365]
216-
tm_yday: i32,
217-
218-
/// Daylight Saving Time flag.
219-
///
220-
/// This value is positive if Daylight Saving Time is in effect, zero if Daylight Saving Time
221-
/// is not in effect, and negative if this information is not available.
222-
tm_isdst: i32,
223-
224-
/// Identifies the time zone that was used to compute this broken-down time value, including any
225-
/// adjustment for Daylight Saving Time. This is the number of seconds east of UTC. For example,
226-
/// for U.S. Pacific Daylight Time, the value is -7*60*60 = -25200.
227-
tm_gmtoff: i32,
228-
229-
/// Abbreviated name for the time zone that was used to compute this broken-down time value.
230-
/// For example, U.S. Pacific Daylight Time is "PDT".
231-
tm_zone: ~str,
232-
233-
/// Nanoseconds after the second – [0, 10<sup>9</sup> - 1]
234-
tm_nsec: i32,
192+
tm_sec: i32, // seconds after the minute ~[0-60]
193+
tm_min: i32, // minutes after the hour ~[0-59]
194+
tm_hour: i32, // hours after midnight ~[0-23]
195+
tm_mday: i32, // days of the month ~[1-31]
196+
tm_mon: i32, // months since January ~[0-11]
197+
tm_year: i32, // years since 1900
198+
tm_wday: i32, // days since Sunday ~[0-6]
199+
tm_yday: i32, // days since January 1 ~[0-365]
200+
tm_isdst: i32, // Daylight Savings Time flag
201+
tm_gmtoff: i32, // offset from UTC in seconds
202+
tm_zone: ~str, // timezone abbreviation
203+
tm_nsec: i32, // nanoseconds
235204
}
236205

237206
pub fn empty_tm() -> Tm {

trunk/src/test/compile-fail/method-missing-call.rs

Lines changed: 0 additions & 34 deletions
This file was deleted.

trunk/src/test/run-pass/tcp-stress.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
// ignore-android needs extra network permissions
1414
// exec-env:RUST_LOG=debug
1515

16-
#[feature(phase)];
17-
#[phase(syntax, link)]
18-
extern crate log;
19-
2016
use std::libc;
2117
use std::io::net::ip::{Ipv4Addr, SocketAddr};
2218
use std::io::net::tcp::{TcpListener, TcpStream};

0 commit comments

Comments
 (0)