Skip to content

Commit 6447532

Browse files
author
Palmer Cox
committed
---
yaml --- r: 105914 b: refs/heads/auto c: 9ba6bb5 h: refs/heads/master v: v3
1 parent 321b284 commit 6447532

31 files changed

+190
-239
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 792da8424f4f422c2750607dcc243315fdff9fc3
16+
refs/heads/auto: 9ba6bb5a71adeb861f8bf21c2b1f2fde3132480d
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/compiletest.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ pub fn opt_str2(maybestr: Option<~str>) -> ~str {
191191
}
192192

193193
pub fn str_mode(s: ~str) -> mode {
194-
match s.as_slice() {
195-
"compile-fail" => mode_compile_fail,
196-
"run-fail" => mode_run_fail,
197-
"run-pass" => mode_run_pass,
198-
"pretty" => mode_pretty,
199-
"debug-info" => mode_debug_info,
200-
"codegen" => mode_codegen,
194+
match s {
195+
~"compile-fail" => mode_compile_fail,
196+
~"run-fail" => mode_run_fail,
197+
~"run-pass" => mode_run_pass,
198+
~"pretty" => mode_pretty,
199+
~"debug-info" => mode_debug_info,
200+
~"codegen" => mode_codegen,
201201
_ => fail!("invalid mode")
202202
}
203203
}

branches/auto/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn load_errors(testfile: &Path) -> ~[ExpectedError] {
1919
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
2020
let mut line_num = 1u;
2121
for ln in rdr.lines() {
22-
error_patterns.push_all_move(parse_expected(line_num, ln));
22+
error_patterns.push_all_move(parse_expected(line_num, ln.unwrap()));
2323
line_num += 1u;
2424
}
2525
return error_patterns;

branches/auto/src/compiletest/header.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
140140
// Assume that any directives will be found before the first
141141
// module or function. This doesn't seem to be an optimization
142142
// with a warm page cache. Maybe with a cold one.
143+
let ln = ln.unwrap();
143144
if ln.starts_with("fn") || ln.starts_with("mod") {
144145
return true;
145146
} else { if !(it(ln.trim())) { return false; } }

branches/auto/src/compiletest/runtest.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ use test::MetricMap;
3838

3939
pub fn run(config: config, testfile: ~str) {
4040

41-
match config.target.as_slice() {
41+
match config.target {
4242

43-
"arm-linux-androideabi" => {
43+
~"arm-linux-androideabi" => {
4444
if !config.adb_device_status {
4545
fail!("android device not available");
4646
}
@@ -277,8 +277,8 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
277277
let exe_file = make_exe_name(config, testfile);
278278
279279
let mut proc_args;
280-
match config.target.as_slice() {
281-
"arm-linux-androideabi" => {
280+
match config.target {
281+
~"arm-linux-androideabi" => {
282282

283283
cmds = cmds.replace("run","continue");
284284

@@ -682,9 +682,9 @@ fn exec_compiled_test(config: &config, props: &TestProps,
682682

683683
let env = props.exec_env.clone();
684684

685-
match config.target.as_slice() {
685+
match config.target {
686686

687-
"arm-linux-androideabi" => {
687+
~"arm-linux-androideabi" => {
688688
_arm_exec_compiled_test(config, props, testfile, env)
689689
}
690690

@@ -735,9 +735,9 @@ fn compose_and_run_compiler(
735735
&auxres);
736736
}
737737

738-
match config.target.as_slice() {
738+
match config.target {
739739

740-
"arm-linux-androideabi" => {
740+
~"arm-linux-androideabi" => {
741741
_arm_push_aux_shared_library(config, testfile);
742742
}
743743

branches/auto/src/librustc/driver/driver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ pub fn build_session_options(matches: &getopts::Matches)
880880
}
881881
};
882882
let gc = debugging_opts & session::GC != 0;
883+
883884
let debuginfo = if matches.opt_present("g") {
884885
if matches.opt_present("debuginfo") {
885886
early_error("-g and --debuginfo both provided");

branches/auto/src/librustdoc/clean.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl Item {
137137
pub fn doc_list<'a>(&'a self) -> Option<&'a [Attribute]> {
138138
for attr in self.attrs.iter() {
139139
match *attr {
140-
List(ref x, ref list) if "doc" == *x => { return Some(list.as_slice()); }
140+
List(~"doc", ref list) => { return Some(list.as_slice()); }
141141
_ => {}
142142
}
143143
}
@@ -149,7 +149,7 @@ impl Item {
149149
pub fn doc_value<'a>(&'a self) -> Option<&'a str> {
150150
for attr in self.attrs.iter() {
151151
match *attr {
152-
NameValue(ref x, ref v) if "doc" == *x => { return Some(v.as_slice()); }
152+
NameValue(~"doc", ref v) => { return Some(v.as_slice()); }
153153
_ => {}
154154
}
155155
}

branches/auto/src/librustdoc/html/format.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,7 @@ impl fmt::Show for clean::Type {
357357
write!(f.buf, "{}{}fn{}{}",
358358
PuritySpace(decl.purity),
359359
match decl.abi {
360-
ref x if "" == *x => ~"",
361-
ref x if "\"Rust\"" == *x => ~"",
360+
~"" | ~"\"Rust\"" => ~"",
362361
ref s => " " + *s + " ",
363362
},
364363
decl.generics,

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ pub fn run(mut krate: clean::Crate, dst: Path) -> io::IoResult<()> {
225225
Some(attrs) => {
226226
for attr in attrs.iter() {
227227
match *attr {
228-
clean::NameValue(ref x, ref s) if "html_favicon_url" == *x => {
228+
clean::NameValue(~"html_favicon_url", ref s) => {
229229
cx.layout.favicon = s.to_owned();
230230
}
231-
clean::NameValue(ref x, ref s) if "html_logo_url" == *x => {
231+
clean::NameValue(~"html_logo_url", ref s) => {
232232
cx.layout.logo = s.to_owned();
233233
}
234-
clean::Word(ref x) if "html_no_source" == *x => {
234+
clean::Word(~"html_no_source") => {
235235
cx.include_sources = false;
236236
}
237237
_ => {}
@@ -396,10 +396,10 @@ fn extern_location(e: &clean::ExternalCrate, dst: &Path) -> ExternalLocation {
396396
// external crate
397397
for attr in e.attrs.iter() {
398398
match *attr {
399-
clean::List(ref x, ref list) if "doc" == *x => {
399+
clean::List(~"doc", ref list) => {
400400
for attr in list.iter() {
401401
match *attr {
402-
clean::NameValue(ref x, ref s) if "html_root_url" == *x => {
402+
clean::NameValue(~"html_root_url", ref s) => {
403403
if s.ends_with("/") {
404404
return Remote(s.to_owned());
405405
}
@@ -666,7 +666,7 @@ impl DocFolder for Cache {
666666
// extract relevant documentation for this impl
667667
match attrs.move_iter().find(|a| {
668668
match *a {
669-
clean::NameValue(ref x, _) if "doc" == *x => true,
669+
clean::NameValue(~"doc", _) => true,
670670
_ => false
671671
}
672672
}) {

branches/auto/src/librustdoc/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ pub fn main_args(args: &[~str]) -> int {
195195

196196
info!("going to format");
197197
let started = time::precise_time_ns();
198-
match matches.opt_str("w").as_ref().map(|s| s.as_slice()) {
199-
Some("html") | None => {
198+
match matches.opt_str("w") {
199+
Some(~"html") | None => {
200200
match html::render::run(krate, output.unwrap_or(Path::new("doc"))) {
201201
Ok(()) => {}
202202
Err(e) => fail!("failed to generate documentation: {}", e),
203203
}
204204
}
205-
Some("json") => {
205+
Some(~"json") => {
206206
match json_output(krate, res, output.unwrap_or(Path::new("doc.json"))) {
207207
Ok(()) => {}
208208
Err(e) => fail!("failed to write json: {}", e),
@@ -223,9 +223,9 @@ pub fn main_args(args: &[~str]) -> int {
223223
/// and files and then generates the necessary rustdoc output for formatting.
224224
fn acquire_input(input: &str,
225225
matches: &getopts::Matches) -> Result<Output, ~str> {
226-
match matches.opt_str("r").as_ref().map(|s| s.as_slice()) {
227-
Some("rust") => Ok(rust_input(input, matches)),
228-
Some("json") => json_input(input),
226+
match matches.opt_str("r") {
227+
Some(~"rust") => Ok(rust_input(input, matches)),
228+
Some(~"json") => json_input(input),
229229
Some(s) => Err("unknown input format: " + s),
230230
None => {
231231
if input.ends_with(".json") {
@@ -265,15 +265,15 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
265265
Some(nested) => {
266266
for inner in nested.iter() {
267267
match *inner {
268-
clean::Word(ref x) if "no_default_passes" == *x => {
268+
clean::Word(~"no_default_passes") => {
269269
default_passes = false;
270270
}
271-
clean::NameValue(ref x, ref value) if "passes" == *x => {
271+
clean::NameValue(~"passes", ref value) => {
272272
for pass in value.words() {
273273
passes.push(pass.to_owned());
274274
}
275275
}
276-
clean::NameValue(ref x, ref value) if "plugins" == *x => {
276+
clean::NameValue(~"plugins", ref value) => {
277277
for p in value.words() {
278278
plugins.push(p.to_owned());
279279
}

branches/auto/src/librustdoc/passes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult {
3434
fn fold_item(&mut self, i: Item) -> Option<Item> {
3535
for attr in i.attrs.iter() {
3636
match attr {
37-
&clean::List(ref x, ref l) if "doc" == *x => {
37+
&clean::List(~"doc", ref l) => {
3838
for innerattr in l.iter() {
3939
match innerattr {
4040
&clean::Word(ref s) if "hidden" == *s => {
@@ -223,7 +223,7 @@ pub fn unindent_comments(krate: clean::Crate) -> plugins::PluginResult {
223223
let mut avec: ~[clean::Attribute] = ~[];
224224
for attr in i.attrs.iter() {
225225
match attr {
226-
&clean::NameValue(ref x, ref s) if "doc" == *x => avec.push(
226+
&clean::NameValue(~"doc", ref s) => avec.push(
227227
clean::NameValue(~"doc", unindent(*s))),
228228
x => avec.push(x.clone())
229229
}
@@ -245,15 +245,15 @@ pub fn collapse_docs(krate: clean::Crate) -> plugins::PluginResult {
245245
let mut i = i;
246246
for attr in i.attrs.iter() {
247247
match *attr {
248-
clean::NameValue(ref x, ref s) if "doc" == *x => {
248+
clean::NameValue(~"doc", ref s) => {
249249
docstr.push_str(s.clone());
250250
docstr.push_char('\n');
251251
},
252252
_ => ()
253253
}
254254
}
255255
let mut a: ~[clean::Attribute] = i.attrs.iter().filter(|&a| match a {
256-
&clean::NameValue(ref x, _) if "doc" == *x => false,
256+
&clean::NameValue(~"doc", _) => false,
257257
_ => true
258258
}).map(|x| x.clone()).collect();
259259
if "" != docstr {

branches/auto/src/librustuv/tty.rs

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::io::IoError;
1211
use std::libc;
13-
use std::ptr;
12+
use std::io::IoError;
1413
use std::rt::rtio::RtioTTY;
1514

1615
use homing::{HomingIO, HomeHandle};
@@ -55,24 +54,20 @@ impl TtyWatcher {
5554
// If this file descriptor is indeed guessed to be a tty, then go ahead
5655
// with attempting to open it as a tty.
5756
let handle = UvHandle::alloc(None::<TtyWatcher>, uvll::UV_TTY);
58-
let mut watcher = TtyWatcher {
59-
tty: handle,
60-
stream: StreamWatcher::new(handle),
61-
home: io.make_handle(),
62-
fd: fd,
63-
};
6457
match unsafe {
6558
uvll::uv_tty_init(io.uv_loop(), handle, fd as libc::c_int,
6659
readable as libc::c_int)
6760
} {
68-
0 => Ok(watcher),
61+
0 => {
62+
Ok(TtyWatcher {
63+
tty: handle,
64+
stream: StreamWatcher::new(handle),
65+
home: io.make_handle(),
66+
fd: fd,
67+
})
68+
}
6969
n => {
70-
// On windows, libuv returns errors before initializing the
71-
// handle, so our only cleanup is to free the handle itself
72-
if cfg!(windows) {
73-
unsafe { uvll::free_handle(handle); }
74-
watcher.tty = ptr::null();
75-
}
70+
unsafe { uvll::free_handle(handle) }
7671
Err(UvError(n))
7772
}
7873
}
@@ -129,9 +124,7 @@ impl HomingIO for TtyWatcher {
129124

130125
impl Drop for TtyWatcher {
131126
fn drop(&mut self) {
132-
if !self.tty.is_null() {
133-
let _m = self.fire_homing_missile();
134-
self.close_async_();
135-
}
127+
let _m = self.fire_homing_missile();
128+
self.close_async_();
136129
}
137130
}

branches/auto/src/libserialize/serialize.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
Core encoding and decoding interfaces.
1515
*/
1616

17-
use std::path;
1817
use std::rc::Rc;
1918
use std::vec;
2019
use std::vec_ng::Vec;
@@ -626,32 +625,6 @@ impl<
626625
}
627626
}
628627

629-
impl<E: Encoder> Encodable<E> for path::posix::Path {
630-
fn encode(&self, e: &mut E) {
631-
self.as_vec().encode(e)
632-
}
633-
}
634-
635-
impl<D: Decoder> Decodable<D> for path::posix::Path {
636-
fn decode(d: &mut D) -> path::posix::Path {
637-
let bytes: ~[u8] = Decodable::decode(d);
638-
path::posix::Path::new(bytes)
639-
}
640-
}
641-
642-
impl<E: Encoder> Encodable<E> for path::windows::Path {
643-
fn encode(&self, e: &mut E) {
644-
self.as_vec().encode(e)
645-
}
646-
}
647-
648-
impl<D: Decoder> Decodable<D> for path::windows::Path {
649-
fn decode(d: &mut D) -> path::windows::Path {
650-
let bytes: ~[u8] = Decodable::decode(d);
651-
path::windows::Path::new(bytes)
652-
}
653-
}
654-
655628
// ___________________________________________________________________________
656629
// Helper routines
657630
//

branches/auto/src/libstd/io/buffered.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,9 @@ mod test {
537537
let in_buf = MemReader::new(bytes!("a\nb\nc").to_owned());
538538
let mut reader = BufferedReader::with_capacity(2, in_buf);
539539
let mut it = reader.lines();
540-
assert_eq!(it.next(), Some(~"a\n"));
541-
assert_eq!(it.next(), Some(~"b\n"));
542-
assert_eq!(it.next(), Some(~"c"));
540+
assert_eq!(it.next(), Some(Ok(~"a\n")));
541+
assert_eq!(it.next(), Some(Ok(~"b\n")));
542+
assert_eq!(it.next(), Some(Ok(~"c")));
543543
assert_eq!(it.next(), None);
544544
}
545545

@@ -569,8 +569,8 @@ mod test {
569569
let buf = [195u8, 159u8, 'a' as u8];
570570
let mut reader = BufferedReader::with_capacity(1, BufReader::new(buf));
571571
let mut it = reader.chars();
572-
assert_eq!(it.next(), Some('ß'));
573-
assert_eq!(it.next(), Some('a'));
572+
assert_eq!(it.next(), Some(Ok('ß')));
573+
assert_eq!(it.next(), Some(Ok('a')));
574574
assert_eq!(it.next(), None);
575575
}
576576

0 commit comments

Comments
 (0)