Skip to content

Type mismatch compilation error on rustc 1.90.0-nightly #553

Open
@wenxuanjun

Description

@wenxuanjun

In this rustc version (0fa4ec6cd 2025-06-25), the compiler assumes that a function with signature extern "x86-interrupt" should not have a return type:

error: invalid signature for `extern "x86-interrupt"` function
   --> interrupts.rs:107:82
    |
107 | ...terruptStackFrame, error_code: u64) -> ! {
    |                                     ^
    |
    = note: functions with the "custom" ABI cannot have a return type
help: remove the return type
   --> interrupts.rs:107:82
    |
107 | ...terruptStackFrame, error_code: u64) -> ! {
    |

However, some handlers requires a DivergingHandlerFunc or DivergingHandlerFuncWithErrCode to be passed in, e.g.:

error[E0308]: mismatched types
   --> interrupts.rs:46:29
    |
46  |             .set_handler_fn(double_fault)
    |              -------------- ^^^^^^^^^^^^ expected fn pointer, found fn item
    |              |
    |              arguments to this method are incorrect
    |
    = note: expected fn pointer `extern "x86-interrupt" fn(x86_64::structures::idt::InterruptStackFrame, _) -> !`
                  found fn item `extern "x86-interrupt" fn(x86_64::structures::idt::InterruptStackFrame, _) -> () {arch::interrupts::double_fault}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions