duesee / imap-next

Apache License 2.0
11 stars 3 forks source link

0.2.0 build fails when included in a project #276

Open djmaze opened 1 month ago

djmaze commented 1 month ago

When adding the v0.2.0 crate to a project, the build fails:

error[E0004]: non-exhaustive patterns: `Err(DecodeMessageError::MessagePoisoned { .. })` not covered
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imap-next-0.2.0/src/receive.rs:109:39
    |
109 | ...                   match self.fragmentizer.decode_message(codec) {
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Err(DecodeMessageError::MessagePoisoned { .. })` not covered
    |
note: `Result<<C as Decoder>::Message<'_>, DecodeMessageError<'_, C>>` defined here
   --> /build/rustc-1.77.2-src/library/core/src/result.rs:502:1
   ::: /build/rustc-1.77.2-src/library/core/src/result.rs:511:5
    |
    = note: not covered
    = note: the matched value is of type `Result<<C as Decoder>::Message<'_>, DecodeMessageError<'_, C>>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
133 ~                                     },
134 +                                     Err(DecodeMessageError::MessagePoisoned { .. }) => todo!()
    |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `imap-next` (lib) due to 1 previous error

This happens e.g. with the email-lib crate v0.25.0 for me.

Building the crate from this repository works though, even with the 0.2.0 commit checked out. (Btw, please use at least git tags in this repo.)

djmaze commented 1 month ago

Turns out I needed to downgrade imap-codec to 2.0.0-alpha.4 for it to work. Okay, I get this is all still quite in flux. (Also the sync feature does not currently compile.)

UPDATE: Needed to activate the pool feature for the sync feature to compile correctly.