Skip to content

Commit fcaf843

Browse files
committed
---
yaml --- r: 77044 b: refs/heads/snap-stage3 c: fca7519 h: refs/heads/master v: v3
1 parent 51b339e commit fcaf843

28 files changed

+133
-362
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: f1132496dddbdd88f321a7919eec3d65136b3f75
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 996989cdb4c936ee3e41e65e6cd4d22c073206f9
4+
refs/heads/snap-stage3: fca75199c7b2186e64fcab51a9e498695ce4a7b8
55
refs/heads/try: ebfe63cd1c0b5d23f7ea60c69b4fde2e30cfd42a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libextra/fileinput.rs

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ reset once it has been finished, so attempting to iterate on `[None,
2727
None]` will only take input once unless `io::stdin().seek(0, SeekSet)`
2828
is called between.
2929
30-
The `make_path_option_vec` function handles converting a list of file paths as
30+
The `pathify` function handles converting a list of file paths as
3131
strings to the appropriate format, including the (optional) conversion
3232
of `"-"` to `stdin`.
3333
@@ -42,7 +42,7 @@ to handle any `FileInput` structs. E.g. a simple `cat` program
4242
4343
or a program that numbers lines after concatenating two files
4444
45-
for input_vec_state(make_path_option_vec([~"a.txt", ~"b.txt"])) |line, state| {
45+
for input_vec_state(pathify([~"a.txt", ~"b.txt"])) |line, state| {
4646
io::println(fmt!("%u: %s", state.line_num,
4747
line));
4848
}
@@ -145,14 +145,8 @@ struct FileInput_ {
145145
previous_was_newline: bool
146146
}
147147

148-
149-
// FIXME #5723: remove this when Reader has &mut self.
150-
// Removing it would mean giving read_byte in the Reader impl for
151-
// FileInput &mut self, which in turn means giving most of the
152-
// io::Reader trait methods &mut self. That can't be done right now
153-
// because of io::with_bytes_reader and #5723.
154-
// Should be removable via
155-
// "self.fi" -> "self." and renaming FileInput_. Documentation above
148+
// XXX: remove this when Reader has &mut self. Should be removable via
149+
// "self.fi." -> "self." and renaming FileInput_. Documentation above
156150
// will likely have to be updated to use `let mut in = ...`.
157151
pub struct FileInput {
158152
fi: @mut FileInput_
@@ -200,7 +194,7 @@ impl FileInput {
200194
*/
201195
pub fn from_args() -> FileInput {
202196
let args = os::args();
203-
let pathed = make_path_option_vec(args.tail(), true);
197+
let pathed = pathify(args.tail(), true);
204198
FileInput::from_vec(pathed)
205199
}
206200

@@ -357,7 +351,8 @@ Convert a list of strings to an appropriate form for a `FileInput`
357351
instance. `stdin_hyphen` controls whether `-` represents `stdin` or
358352
a literal `-`.
359353
*/
360-
pub fn make_path_option_vec(vec: &[~str], stdin_hyphen : bool) -> ~[Option<Path>] {
354+
// XXX: stupid, unclear name
355+
pub fn pathify(vec: &[~str], stdin_hyphen : bool) -> ~[Option<Path>] {
361356
vec.iter().map(|str| {
362357
if stdin_hyphen && "-" == *str {
363358
None
@@ -415,7 +410,7 @@ pub fn input_vec_state(files: ~[Option<Path>],
415410
#[cfg(test)]
416411
mod test {
417412

418-
use super::{FileInput, make_path_option_vec, input_vec, input_vec_state};
413+
use super::{FileInput, pathify, input_vec, input_vec_state};
419414

420415
use std::io;
421416
use std::uint;
@@ -431,22 +426,22 @@ mod test {
431426
}
432427

433428
#[test]
434-
fn test_make_path_option_vec() {
429+
fn test_pathify() {
435430
let strs = [~"some/path",
436431
~"some/other/path"];
437432
let paths = ~[Some(Path("some/path")),
438433
Some(Path("some/other/path"))];
439434

440-
assert_eq!(make_path_option_vec(strs, true), paths.clone());
441-
assert_eq!(make_path_option_vec(strs, false), paths);
435+
assert_eq!(pathify(strs, true), paths.clone());
436+
assert_eq!(pathify(strs, false), paths);
442437

443-
assert_eq!(make_path_option_vec([~"-"], true), ~[None]);
444-
assert_eq!(make_path_option_vec([~"-"], false), ~[Some(Path("-"))]);
438+
assert_eq!(pathify([~"-"], true), ~[None]);
439+
assert_eq!(pathify([~"-"], false), ~[Some(Path("-"))]);
445440
}
446441
447442
#[test]
448443
fn test_fileinput_read_byte() {
449-
let filenames = make_path_option_vec(vec::from_fn(
444+
let filenames = pathify(vec::from_fn(
450445
3,
451446
|i| fmt!("tmp/lib-fileinput-test-fileinput-read-byte-%u.tmp", i)), true);
452447
@@ -476,7 +471,7 @@ mod test {
476471
477472
#[test]
478473
fn test_fileinput_read() {
479-
let filenames = make_path_option_vec(vec::from_fn(
474+
let filenames = pathify(vec::from_fn(
480475
3,
481476
|i| fmt!("tmp/lib-fileinput-test-fileinput-read-%u.tmp", i)), true);
482477
@@ -497,7 +492,7 @@ mod test {
497492
#[test]
498493
fn test_input_vec() {
499494
let mut all_lines = ~[];
500-
let filenames = make_path_option_vec(vec::from_fn(
495+
let filenames = pathify(vec::from_fn(
501496
3,
502497
|i| fmt!("tmp/lib-fileinput-test-input-vec-%u.tmp", i)), true);
503498

@@ -519,7 +514,7 @@ mod test {
519514

520515
#[test]
521516
fn test_input_vec_state() {
522-
let filenames = make_path_option_vec(vec::from_fn(
517+
let filenames = pathify(vec::from_fn(
523518
3,
524519
|i| fmt!("tmp/lib-fileinput-test-input-vec-state-%u.tmp", i)),true);
525520

@@ -541,7 +536,7 @@ mod test {
541536

542537
#[test]
543538
fn test_empty_files() {
544-
let filenames = make_path_option_vec(vec::from_fn(
539+
let filenames = pathify(vec::from_fn(
545540
3,
546541
|i| fmt!("tmp/lib-fileinput-test-empty-files-%u.tmp", i)),true);
547542

@@ -588,7 +583,7 @@ mod test {
588583
589584
#[test]
590585
fn test_next_file() {
591-
let filenames = make_path_option_vec(vec::from_fn(
586+
let filenames = pathify(vec::from_fn(
592587
3,
593588
|i| fmt!("tmp/lib-fileinput-test-next-file-%u.tmp", i)),true);
594589
@@ -619,7 +614,7 @@ mod test {
619614
#[test]
620615
#[should_fail]
621616
fn test_input_vec_missing_file() {
622-
do input_vec(make_path_option_vec([~"this/file/doesnt/exist"], true)) |line| {
617+
do input_vec(pathify([~"this/file/doesnt/exist"], true)) |line| {
623618
println(line);
624619
true
625620
};

branches/snap-stage3/src/libextra/flatpipes.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,8 @@ pub mod bytepipes {
564564
}
565565
}
566566

567-
// FIXME #6850: Remove `@mut` when this module is ported to the new I/O traits,
568-
// which use `&mut self` properly. (For example, util::comm::GenericPort's try_recv
569-
// method doesn't use `&mut self`, so the `try_recv` method in the impl of `BytePort`
570-
// for `PipeBytePort` can't have `&mut self` either.)
567+
// XXX: Remove `@mut` when this module is ported to the new I/O traits,
568+
// which use `&mut self` properly.
571569
pub struct PipeBytePort {
572570
port: comm::Port<~[u8]>,
573571
buf: @mut ~[u8]

branches/snap-stage3/src/libextra/io_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl BufReader {
3030
}
3131

3232
fn as_bytes_reader<A>(&self, f: &fn(&BytesReader) -> A) -> A {
33-
// FIXME(#5723)
33+
// XXX FIXME(#5723)
3434
let bytes = ::std::util::id::<&[u8]>(self.buf);
3535
let bytes: &'static [u8] = unsafe { cast::transmute(bytes) };
3636
// Recreating the BytesReader state every call since

branches/snap-stage3/src/librustc/back/link.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use std::c_str::ToCStr;
2626
use std::char;
2727
use std::hash::Streaming;
2828
use std::hash;
29+
use std::io;
2930
use std::libc::{c_int, c_uint};
3031
use std::os::consts::{macos, freebsd, linux, android, win32};
3132
use std::os;
@@ -858,6 +859,10 @@ pub fn link_binary(sess: Session,
858859
debug!("output: %s", output.to_str());
859860
let cc_args = link_args(sess, obj_filename, out_filename, lm);
860861
debug!("%s link args: %s", cc_prog, cc_args.connect(" "));
862+
if (sess.opts.debugging_opts & session::print_link_args) != 0 {
863+
io::println(fmt!("%s link args: %s", cc_prog, cc_args.connect(" ")));
864+
}
865+
861866
// We run 'cc' here
862867
let prog = run::process_output(cc_prog, cc_args);
863868
if 0 != prog.status {

0 commit comments

Comments
 (0)