diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index e87c058faf9c1..027f2dbc717b5 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -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, diff --git a/src/test/run-pass/issue-25581.rs b/src/test/run-pass/issue-25581.rs new file mode 100644 index 0000000000000..ac9ecbd44a49c --- /dev/null +++ b/src/test/run-pass/issue-25581.rs @@ -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 or the MIT license +// , 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]); + } +}