Skip to content

Commit

Permalink
Fix ICE trying to pass DST to C functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dotdash committed May 20, 2015
1 parent cec980a commit 939cd94
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_trans/trans/callee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ pub fn trans_call_inner<'a, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,

let mut llargs = Vec::new();
let arg_tys = match args {
ArgExprs(a) => a.iter().map(|x| common::expr_ty(bcx, &**x)).collect(),
ArgExprs(a) => a.iter().map(|x| common::expr_ty_adjusted(bcx, &**x)).collect(),
_ => panic!("expected arg exprs.")
};
bcx = trans_args(bcx,
Expand Down
19 changes: 19 additions & 0 deletions src/test/run-pass/issue-25581.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2015 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.

extern {
fn f(t: &[i32]);
}

fn main() {
unsafe {
f(&[0i32]);
}
}

0 comments on commit 939cd94

Please sign in to comment.