Skip to content

Commit e71571a

Browse files
committed
Use as_slice() method on option
1 parent 419ac4a commit e71571a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc/middle/trans/foreign.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,20 +282,20 @@ pub fn trans_native_call<'a>(
282282
// FIXME(#8357) We really ought to report a span here
283283
ccx.sess.fatal(
284284
format!("ABI string `{}` has no suitable ABI \
285-
for target architecture",
286-
fn_abis.user_string(ccx.tcx)));
285+
for target architecture",
286+
fn_abis.user_string(ccx.tcx)));
287287
}
288288
};
289289

290290
// A function pointer is called without the declaration available, so we have to apply
291291
// any attributes with ABI implications directly to the call instruction. Right now, the
292292
// only attribute we need to worry about is `sret`.
293-
let sret_attr = [(1, StructRetAttribute)];
294-
let attrs = if fn_type.ret_ty.is_indirect() {
295-
sret_attr.as_slice()
293+
let sret_attr = if fn_type.ret_ty.is_indirect() {
294+
Some((1, StructRetAttribute))
296295
} else {
297-
&[]
296+
None
298297
};
298+
let attrs = sret_attr.as_slice();
299299
let llforeign_retval = CallWithConv(bcx, llfn, llargs_foreign, cc, attrs);
300300

301301
// If the function we just called does not use an outpointer,

0 commit comments

Comments
 (0)