Skip to content

Commit

Permalink
auto merge of #16484 : dotdash/rust/empty_struct_wrapper_arg, r=luqmana
Browse files Browse the repository at this point in the history
Fixes #16441.
  • Loading branch information
bors committed Aug 14, 2014
2 parents e99eeb5 + 4df0430 commit 56b86aa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc/middle/trans/foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,12 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: &CrateContext,
let llforeign_arg_ty = *tys.fn_ty.arg_tys.get(i);
let foreign_indirect = llforeign_arg_ty.is_indirect();

if llforeign_arg_ty.is_ignore() {
debug!("skipping ignored arg #{}", i);
llrust_args.push(C_undef(llrust_ty));
continue;
}

// skip padding
let foreign_index = next_foreign_arg(llforeign_arg_ty.pad.is_some());
let mut llforeign_arg = get_param(llwrapfn, foreign_index);
Expand Down
17 changes: 17 additions & 0 deletions src/test/run-pass/issue-16441.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2014 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.

struct Empty;

// This used to cause an ICE
extern "C" fn ice(_a: Empty) {}

fn main() {
}

0 comments on commit 56b86aa

Please sign in to comment.