Skip to content

Commit 3089687

Browse files
committed
Fix clippy single_match_else in call callee type handling
1 parent b63eb6f commit 3089687

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,12 +3284,14 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
32843284
} => (true, return_type, arguments),
32853285
// Newer rustc can represent direct call targets as `ptr<void>`,
32863286
// with the callee signature carried separately.
3287-
_ => match self.lookup_type(callee_ty) {
3288-
SpirvType::Function {
3287+
_ => {
3288+
if let SpirvType::Function {
32893289
return_type,
32903290
arguments,
3291-
} => (false, return_type, arguments),
3292-
_ => {
3291+
} = self.lookup_type(callee_ty)
3292+
{
3293+
(false, return_type, arguments)
3294+
} else {
32933295
let Some(fn_abi) = fn_abi else {
32943296
bug!(
32953297
"call expected `fn` pointer to point to function type, got `{}`",
@@ -3305,7 +3307,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
33053307
_ => bug!("call expected function ABI to lower to function type"),
33063308
}
33073309
}
3308-
},
3310+
}
33093311
};
33103312

33113313
let callee_val = if let SpirvValueKind::FnAddr { function } = callee.kind {

0 commit comments

Comments
 (0)