stalwartlabs / mail-parser

Fast and robust e-mail parsing library for Rust
https://docs.rs/mail-parser/
Apache License 2.0
289 stars 39 forks source link

`cargo check` fails on `master` #60

Closed cpiemontese closed 1 year ago

cpiemontese commented 1 year ago

Hello!

Since the latest update cargo check (and cargo clippy) seem to fail with the following error

❯ cargo check
    Checking mail-parser v0.9.0 (/home/cristianopiemontese/github/cpiemontese/mail-parser)
error[E0369]: binary operation `==` cannot be applied to type `HashMap<HeaderName<'_>, for<'a, 'x> fn(&'a mut MessageStream<'x>) -> HeaderValue<'x>>`
   --> src/lib.rs:264:5
    |
262 | #[derive(Debug, PartialEq, Eq, Clone)]
    |                 --------- in this derive macro expansion
263 | pub struct MessageParser {
264 |     pub(crate) header_map: HashMap<HeaderName<'static>, HdrParseFnc>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `for<'a, 'x> fn(&'a mut MessageStream<'x>) -> HeaderValue<'x>`
   --> src/lib.rs:265:5
    |
262 | #[derive(Debug, PartialEq, Eq, Clone)]
    |                 --------- in this derive macro expansion
...
265 |     pub(crate) def_hdr_parse_fnc: HdrParseFnc,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: use parentheses to call these
    |
265 |     ((pub(crate) def_hdr_parse_fnc: HdrParseFnc)(/* &mut MessageStream<'_> */))(/* &mut MessageStream<'_> */),
    |     +                                          +++++++++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0369`.
error: could not compile `mail-parser` due to 2 previous errors

My cargo version is cargo 1.68.2 (6feb7c9cf 2023-03-26)

mdecimus commented 1 year ago

Hi,

Please try upgrading to the latest rust version. Mail-parser 0.9 is passing all checks and tests on both Github actions and my dev station.

cpiemontese commented 1 year ago

Thanks :pray: Can confirm that MSRV is now 1.70