indradb / indradb

A graph database written in rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

using rust library fails to compile it, uuid::v1::Timestamp is private

jrozentur opened this issue · comments

Cargo.toml:
[dependencies]
indradb-lib = { version = "*" }

$cargo build
Compiling indradb-lib v3.0.3
error[E0603]: struct Timestamp is private
--> /Users/.../.cargo/registry/src/github.com-1ecc6299db9ec823/indradb-lib-3.0.3/src/util.rs:16:25
|
16 | use uuid::v1::{Context, Timestamp};
| ^^^^^^^^^ private struct
|
note: the struct Timestamp is defined here
--> /Users/.../.cargo/registry/src/github.com-1ecc6299db9ec823/uuid-1.2.0/src/v1.rs:6:22
|
6 | use crate::{Builder, Timestamp, Uuid};
| ^^^^^^^^^
Looks like it became private in the latest uuid library:

given main.rs:
use uuid::v1::{Timestamp};

if given Cargo.toml:
[dependencies]
uuid={version="0.8.2", features=["v1"]}
-> ok
but if given Cargo.toml:
[dependencies]
uuid={version="1.2.0", features=["v1"]}
->
--> src/main.rs:1:16
|
1 | use uuid::v1::{Timestamp};
| ^^^^^^^^^ private struct
|

$rustup toolchain list
stable-aarch64-apple-darwin (default)
$rustup default stable
info: using existing install for 'stable-aarch64-apple-darwin'
info: default toolchain set to 'stable-aarch64-apple-darwin'

stable-aarch64-apple-darwin unchanged - rustc 1.64.0 (a55dd71d5 2022-09-19)

Aw, they broke semver. I’ll make a fix soon but looks like you already know the workaround.

I'm not able to repro this issue. It looks like uuid is pinned to 0.8.2, so I'm not sure why it would try to pull 1.2.0.

Closing, but if there's any extra steps to repro please let me know.