Skip to content

Commit a99eff3

Browse files
committed
Handle fallout in librustc
1 parent cd3f31d commit a99eff3

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

src/librustc/back/rpath.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ pub fn get_rpath_flags(sess: &Session, out_filename: &Path) -> Vec<~str> {
4545
let libs = sess.cstore.get_used_crates(cstore::RequireDynamic);
4646
let libs = libs.move_iter().filter_map(|(_, l)| {
4747
l.map(|p| p.clone())
48-
}).collect::<~[_]>();
48+
}).collect::<Vec<_>>();
4949

50-
let rpaths = get_rpaths(os, sysroot, output, libs,
50+
let rpaths = get_rpaths(os, sysroot, output, libs.as_slice(),
5151
sess.opts.target_triple);
5252
flags.push_all(rpaths_to_flags(rpaths.as_slice()).as_slice());
5353
flags

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ pub fn monitor(f: proc():Send) {
434434
}
435435

436436
pub fn main() {
437-
std::os::set_exit_status(main_args(std::os::args()));
437+
std::os::set_exit_status(main_args(std::os::args().as_slice()));
438438
}
439439

440440
pub fn main_args(args: &[~str]) -> int {

src/librustc/middle/trans/base.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ fn get_extern_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t,
226226

227227
let f = decl_rust_fn(ccx, false, inputs, output, name);
228228
csearch::get_item_attrs(&ccx.sess().cstore, did, |meta_items| {
229-
set_llvm_fn_attrs(meta_items.iter().map(|&x| attr::mk_attr(x)).collect::<~[_]>(), f)
229+
set_llvm_fn_attrs(meta_items.iter().map(|&x| attr::mk_attr(x))
230+
.collect::<Vec<_>>().as_slice(), f)
230231
});
231232

232233
ccx.externs.borrow_mut().insert(name.to_owned(), f);
@@ -2114,7 +2115,7 @@ pub fn write_metadata(cx: &CrateContext, krate: &ast::Crate) -> Vec<u8> {
21142115
Some(compressed) => compressed,
21152116
None => cx.sess().fatal(format!("failed to compress metadata", ))
21162117
}.as_slice();
2117-
let llmeta = C_bytes(cx, compressed);
2118+
let llmeta = C_bytes(cx, compressed.as_slice());
21182119
let llconst = C_struct(cx, [llmeta], false);
21192120
let name = format!("rust_metadata_{}_{}_{}", cx.link_meta.crateid.name,
21202121
cx.link_meta.crateid.version_or_default(), cx.link_meta.crate_hash);

src/librustc/middle/trans/consts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use middle::ty;
3333
use util::ppaux::{Repr, ty_to_str};
3434

3535
use std::c_str::ToCStr;
36-
use std::{slice, vec};
36+
use std::vec;
3737
use std::vec::Vec;
3838
use libc::c_uint;
3939
use syntax::{ast, ast_util};
@@ -97,9 +97,9 @@ fn const_vec(cx: &CrateContext, e: &ast::Expr,
9797
let (vs, inlineable) = vec::unzip(es.iter().map(|e| const_expr(cx, *e, is_local)));
9898
// If the vector contains enums, an LLVM array won't work.
9999
let v = if vs.iter().any(|vi| val_ty(*vi) != llunitty) {
100-
C_struct(cx, vs, false)
100+
C_struct(cx, vs.as_slice(), false)
101101
} else {
102-
C_array(llunitty, vs)
102+
C_array(llunitty, vs.as_slice())
103103
};
104104
(v, llunitty, inlineable.iter().fold(true, |a, &b| a && b))
105105
}
@@ -554,7 +554,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
554554
}
555555
}
556556
}));
557-
(adt::trans_const(cx, &*repr, discr, cs),
557+
(adt::trans_const(cx, &*repr, discr, cs.as_slice()),
558558
inlineable.iter().fold(true, |a, &b| a && b))
559559
})
560560
}

src/librustc/middle/trans/monomorphize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
162162
debug!("static default: changed substitution to {}",
163163
substs.repr(ccx.tcx()));
164164

165-
ty::subst_tps(ccx.tcx(), substs, None, llitem_ty)
165+
ty::subst_tps(ccx.tcx(), substs.as_slice(), None, llitem_ty)
166166
}
167167
};
168168

0 commit comments

Comments
 (0)