Change:
The following successfully typechecks on , but generates an LLVM assertion failure: Error: Note that replacing with (and making mutable) allows compilation to succeed.
First occurs in nightly-2016-08-03 which turns on mir by default, does not occur on nightly-2016-08-03 with -Z orbit=off.
Using this was introduced between and ().
Problem seems to be that we call the with a fat pointer as 2 arguments, but it expects a pointer to a tuple.
I have a fix for this, running the full locally now to see if I broke anything else on the way.

Discussion:
sized_args = [v0]; &sized_args } else { <ins> // FIXME(#36457) -- we should pass unsized values to drop glue as two arguments </ins> unsized_args = [ Load(bcx, get_dataptr(bcx, v0)), Load(bcx, get_meta(bcx, v0))

} } <del> fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, g: DropGlueKind<'tcx>) </del> <ins> fn make_drop_glue<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, v0: ValueRef, g: DropGlueKind<'tcx>) </ins> -> Block<'blk, 'tcx> { let t = g.ty();

let llval = get_dataptr(bcx, v0); let llbox = Load(bcx, llval); let bcx = drop_ty(bcx, v0, content_ty, DebugLoc::None); <ins> // FIXME(#36457) -- we should pass unsized values to drop glue as two arguments </ins> let info = get_meta(bcx, v0); let info = Load(bcx, info); let (llsize, llalign) =

// No support in vtable for distinguishing destroying with // versus without calling Drop::drop. Assert caller is // okay with always calling the Drop impl, if any. <ins> // FIXME(#36457) -- we should pass unsized values to drop glue as two arguments </ins> assert!(!skip_dtor); let data_ptr = get_dataptr(bcx, v0); let vtable_ptr = Load(bcx, get_meta(bcx, v0));

let value = if type_is_sized(cx.tcx(), t) { adt::MaybeSizedValue::sized(av) } else { <ins> // FIXME(#36457) -- we should pass unsized values as two arguments </ins> let data = Load(cx, get_dataptr(cx, av)); let info = Load(cx, get_meta(cx, av)); adt::MaybeSizedValue::unsized_(data, info)

let val = if type_is_sized(cx.tcx(), field_ty) { llfld_a } else { <ins> // FIXME(#36457) -- we should pass unsized values as two arguments </ins> let scratch = alloc_ty(cx, field_ty, "__fat_ptr_iter"); Store(cx, llfld_a, get_dataptr(cx, scratch)); Store(cx, value.meta, get_meta(cx, scratch));

let ptr = if is_sized { llargs[0] } else { <ins> // FIXME(#36457) -- we should pass unsized values as two arguments </ins> let scratch = alloc_ty(bcx, tp_ty, "drop"); call_lifetime_start(bcx, scratch); Store(bcx, llargs[0], get_dataptr(bcx, scratch));

let lvalue = self.trans_lvalue(&bcx, location); let drop_fn = glue::get_drop_glue(bcx.ccx(), ty); let drop_ty = glue::get_drop_glue_type(bcx.tcx(), ty); <del> let llvalue = if drop_ty != ty { bcx.pointercast(lvalue.llval, type_of::type_of(bcx.ccx(), drop_ty).ptr_to()) </del> <ins> let is_sized = common::type_is_sized(bcx.tcx(), ty); let llvalue = if is_sized { if drop_ty != ty { bcx.pointercast(lvalue.llval, type_of::type_of(bcx.ccx(), drop_ty).ptr_to()) } else { lvalue.llval } </ins> } else { <del> lvalue.llval </del> <ins> // FIXME(#36457) Currently drop glue takes sized // values as a `*(data, meta)`, but elsewhere in // MIR we pass `(data, meta)` as two separate // arguments. It would be better to fix drop glue, // but I am shooting for a quick fix to #35546 // here that can be cleanly backported to beta, so // I want to avoid touching all of trans. bcx.with_block(|bcx| { let scratch = base::alloc_ty(bcx, ty, "drop"); base::call_lifetime_start(bcx, scratch); build::Store(bcx, lvalue.llval, base::get_dataptr(bcx, scratch)); build::Store(bcx, lvalue.llextra, base::get_meta(bcx, scratch)); scratch }) </ins> }; if let Some(unwind) = unwind { bcx.invoke(drop_fn,

<ins> // Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. // Regression test for #35546. Check that we are able to codegen // this. Before we had problems because of the drop glue signature // around dropping a trait object (specifically, when dropping the // `value` field of `Node<Send>`). struct Node<T: ?Sized + Send> { next: Option<Box<Node<Send>>>, value: T, } fn clear(head: &mut Option<Box<Node<Send>>>) { match head.take() { Some(node) => *head = node.next, None => (), } } fn main() {} </ins>