Skip to content

Commit 931758c

Browse files
committed
FIXME(#19481) -- workaround valgrind cleanup failure (but the code is nicer this way anyhow)
1 parent 594e21f commit 931758c

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/librustc_trans/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ pub fn trans_external_path<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
965965

966966
pub fn invoke<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
967967
llfn: ValueRef,
968-
llargs: Vec<ValueRef> ,
968+
llargs: &[ValueRef],
969969
fn_ty: Ty<'tcx>,
970970
call_info: Option<NodeInfo>,
971971
// FIXME(15064) is_lang_item is a horrible hack, please remove it

src/librustc_trans/trans/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ pub fn trans_call_inner<'a, 'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
808808
// Invoke the actual rust fn and update bcx/llresult.
809809
let (llret, b) = base::invoke(bcx,
810810
llfn,
811-
llargs,
811+
llargs[],
812812
callee_ty,
813813
call_info,
814814
dest.is_none());

src/librustc_trans/trans/glue.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ fn trans_struct_drop<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
291291
let dtor_ty = ty::mk_ctor_fn(bcx.tcx(),
292292
&[get_drop_glue_type(bcx.ccx(), t)],
293293
ty::mk_nil(bcx.tcx()));
294-
let (_, variant_cx) = invoke(variant_cx, dtor_addr, args, dtor_ty, None, false);
294+
let (_, variant_cx) = invoke(variant_cx, dtor_addr, args[], dtor_ty, None, false);
295295

296296
variant_cx.fcx.pop_and_trans_custom_cleanup_scope(variant_cx, field_scope);
297297
variant_cx

src/test/compile-fail/dst-object-from-unsized-type.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,24 @@
1313
trait Foo for Sized? {}
1414
impl Foo for str {}
1515

16-
fn test<Sized? T: Foo>(t: &T) {
16+
fn test1<Sized? T: Foo>(t: &T) {
1717
let u: &Foo = t;
1818
//~^ ERROR `core::kinds::Sized` is not implemented for the type `T`
19+
}
1920

21+
fn test2<Sized? T: Foo>(t: &T) {
2022
let v: &Foo = t as &Foo;
2123
//~^ ERROR `core::kinds::Sized` is not implemented for the type `T`
2224
}
2325

24-
fn main() {
26+
fn test3() {
2527
let _: &[&Foo] = &["hi"];
2628
//~^ ERROR `core::kinds::Sized` is not implemented for the type `str`
29+
}
2730

31+
fn test4() {
2832
let _: &Foo = "hi" as &Foo;
2933
//~^ ERROR `core::kinds::Sized` is not implemented for the type `str`
3034
}
35+
36+
fn main() { }

0 commit comments

Comments
 (0)