提交 931758c8 编写于 作者: N Niko Matsakis

FIXME(#19481) -- workaround valgrind cleanup failure (but the code is nicer this way anyhow)

上级 594e21f1
......@@ -965,7 +965,7 @@ pub fn trans_external_path<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
pub fn invoke<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
llfn: ValueRef,
llargs: Vec<ValueRef> ,
llargs: &[ValueRef],
fn_ty: Ty<'tcx>,
call_info: Option<NodeInfo>,
// FIXME(15064) is_lang_item is a horrible hack, please remove it
......
......@@ -808,7 +808,7 @@ pub fn trans_call_inner<'a, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// Invoke the actual rust fn and update bcx/llresult.
let (llret, b) = base::invoke(bcx,
llfn,
llargs,
llargs[],
callee_ty,
call_info,
dest.is_none());
......
......@@ -291,7 +291,7 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
let dtor_ty = ty::mk_ctor_fn(bcx.tcx(),
&[get_drop_glue_type(bcx.ccx(), t)],
ty::mk_nil(bcx.tcx()));
let (_, variant_cx) = invoke(variant_cx, dtor_addr, args, dtor_ty, None, false);
let (_, variant_cx) = invoke(variant_cx, dtor_addr, args[], dtor_ty, None, false);
variant_cx.fcx.pop_and_trans_custom_cleanup_scope(variant_cx, field_scope);
variant_cx
......
......@@ -13,18 +13,24 @@
trait Foo for Sized? {}
impl Foo for str {}
fn test<Sized? T: Foo>(t: &T) {
fn test1<Sized? T: Foo>(t: &T) {
let u: &Foo = t;
//~^ ERROR `core::kinds::Sized` is not implemented for the type `T`
}
fn test2<Sized? T: Foo>(t: &T) {
let v: &Foo = t as &Foo;
//~^ ERROR `core::kinds::Sized` is not implemented for the type `T`
}
fn main() {
fn test3() {
let _: &[&Foo] = &["hi"];
//~^ ERROR `core::kinds::Sized` is not implemented for the type `str`
}
fn test4() {
let _: &Foo = "hi" as &Foo;
//~^ ERROR `core::kinds::Sized` is not implemented for the type `str`
}
fn main() { }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册