Auto merge of #32393 - dotdash:32389, r=eddyb

Fix tupling of fn args for rust-call ABI functions

Fixes #32389
This commit is contained in:
bors 2016-03-21 11:03:17 -07:00
commit 0168dc7c59
2 changed files with 21 additions and 0 deletions

View File

@ -1685,6 +1685,7 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> {
for (j, &tupled_arg_ty) in tupled_arg_tys.iter().enumerate() {
let dst = StructGEP(bcx, llval, j);
let arg = &self.fn_ty.args[idx];
idx += 1;
let b = &bcx.build();
if common::type_is_fat_ptr(bcx.tcx(), tupled_arg_ty) {
let meta = &self.fn_ty.args[idx];

View File

@ -0,0 +1,20 @@
// 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.
fn foo<T>() -> T { loop {} }
fn test() {
let ref mut a: &mut FnMut((i8,), i16) = foo();
a((0,), 0);
}
fn main() {
let _ = test;
}