p-e-w / wd2sql

Transform a Wikidata JSON dump into an SQLite database
GNU General Public License v3.0
9 stars 2 forks source link

error[E0004]: non-exhaustive patterns: `_` not covered #12

Closed albertfilice closed 7 months ago

albertfilice commented 9 months ago

Trying to install on macOS but I get an error

cargo 1.76.0 (c84b36747 2024-01-18)

albertfilice@Alberts-MacBook-Pro Downloads % cargo install wd2sql
    Updating crates.io index
  Downloaded wd2sql v0.1.0
  Downloaded 1 crate (26.8 KB) in 0.27s
  Installing wd2sql v0.1.0
    Updating crates.io index
  Downloaded anstyle v1.0.6
  Downloaded allocator-api2 v0.2.16
  Downloaded itoa v1.0.10
  Downloaded anstyle-query v1.0.2
  Downloaded lazy_static v1.4.0
  Downloaded anstyle-parse v0.2.3
  Downloaded lexical-parse-integer v0.8.6
  Downloaded colorchoice v1.0.0
  Downloaded bitflags v1.3.2
  Downloaded humantime v2.1.0
  Downloaded humansize v2.1.3
  Downloaded lexical-util v0.8.5
  Downloaded anstream v0.6.11
  Downloaded ryu v1.0.16
  Downloaded lexical-write-float v0.8.5
  Downloaded rusqlite v0.28.0
  Downloaded value-trait v0.5.1
  Downloaded chrono v0.4.34
  Downloaded libc v0.2.153
  Downloaded jemalloc-sys v0.5.4+5.3.0-patched
  Downloaded vcpkg v0.2.15
  Downloaded wikidata v0.3.1
  Downloaded simd-json v0.7.0
  Downloaded libsqlite3-sys v0.25.2
  Downloaded halfbrown v0.1.18
  Downloaded syn v2.0.49
  Downloaded serde_json v1.0.113
  Downloaded lexical-parse-float v0.8.5
  Downloaded libm v0.2.8
  Downloaded clap_builder v4.5.0
  Downloaded zerocopy v0.7.32
  Downloaded serde v1.0.196
  Downloaded hashbrown v0.14.3
  Downloaded cc v1.0.83
  Downloaded serde_derive v1.0.196
  Downloaded quote v1.0.35
  Downloaded proc-macro2 v1.0.78
  Downloaded ahash v0.8.8
  Downloaded num-traits v0.2.18
  Downloaded clap v4.5.0
  Downloaded lexical-write-integer v0.8.5
  Downloaded unicode-ident v1.0.12
  Downloaded smallvec v1.13.1
  Downloaded pkg-config v0.3.30
  Downloaded lexical-core v0.8.5
  Downloaded hashlink v0.8.4
  Downloaded once_cell v1.19.0
  Downloaded iana-time-zone v0.1.60
  Downloaded fallible-iterator v0.2.0
  Downloaded core-foundation-sys v0.8.6
  Downloaded hashbrown v0.13.2
  Downloaded strsim v0.11.0
  Downloaded simdutf8 v0.1.4
  Downloaded float-cmp v0.9.0
  Downloaded version_check v0.9.4
  Downloaded heck v0.4.1
  Downloaded clap_lex v0.7.0
  Downloaded autocfg v1.1.0
  Downloaded cfg-if v1.0.0
  Downloaded fallible-streaming-iterator v0.1.9
  Downloaded jemallocator v0.5.4
  Downloaded clap_derive v4.5.0
  Downloaded utf8parse v0.2.1
  Downloaded static_assertions v1.1.0
  Downloaded 64 crates (10.0 MB) in 0.74s (largest was `libsqlite3-sys` at 4.8 MB)
   Compiling proc-macro2 v1.0.78
   Compiling unicode-ident v1.0.12
   Compiling libc v0.2.153
   Compiling version_check v0.9.4
   Compiling serde v1.0.196
   Compiling autocfg v1.1.0
   Compiling zerocopy v0.7.32
   Compiling cfg-if v1.0.0
   Compiling once_cell v1.19.0
   Compiling static_assertions v1.1.0
   Compiling pkg-config v0.3.30
   Compiling vcpkg v0.2.15
   Compiling ryu v1.0.16
   Compiling utf8parse v0.2.1
   Compiling core-foundation-sys v0.8.6
   Compiling itoa v1.0.10
   Compiling lexical-util v0.8.5
   Compiling serde_json v1.0.113
   Compiling anstyle-parse v0.2.3
   Compiling anstyle-query v1.0.2
   Compiling libm v0.2.8
   Compiling allocator-api2 v0.2.16
   Compiling iana-time-zone v0.1.60
   Compiling anstyle v1.0.6
   Compiling colorchoice v1.0.0
   Compiling ahash v0.8.8
   Compiling heck v0.4.1
   Compiling clap_lex v0.7.0
   Compiling strsim v0.11.0
   Compiling num-traits v0.2.18
   Compiling anstream v0.6.11
   Compiling smallvec v1.13.1
   Compiling bitflags v1.3.2
   Compiling simdutf8 v0.1.4
   Compiling fallible-streaming-iterator v0.1.9
   Compiling clap_builder v4.5.0
   Compiling fallible-iterator v0.2.0
   Compiling lazy_static v1.4.0
   Compiling humantime v2.1.0
   Compiling lexical-parse-integer v0.8.6
   Compiling lexical-write-integer v0.8.5
   Compiling lexical-parse-float v0.8.5
   Compiling lexical-write-float v0.8.5
   Compiling lexical-core v0.8.5
   Compiling hashbrown v0.13.2
   Compiling hashbrown v0.14.3
   Compiling float-cmp v0.9.0
   Compiling hashlink v0.8.4
   Compiling humansize v2.1.3
   Compiling quote v1.0.35
   Compiling syn v2.0.49
   Compiling cc v1.0.83
   Compiling libsqlite3-sys v0.25.2
   Compiling jemalloc-sys v0.5.4+5.3.0-patched
   Compiling serde_derive v1.0.196
   Compiling clap_derive v4.5.0
   Compiling clap v4.5.0
   Compiling chrono v0.4.34
   Compiling halfbrown v0.1.18
   Compiling value-trait v0.5.1
   Compiling simd-json v0.7.0
   Compiling wikidata v0.3.1
   Compiling jemallocator v0.5.4
   Compiling rusqlite v0.28.0
   Compiling wd2sql v0.1.0
error[E0004]: non-exhaustive patterns: `_` not covered
  --> /Users/albertfilice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wd2sql-0.1.0/src/main.rs:72:20
   |
72 |     let id = match entity.id {
   |                    ^^^^^^^^^ pattern `_` not covered
   |
note: `WikiId` defined here
  --> /Users/albertfilice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wikidata-0.3.1/src/ids.rs:13:1
   |
13 | pub enum WikiId {
   | ^^^^^^^^^^^^^^^
   = note: the matched value is of type `WikiId`
   = note: `WikiId` is marked as non-exhaustive, so a wildcard `_` is necessary to match exhaustively
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
   |
75 ~         LexemeId(id) => l_id(id),
76 ~         _ => todo!(),
   |

For more information about this error, try `rustc --explain E0004`.
error: could not compile `wd2sql` (bin "wd2sql") due to 1 previous error
error: failed to compile `wd2sql v0.1.0`, intermediate artifacts can be found at `/var/folders/tn/5syjv7_n2lb8kyytpb5vkn9w0000gn/T/cargo-install1zeL3O`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
p-e-w commented 8 months ago

Try cargo install --locked wd2sql instead. It appears that the wikidata crate has published a change that violates the SemVer contract.

p-e-w commented 7 months ago

Fixed upstream.