auto merge of #16484 : dotdash/rust/empty_struct_wrapper_arg, r=luqmana
Fixes #16441.
This commit is contained in:
commit
56b86aaf35
@ -741,6 +741,12 @@ unsafe fn build_wrap_fn(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);
|
||||
|
17
src/test/run-pass/issue-16441.rs
Normal file
17
src/test/run-pass/issue-16441.rs
Normal file
@ -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() {
|
||||
}
|
Loading…
Reference in New Issue
Block a user