diff options
| author | bors <bors@rust-lang.org> | 2016-03-21 11:03:17 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-03-21 11:03:17 -0700 |
| commit | 0168dc7c5904701983c280cb4fa0fb0c0fa692c5 (patch) | |
| tree | 92bb563153f098d95b2d572ccf101e22e4d2eeb7 /src | |
| parent | 0215681744bb1156ef686ab265ed71e4d5705b64 (diff) | |
| parent | 4fd318b9e911dbaa63881b0a229f292bad1bdf9d (diff) | |
Auto merge of #32393 - dotdash:32389, r=eddyb
Fix tupling of fn args for rust-call ABI functions Fixes #32389
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_trans/trans/base.rs | 1 | ||||
| -rw-r--r-- | src/test/run-pass/issue-32389.rs | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 93ca306f0b0..1844c41760c 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -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]; diff --git a/src/test/run-pass/issue-32389.rs b/src/test/run-pass/issue-32389.rs new file mode 100644 index 00000000000..2f6cfb61205 --- /dev/null +++ b/src/test/run-pass/issue-32389.rs @@ -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; +} |
