Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing Eq on struct EmailTrait in 0.2.6 was a API breaking change. #29

Closed
dpc opened this issue Jul 19, 2024 · 5 comments
Closed

Removing Eq on struct EmailTrait in 0.2.6 was a API breaking change. #29

dpc opened this issue Jul 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@dpc
Copy link

dpc commented Jul 19, 2024

Downstream deps are failing to build.

@raif-s-naffah
Copy link

+ 1.

same occurs when using EmailAddress as an unnamed field of a struct (i.e. to customize serde serialization/deserialization).

#[derive(Clone, Debug, Eq, Deserialize, PartialEq, Serialize)]
pub(crate) struct InnerEmailAddress(
    #[serde(serialize_with = "mbox_ser", deserialize_with = "mbox_des")] EmailAddress,
);

for completness sake, here's the compiler diagnostic message:

error[E0277]: the trait bound `EmailAddress: std::cmp::Eq` is not satisfied
   --> .../src/email_address.rs:16:74
    |
14  | #[derive(Clone, Debug, Eq, Deserialize, PartialEq, Serialize)]
    |                        -- in this derive macro expansion
15  | pub(crate) struct InnerEmailAddress(
16  |     #[serde(serialize_with = "mbox_ser", deserialize_with = "mbox_des")] EmailAddress,
    |                                                                          ^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `EmailAddress`
    |
note: required by a bound in `AssertParamIsEq`
   --> /opt/rust/rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:360:31
    |
360 | pub struct AssertParamIsEq<T: Eq + ?Sized> {
    |                               ^^ required by this bound in `AssertParamIsEq`
    = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)

@KisaragiEffective
Copy link

@RemiBardon
Copy link

RemiBardon commented Jul 25, 2024

+1

Why was it removed in the first place? (see the problematic diff in eadd524#r144641022)

@alexipeck
Copy link

alexipeck commented Jul 28, 2024

I'm dealing with problems from this also, why was it removed?

I use it within a HashMap (HashMap<EmailAddress, Uuid>)

error[E0277]: the trait bound `EmailAddress: std::cmp::Eq` is not satisfied
    --> src/auth_manager.rs:214:28
     |
214  |                 .collect::<HashMap<EmailAddress, Uuid>>(),
     |                  -------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `EmailAddress`, which is required by `HashMap<EmailAddress, Uuid>: FromIterator<(EmailAddress, Uuid)>`
     |                  |
     |                  required by a bound introduced by this call
     |
     = help: the trait `FromIterator<(K, V)>` is implemented for `HashMap<K, V, S>`
     = note: required for `HashMap<EmailAddress, Uuid>` to implement `FromIterator<(EmailAddress, Uuid)>`
note: required by a bound in `collect`
    --> /home/me/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:1999:19
     |
1999 |     fn collect<B: FromIterator<Self::Item>>(self) -> B
     |                   ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`

@johnstonskj
Copy link
Owner

Fixed in 0.2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants