Handle fallout in librustc

This commit is contained in:
Kevin Ballard 2014-05-03 23:43:38 -07:00
parent cd3f31d9d1
commit a99eff3fca
5 changed files with 11 additions and 10 deletions

View File

@ -45,9 +45,9 @@ pub fn get_rpath_flags(sess: &Session, out_filename: &Path) -> Vec<~str> {
let libs = sess.cstore.get_used_crates(cstore::RequireDynamic);
let libs = libs.move_iter().filter_map(|(_, l)| {
l.map(|p| p.clone())
}).collect::<~[_]>();
}).collect::<Vec<_>>();
let rpaths = get_rpaths(os, sysroot, output, libs,
let rpaths = get_rpaths(os, sysroot, output, libs.as_slice(),
sess.opts.target_triple);
flags.push_all(rpaths_to_flags(rpaths.as_slice()).as_slice());
flags

View File

@ -434,7 +434,7 @@ pub fn monitor(f: proc():Send) {
}
pub fn main() {
std::os::set_exit_status(main_args(std::os::args()));
std::os::set_exit_status(main_args(std::os::args().as_slice()));
}
pub fn main_args(args: &[~str]) -> int {

View File

@ -226,7 +226,8 @@ fn get_extern_rust_fn(ccx: &CrateContext, inputs: &[ty::t], output: ty::t,
let f = decl_rust_fn(ccx, false, inputs, output, name);
csearch::get_item_attrs(&ccx.sess().cstore, did, |meta_items| {
set_llvm_fn_attrs(meta_items.iter().map(|&x| attr::mk_attr(x)).collect::<~[_]>(), f)
set_llvm_fn_attrs(meta_items.iter().map(|&x| attr::mk_attr(x))
.collect::<Vec<_>>().as_slice(), f)
});
ccx.externs.borrow_mut().insert(name.to_owned(), f);
@ -2114,7 +2115,7 @@ pub fn write_metadata(cx: &CrateContext, krate: &ast::Crate) -> Vec<u8> {
Some(compressed) => compressed,
None => cx.sess().fatal(format!("failed to compress metadata", ))
}.as_slice();
let llmeta = C_bytes(cx, compressed);
let llmeta = C_bytes(cx, compressed.as_slice());
let llconst = C_struct(cx, [llmeta], false);
let name = format!("rust_metadata_{}_{}_{}", cx.link_meta.crateid.name,
cx.link_meta.crateid.version_or_default(), cx.link_meta.crate_hash);

View File

@ -33,7 +33,7 @@ use middle::ty;
use util::ppaux::{Repr, ty_to_str};
use std::c_str::ToCStr;
use std::{slice, vec};
use std::vec;
use std::vec::Vec;
use libc::c_uint;
use syntax::{ast, ast_util};
@ -97,9 +97,9 @@ fn const_vec(cx: &CrateContext, e: &ast::Expr,
let (vs, inlineable) = vec::unzip(es.iter().map(|e| const_expr(cx, *e, is_local)));
// If the vector contains enums, an LLVM array won't work.
let v = if vs.iter().any(|vi| val_ty(*vi) != llunitty) {
C_struct(cx, vs, false)
C_struct(cx, vs.as_slice(), false)
} else {
C_array(llunitty, vs)
C_array(llunitty, vs.as_slice())
};
(v, llunitty, inlineable.iter().fold(true, |a, &b| a && b))
}
@ -554,7 +554,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
}
}
}));
(adt::trans_const(cx, &*repr, discr, cs),
(adt::trans_const(cx, &*repr, discr, cs.as_slice()),
inlineable.iter().fold(true, |a, &b| a && b))
})
}

View File

@ -162,7 +162,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
debug!("static default: changed substitution to {}",
substs.repr(ccx.tcx()));
ty::subst_tps(ccx.tcx(), substs, None, llitem_ty)
ty::subst_tps(ccx.tcx(), substs.as_slice(), None, llitem_ty)
}
};