Skip to content

Commit 5791348

Browse files
committed
---
yaml --- r: 108898 b: refs/heads/dist-snap c: 438893b h: refs/heads/master v: v3
1 parent e77f0f5 commit 5791348

File tree

136 files changed

+1580
-2481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1580
-2481
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: e1681df89221a0460ef2e30a69e5df9809e2a8e1
9+
refs/heads/dist-snap: 438893b36fe241b37eb76250f7c38ac8832f5706
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/back/archive.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use metadata::filesearch;
1616
use lib::llvm::{ArchiveRef, llvm};
1717

1818
use std::cast;
19-
use std::vec_ng::Vec;
2019
use std::io::fs;
2120
use std::io;
2221
use std::libc;
@@ -42,7 +41,7 @@ fn run_ar(sess: Session, args: &str, cwd: Option<&Path>,
4241
paths: &[&Path]) -> ProcessOutput {
4342
let ar = get_ar_prog(sess);
4443

45-
let mut args = vec!(args.to_owned());
44+
let mut args = ~[args.to_owned()];
4645
let mut paths = paths.iter().map(|p| p.as_str().unwrap().to_owned());
4746
args.extend(&mut paths);
4847
debug!("{} {}", ar, args.connect(" "));
@@ -90,25 +89,17 @@ impl Archive {
9089
}
9190

9291
/// Read a file in the archive
93-
pub fn read(&self, file: &str) -> Vec<u8> {
92+
pub fn read(&self, file: &str) -> ~[u8] {
9493
// Apparently if "ar p" is used on windows, it generates a corrupt file
9594
// which has bad headers and LLVM will immediately choke on it
9695
if cfg!(windows) && cfg!(windows) { // FIXME(#10734) double-and
9796
let loc = TempDir::new("rsar").unwrap();
9897
let archive = os::make_absolute(&self.dst);
9998
run_ar(self.sess, "x", Some(loc.path()), [&archive,
10099
&Path::new(file)]);
101-
let result: Vec<u8> =
102-
fs::File::open(&loc.path().join(file)).read_to_end()
103-
.unwrap()
104-
.move_iter()
105-
.collect();
106-
result
100+
fs::File::open(&loc.path().join(file)).read_to_end().unwrap()
107101
} else {
108-
run_ar(self.sess,
109-
"p",
110-
None,
111-
[&self.dst, &Path::new(file)]).output.move_iter().collect()
102+
run_ar(self.sess, "p", None, [&self.dst, &Path::new(file)]).output
112103
}
113104
}
114105

@@ -128,11 +119,11 @@ impl Archive {
128119
lto: bool) -> io::IoResult<()> {
129120
let object = format!("{}.o", name);
130121
let bytecode = format!("{}.bc", name);
131-
let mut ignore = vec!(METADATA_FILENAME, bytecode.as_slice());
122+
let mut ignore = ~[METADATA_FILENAME, bytecode.as_slice()];
132123
if lto {
133124
ignore.push(object.as_slice());
134125
}
135-
self.add_archive(rlib, name, ignore.as_slice())
126+
self.add_archive(rlib, name, ignore)
136127
}
137128

138129
/// Adds an arbitrary file to this archive
@@ -152,7 +143,7 @@ impl Archive {
152143
}
153144

154145
/// Lists all files in an archive
155-
pub fn files(&self) -> Vec<~str> {
146+
pub fn files(&self) -> ~[~str] {
156147
let output = run_ar(self.sess, "t", None, [&self.dst]);
157148
let output = str::from_utf8(output.output).unwrap();
158149
// use lines_any because windows delimits output with `\r\n` instead of
@@ -177,7 +168,7 @@ impl Archive {
177168
// all SYMDEF files as these are just magical placeholders which get
178169
// re-created when we make a new archive anyway.
179170
let files = try!(fs::readdir(loc.path()));
180-
let mut inputs = Vec::new();
171+
let mut inputs = ~[];
181172
for file in files.iter() {
182173
let filename = file.filename_str().unwrap();
183174
if skip.iter().any(|s| *s == filename) { continue }
@@ -191,7 +182,7 @@ impl Archive {
191182
if inputs.len() == 0 { return Ok(()) }
192183

193184
// Finally, add all the renamed files to this archive
194-
let mut args = vec!(&self.dst);
185+
let mut args = ~[&self.dst];
195186
args.extend(&mut inputs.iter());
196187
run_ar(self.sess, "r", None, args.as_slice());
197188
Ok(())

branches/dist-snap/src/librustc/back/arm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use syntax::abi;
1515

1616
pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
1717
let cc_args = if target_triple.contains("thumb") {
18-
vec!(~"-mthumb")
18+
~[~"-mthumb"]
1919
} else {
20-
vec!(~"-marm")
20+
~[~"-marm"]
2121
};
2222
return target_strs::t {
2323
module_asm: ~"",

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

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use std::str;
3434
use std::io;
3535
use std::io::Process;
3636
use std::io::fs;
37-
use std::vec_ng::Vec;
3837
use flate;
3938
use serialize::hex::ToHex;
4039
use extra::tempfile::TempDir;
@@ -107,7 +106,6 @@ pub mod write {
107106
use std::io::Process;
108107
use std::libc::{c_uint, c_int};
109108
use std::str;
110-
use std::vec_ng::Vec;
111109

112110
// On android, we by default compile for armv7 processors. This enables
113111
// things like double word CAS instructions (rather than emulating them)
@@ -224,7 +222,7 @@ pub mod write {
224222

225223
if sess.lto() {
226224
time(sess.time_passes(), "all lto passes", (), |()|
227-
lto::run(sess, llmod, tm, trans.reachable.as_slice()));
225+
lto::run(sess, llmod, tm, trans.reachable));
228226

229227
if sess.opts.cg.save_temps {
230228
output.with_extension("lto.bc").with_c_str(|buf| {
@@ -365,8 +363,8 @@ pub mod write {
365363
let vectorize_slp = !sess.opts.cg.no_vectorize_slp &&
366364
sess.opts.optimize == session::Aggressive;
367365

368-
let mut llvm_c_strs = Vec::new();
369-
let mut llvm_args = Vec::new();
366+
let mut llvm_c_strs = ~[];
367+
let mut llvm_args = ~[];
370368
{
371369
let add = |arg: &str| {
372370
let s = arg.to_c_str();
@@ -783,8 +781,8 @@ fn remove(sess: Session, path: &Path) {
783781
pub fn link_binary(sess: Session,
784782
trans: &CrateTranslation,
785783
outputs: &OutputFilenames,
786-
id: &CrateId) -> Vec<Path> {
787-
let mut out_filenames = Vec::new();
784+
id: &CrateId) -> ~[Path] {
785+
let mut out_filenames = ~[];
788786
let crate_types = sess.crate_types.borrow();
789787
for &crate_type in crate_types.get().iter() {
790788
let out_file = link_binary_output(sess, trans, crate_type, outputs, id);
@@ -933,8 +931,7 @@ fn link_rlib(sess: Session,
933931
// the same filename for metadata (stomping over one another)
934932
let tmpdir = TempDir::new("rustc").expect("needs a temp dir");
935933
let metadata = tmpdir.path().join(METADATA_FILENAME);
936-
match fs::File::create(&metadata).write(trans.metadata
937-
.as_slice()) {
934+
match fs::File::create(&metadata).write(trans.metadata) {
938935
Ok(..) => {}
939936
Err(e) => {
940937
sess.err(format!("failed to write {}: {}",
@@ -1038,7 +1035,7 @@ fn link_natively(sess: Session, dylib: bool, obj_filename: &Path,
10381035
// Invoke the system linker
10391036
debug!("{} {}", cc_prog, cc_args.connect(" "));
10401037
let prog = time(sess.time_passes(), "running linker", (), |()|
1041-
Process::output(cc_prog, cc_args.as_slice()));
1038+
Process::output(cc_prog, cc_args));
10421039
match prog {
10431040
Ok(prog) => {
10441041
if !prog.status.success() {
@@ -1074,15 +1071,15 @@ fn link_args(sess: Session,
10741071
dylib: bool,
10751072
tmpdir: &Path,
10761073
obj_filename: &Path,
1077-
out_filename: &Path) -> Vec<~str> {
1074+
out_filename: &Path) -> ~[~str] {
10781075

10791076
// The default library location, we need this to find the runtime.
10801077
// The location of crates will be determined as needed.
10811078
// FIXME (#9639): This needs to handle non-utf8 paths
10821079
let lib_path = sess.filesearch.get_target_lib_path();
10831080
let stage: ~str = ~"-L" + lib_path.as_str().unwrap();
10841081

1085-
let mut args = vec!(stage);
1082+
let mut args = ~[stage];
10861083

10871084
// FIXME (#9639): This needs to handle non-utf8 paths
10881085
args.push_all([
@@ -1201,7 +1198,7 @@ fn link_args(sess: Session,
12011198
// where extern libraries might live, based on the
12021199
// addl_lib_search_paths
12031200
if !sess.opts.cg.no_rpath {
1204-
args.push_all(rpath::get_rpath_flags(sess, out_filename).as_slice());
1201+
args.push_all(rpath::get_rpath_flags(sess, out_filename));
12051202
}
12061203

12071204
// Stack growth requires statically linking a __morestack function
@@ -1213,7 +1210,7 @@ fn link_args(sess: Session,
12131210

12141211
// Finally add all the linker arguments provided on the command line along
12151212
// with any #[link_args] attributes found inside the crate
1216-
args.push_all(sess.opts.cg.link_args.as_slice());
1213+
args.push_all(sess.opts.cg.link_args);
12171214
let used_link_args = sess.cstore.get_used_link_args();
12181215
let used_link_args = used_link_args.borrow();
12191216
for arg in used_link_args.get().iter() {
@@ -1233,7 +1230,7 @@ fn link_args(sess: Session,
12331230
// Also note that the native libraries linked here are only the ones located
12341231
// in the current crate. Upstream crates with native library dependencies
12351232
// may have their native library pulled in above.
1236-
fn add_local_native_libraries(args: &mut Vec<~str> , sess: Session) {
1233+
fn add_local_native_libraries(args: &mut ~[~str], sess: Session) {
12371234
let addl_lib_search_paths = sess.opts.addl_lib_search_paths.borrow();
12381235
for path in addl_lib_search_paths.get().iter() {
12391236
// FIXME (#9639): This needs to handle non-utf8 paths
@@ -1266,7 +1263,7 @@ fn add_local_native_libraries(args: &mut Vec<~str> , sess: Session) {
12661263
// Rust crates are not considered at all when creating an rlib output. All
12671264
// dependencies will be linked when producing the final output (instead of
12681265
// the intermediate rlib version)
1269-
fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
1266+
fn add_upstream_rust_crates(args: &mut ~[~str], sess: Session,
12701267
dylib: bool, tmpdir: &Path) {
12711268

12721269
// As a limitation of the current implementation, we require that everything
@@ -1350,7 +1347,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
13501347
// returning `None` if not all libraries could be found with that
13511348
// preference.
13521349
fn get_deps(cstore: &cstore::CStore, preference: cstore::LinkagePreference)
1353-
-> Option<Vec<(ast::CrateNum, Path)> >
1350+
-> Option<~[(ast::CrateNum, Path)]>
13541351
{
13551352
let crates = cstore.get_used_crates(preference);
13561353
if crates.iter().all(|&(_, ref p)| p.is_some()) {
@@ -1361,8 +1358,8 @@ fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
13611358
}
13621359

13631360
// Adds the static "rlib" versions of all crates to the command line.
1364-
fn add_static_crates(args: &mut Vec<~str> , sess: Session, tmpdir: &Path,
1365-
crates: Vec<(ast::CrateNum, Path)> ) {
1361+
fn add_static_crates(args: &mut ~[~str], sess: Session, tmpdir: &Path,
1362+
crates: ~[(ast::CrateNum, Path)]) {
13661363
for (cnum, cratepath) in crates.move_iter() {
13671364
// When performing LTO on an executable output, all of the
13681365
// bytecode from the upstream libraries has already been
@@ -1408,8 +1405,8 @@ fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
14081405
}
14091406

14101407
// Same thing as above, but for dynamic crates instead of static crates.
1411-
fn add_dynamic_crates(args: &mut Vec<~str> , sess: Session,
1412-
crates: Vec<(ast::CrateNum, Path)> ) {
1408+
fn add_dynamic_crates(args: &mut ~[~str], sess: Session,
1409+
crates: ~[(ast::CrateNum, Path)]) {
14131410
// If we're performing LTO, then it should have been previously required
14141411
// that all upstream rust dependencies were available in an rlib format.
14151412
assert!(!sess.lto());
@@ -1443,7 +1440,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
14431440
// generic function calls a native function, then the generic function must
14441441
// be instantiated in the target crate, meaning that the native symbol must
14451442
// also be resolved in the target crate.
1446-
fn add_upstream_native_libraries(args: &mut Vec<~str> , sess: Session) {
1443+
fn add_upstream_native_libraries(args: &mut ~[~str], sess: Session) {
14471444
let cstore = sess.cstore;
14481445
cstore.iter_crate_data(|cnum, _| {
14491446
let libs = csearch::get_native_libraries(cstore, cnum);

branches/dist-snap/src/librustc/back/mips.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use back::target_strs;
1212
use driver::session::sess_os_to_meta_os;
1313
use metadata::loader::meta_section_name;
14-
use std::vec_ng::Vec;
1514
use syntax::abi;
1615

1716
pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::t {
@@ -64,6 +63,6 @@ pub fn get_target_strs(target_triple: ~str, target_os: abi::Os) -> target_strs::
6463

6564
target_triple: target_triple,
6665

67-
cc_args: Vec::new(),
66+
cc_args: ~[],
6867
};
6968
}

0 commit comments

Comments
 (0)