Skip to content

"match arms have incompatible types" hint incorrect #63136

Closed
@bjorn3

Description

@bjorn3

this and all prior arms are found to be of type !

Only some of the prior arms are of type !, the rest is of type FloatCC.

error[E0308]: match arms have incompatible types
  --> src/llvm_intrinsics.rs:77:33
   |
60 |  /                     match scalar.assert_bits(Size::from_bytes(1)) {
61 |  |                         0 => FloatCC::Equal,
62 |  |                         1 => FloatCC::LessThan,
63 |  |                         2 => FloatCC::LessThanOrEqual,
...   |
74 |  |                         6 => {
   |  |______________________________-
75 | ||                             unimplemented!("not less than or equal");
76 | ||                         }
   | ||_________________________- this and all prior arms are found to be of type `!`
77 |  |                         kind => unreachable!("kind {:?}", kind),
   |  |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `cranelift_codegen::ir::condcodes::FloatCC`, found ()
78 |  |                     }
   |  |_____________________- `match` arms have incompatible types
   |
   = note: expected type `cranelift_codegen::ir::condcodes::FloatCC`
              found type `()`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions