Skip to content

matrix-sdk-crypto from crates.io fails to compile #5190

Closed
@VerdeQuar

Description

@VerdeQuar

Maintainer update

The issue has been identified as an accidental breaking change in a dependency. While we are looking into the best way foward, you can work around the issue by downgrading tracing-attributes:

cargo update -p tracing-attributes --precise 0.1.28

Original issue description

I was doing some work on a different project and everything was working fine, until i did cargo update, despite matrix_sdk being still in version 0.11.0 like it was before, it for some reason stopped compiling and gave me this error:

error[E0573]: expected type, found variant `CryptoStoreError`
    --> /home/verdek/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/matrix-sdk-crypto-0.11.0/src/identities/manager.rs:1182:21
     |
44   |     CryptoStoreError, LocalTrust, OwnUserIdentity, SignatureError, UserIdentity,
     |     ---------------- you might have meant to refer to this enum
...
1182 |     ) -> Result<(), CryptoStoreError> {
     |                     ^^^^^^^^^^^^^^^^ not a type

For more information about this error, try `rustc --explain E0573`.
error: could not compile `matrix-sdk-crypto` (lib) due to 1 previous error

i tested it on an empty project in which i just did cargo add matrix_sdk and it also doesn't compile
i'm on stable rust 1.87.0 but when i switched to 1.86.0 i got the same error
same thing with downgrading to matrix_sdk 0.10.0

seems very weird that that kind of error would go unnoticed for so long, so i have no idea if this is even reproducible, but i found that removing this wildcard import solves the issue
which seems even weirder cause i would assume that import would only work inside the scope of the function, but it somehow triggers an error in its signature
in any case, wildcard imports of enum variants are very error prone so it shouldn't even be there in the first place, should i make a pr?

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