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

Uuid-impl feature doesn't work #131

Closed
Toldoven opened this issue Nov 1, 2022 · 3 comments
Closed

Uuid-impl feature doesn't work #131

Toldoven opened this issue Nov 1, 2022 · 3 comments

Comments

@Toldoven
Copy link

Toldoven commented Nov 1, 2022

I copied the example and tried to run and test it, got this error:

   Compiling example v0.1.0 (/home/kpids/Files/Code/ts-rs-tes)
error[E0277]: the trait bound `Uuid: TS` is not satisfied
  --> src/lib.rs:29:21
   |
29 | #[derive(Serialize, TS)]
   |                     ^^ the trait `TS` is not implemented for `Uuid`
   |
   = help: the following other types implement trait `TS`:
             &'static str
             ()
             (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
             (T10,)
             (T2, T3, T4, T5, T6, T7, T8, T9, T10)
             (T3, T4, T5, T6, T7, T8, T9, T10)
             (T4, T5, T6, T7, T8, T9, T10)
             (T5, T6, T7, T8, T9, T10)
           and 51 others
   = note: this error originates in the derive macro `TS` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Uuid: TS` is not satisfied
   --> src/lib.rs:39:12
    |
39  |     token: Uuid,
    |            ^^^^ the trait `TS` is not implemented for `Uuid`
    |
    = help: the following other types implement trait `TS`:
              &'static str
              ()
              (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
              (T10,)
              (T2, T3, T4, T5, T6, T7, T8, T9, T10)
              (T3, T4, T5, T6, T7, T8, T9, T10)
              (T4, T5, T6, T7, T8, T9, T10)
              (T5, T6, T7, T8, T9, T10)
            and 51 others
note: required by a bound in `Dependency::from_ty`
   --> /home/kpids/.cargo/registry/src/github.com-1ecc6299db9ec823/ts-rs-6.2.0/src/lib.rs:311:23
    |
311 |     pub fn from_ty<T: TS>() -> Option<Self> {
    |                       ^^ required by this bound in `Dependency::from_ty`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `example` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `example` due to 2 previous errors

Tried updating Rust with rustup update, tried different versions of Uuid and ts-rs crates, tried cargo clean, tried running it on stable and nightly. Still have no idea what causes it.

@NyxCode
Copy link
Collaborator

NyxCode commented Nov 9, 2022

Hey, thanks for opening the issue. The problem is that ts-rs 6.2 only supports uuid 0.8, and not yet 1.*.
Right now, you can either use a git dependency on ts-rs, or wait a bit for the next release.

@timephy
Copy link
Contributor

timephy commented Apr 25, 2023

Hey, I am also interested in using ts-rs in combination with uuid.

Is there a plan for when said release is coming?

@fbucek
Copy link

fbucek commented Aug 31, 2023

I guess this problem is fixed with 7.0 release. I my case it works correctly with uuid version 1.4.1

@NyxCode NyxCode closed this as completed Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants