From a99eff3fca670238bd7194dc83d8f4b968277dc6 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sat, 3 May 2014 23:43:38 -0700 Subject: [PATCH] Handle fallout in librustc --- src/librustc/back/rpath.rs | 4 ++-- src/librustc/lib.rs | 2 +- src/librustc/middle/trans/base.rs | 5 +++-- src/librustc/middle/trans/consts.rs | 8 ++++---- src/librustc/middle/trans/monomorphize.rs | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/librustc/back/rpath.rs b/src/librustc/back/rpath.rs index 8c0aa494d6f..c49adce904a 100644 --- a/src/librustc/back/rpath.rs +++ b/src/librustc/back/rpath.rs @@ -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::>(); - 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 diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index ab755b39f1a..0962acd0a2e 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -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 { diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index 3bef0eae0ac..8047de5e8f9 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -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::>().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 { 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); diff --git a/src/librustc/middle/trans/consts.rs b/src/librustc/middle/trans/consts.rs index 9c03fb27e39..548746362cf 100644 --- a/src/librustc/middle/trans/consts.rs +++ b/src/librustc/middle/trans/consts.rs @@ -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)) }) } diff --git a/src/librustc/middle/trans/monomorphize.rs b/src/librustc/middle/trans/monomorphize.rs index b8f50fcb1e5..9822cc388bb 100644 --- a/src/librustc/middle/trans/monomorphize.rs +++ b/src/librustc/middle/trans/monomorphize.rs @@ -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) } };