@@ -34,7 +34,6 @@ use std::str;
34
34
use std:: io;
35
35
use std:: io:: Process ;
36
36
use std:: io:: fs;
37
- use std:: vec_ng:: Vec ;
38
37
use flate;
39
38
use serialize:: hex:: ToHex ;
40
39
use extra:: tempfile:: TempDir ;
@@ -107,7 +106,6 @@ pub mod write {
107
106
use std:: io:: Process ;
108
107
use std:: libc:: { c_uint, c_int} ;
109
108
use std:: str;
110
- use std:: vec_ng:: Vec ;
111
109
112
110
// On android, we by default compile for armv7 processors. This enables
113
111
// things like double word CAS instructions (rather than emulating them)
@@ -224,7 +222,7 @@ pub mod write {
224
222
225
223
if sess. lto ( ) {
226
224
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 ) ) ;
228
226
229
227
if sess. opts . cg . save_temps {
230
228
output. with_extension ( "lto.bc" ) . with_c_str ( |buf| {
@@ -365,8 +363,8 @@ pub mod write {
365
363
let vectorize_slp = !sess. opts . cg . no_vectorize_slp &&
366
364
sess. opts . optimize == session:: Aggressive ;
367
365
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 = ~ [ ] ;
370
368
{
371
369
let add = |arg : & str | {
372
370
let s = arg. to_c_str ( ) ;
@@ -783,8 +781,8 @@ fn remove(sess: Session, path: &Path) {
783
781
pub fn link_binary ( sess : Session ,
784
782
trans : & CrateTranslation ,
785
783
outputs : & OutputFilenames ,
786
- id : & CrateId ) -> Vec < Path > {
787
- let mut out_filenames = Vec :: new ( ) ;
784
+ id : & CrateId ) -> ~ [ Path ] {
785
+ let mut out_filenames = ~ [ ] ;
788
786
let crate_types = sess. crate_types . borrow ( ) ;
789
787
for & crate_type in crate_types. get ( ) . iter ( ) {
790
788
let out_file = link_binary_output ( sess, trans, crate_type, outputs, id) ;
@@ -933,8 +931,7 @@ fn link_rlib(sess: Session,
933
931
// the same filename for metadata (stomping over one another)
934
932
let tmpdir = TempDir :: new ( "rustc" ) . expect ( "needs a temp dir" ) ;
935
933
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 ) {
938
935
Ok ( ..) => { }
939
936
Err ( e) => {
940
937
sess. err ( format ! ( "failed to write {}: {}" ,
@@ -1038,7 +1035,7 @@ fn link_natively(sess: Session, dylib: bool, obj_filename: &Path,
1038
1035
// Invoke the system linker
1039
1036
debug ! ( "{} {}" , cc_prog, cc_args. connect( " " ) ) ;
1040
1037
let prog = time ( sess. time_passes ( ) , "running linker" , ( ) , |( ) |
1041
- Process :: output ( cc_prog, cc_args. as_slice ( ) ) ) ;
1038
+ Process :: output ( cc_prog, cc_args) ) ;
1042
1039
match prog {
1043
1040
Ok ( prog) => {
1044
1041
if !prog. status . success ( ) {
@@ -1074,15 +1071,15 @@ fn link_args(sess: Session,
1074
1071
dylib : bool ,
1075
1072
tmpdir : & Path ,
1076
1073
obj_filename : & Path ,
1077
- out_filename : & Path ) -> Vec < ~ str > {
1074
+ out_filename : & Path ) -> ~ [ ~ str ] {
1078
1075
1079
1076
// The default library location, we need this to find the runtime.
1080
1077
// The location of crates will be determined as needed.
1081
1078
// FIXME (#9639): This needs to handle non-utf8 paths
1082
1079
let lib_path = sess. filesearch . get_target_lib_path ( ) ;
1083
1080
let stage: ~str = ~"-L " + lib_path. as_str ( ) . unwrap ( ) ;
1084
1081
1085
- let mut args = vec ! ( stage) ;
1082
+ let mut args = ~ [ stage] ;
1086
1083
1087
1084
// FIXME (#9639): This needs to handle non-utf8 paths
1088
1085
args. push_all ( [
@@ -1201,7 +1198,7 @@ fn link_args(sess: Session,
1201
1198
// where extern libraries might live, based on the
1202
1199
// addl_lib_search_paths
1203
1200
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) ) ;
1205
1202
}
1206
1203
1207
1204
// Stack growth requires statically linking a __morestack function
@@ -1213,7 +1210,7 @@ fn link_args(sess: Session,
1213
1210
1214
1211
// Finally add all the linker arguments provided on the command line along
1215
1212
// 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 ) ;
1217
1214
let used_link_args = sess. cstore . get_used_link_args ( ) ;
1218
1215
let used_link_args = used_link_args. borrow ( ) ;
1219
1216
for arg in used_link_args. get ( ) . iter ( ) {
@@ -1233,7 +1230,7 @@ fn link_args(sess: Session,
1233
1230
// Also note that the native libraries linked here are only the ones located
1234
1231
// in the current crate. Upstream crates with native library dependencies
1235
1232
// 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 ) {
1237
1234
let addl_lib_search_paths = sess. opts . addl_lib_search_paths . borrow ( ) ;
1238
1235
for path in addl_lib_search_paths. get ( ) . iter ( ) {
1239
1236
// FIXME (#9639): This needs to handle non-utf8 paths
@@ -1266,7 +1263,7 @@ fn add_local_native_libraries(args: &mut Vec<~str> , sess: Session) {
1266
1263
// Rust crates are not considered at all when creating an rlib output. All
1267
1264
// dependencies will be linked when producing the final output (instead of
1268
1265
// 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 ,
1270
1267
dylib : bool , tmpdir : & Path ) {
1271
1268
1272
1269
// 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,
1350
1347
// returning `None` if not all libraries could be found with that
1351
1348
// preference.
1352
1349
fn get_deps ( cstore : & cstore:: CStore , preference : cstore:: LinkagePreference )
1353
- -> Option < Vec < ( ast:: CrateNum , Path ) > >
1350
+ -> Option < ~ [ ( ast:: CrateNum , Path ) ] >
1354
1351
{
1355
1352
let crates = cstore. get_used_crates ( preference) ;
1356
1353
if crates. iter ( ) . all ( |& ( _, ref p) | p. is_some ( ) ) {
@@ -1361,8 +1358,8 @@ fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
1361
1358
}
1362
1359
1363
1360
// 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 ) ] ) {
1366
1363
for ( cnum, cratepath) in crates. move_iter ( ) {
1367
1364
// When performing LTO on an executable output, all of the
1368
1365
// bytecode from the upstream libraries has already been
@@ -1408,8 +1405,8 @@ fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
1408
1405
}
1409
1406
1410
1407
// 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 ) ] ) {
1413
1410
// If we're performing LTO, then it should have been previously required
1414
1411
// that all upstream rust dependencies were available in an rlib format.
1415
1412
assert ! ( !sess. lto( ) ) ;
@@ -1443,7 +1440,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str> , sess: Session,
1443
1440
// generic function calls a native function, then the generic function must
1444
1441
// be instantiated in the target crate, meaning that the native symbol must
1445
1442
// 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 ) {
1447
1444
let cstore = sess. cstore ;
1448
1445
cstore. iter_crate_data ( |cnum, _| {
1449
1446
let libs = csearch:: get_native_libraries ( cstore, cnum) ;
0 commit comments