Handle fallout in librustc
This commit is contained in:
parent
cd3f31d9d1
commit
a99eff3fca
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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))
|
||||
})
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user