Use as_slice() method on option

This commit is contained in:
Niko Matsakis 2014-01-15 19:35:38 -05:00
parent 419ac4a1b8
commit e71571a3cd

View File

@ -290,12 +290,12 @@ pub fn trans_native_call<'a>(
// A function pointer is called without the declaration available, so we have to apply
// any attributes with ABI implications directly to the call instruction. Right now, the
// only attribute we need to worry about is `sret`.
let sret_attr = [(1, StructRetAttribute)];
let attrs = if fn_type.ret_ty.is_indirect() {
sret_attr.as_slice()
let sret_attr = if fn_type.ret_ty.is_indirect() {
Some((1, StructRetAttribute))
} else {
&[]
None
};
let attrs = sret_attr.as_slice();
let llforeign_retval = CallWithConv(bcx, llfn, llargs_foreign, cc, attrs);
// If the function we just called does not use an outpointer,