Skip to content

Commit 7bba23d

Browse files
committed
Fix build of rustc_codegen_cranelift
1 parent f7971f4 commit 7bba23d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

compiler/rustc_codegen_cranelift/src/abi/pass_mode.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ fn apply_attrs_to_abi_param(param: AbiParam, arg_attrs: ArgAttributes) -> AbiPar
4444

4545
fn cast_target_to_abi_params(cast: &CastTarget) -> SmallVec<[(Size, AbiParam); 2]> {
4646
if let Some(offset_from_start) = cast.rest_offset {
47-
assert!(cast.prefix[1..].iter().all(|p| p.is_none()));
47+
assert_eq!(cast.prefix.len(), 1);
4848
assert_eq!(cast.rest.unit.size, cast.rest.total);
49-
let first = cast.prefix[0].unwrap();
49+
let first = cast.prefix[0];
5050
let second = cast.rest.unit;
5151
return smallvec![
5252
(Size::ZERO, reg_to_abi_param(first)),
@@ -71,7 +71,6 @@ fn cast_target_to_abi_params(cast: &CastTarget) -> SmallVec<[(Size, AbiParam); 2
7171
let args = cast
7272
.prefix
7373
.iter()
74-
.flatten()
7574
.map(|&reg| reg_to_abi_param(reg))
7675
.chain((0..rest_count).map(|_| reg_to_abi_param(cast.rest.unit)));
7776

0 commit comments

Comments
 (0)