Lymia / enumset

A library for compact bit sets containing enums.
Apache License 2.0
91 stars 35 forks source link

Cannot build: "cannot find export` in `syn #17

Closed mrlogick closed 3 years ago

mrlogick commented 3 years ago

$ cargo build

Compiling enumset_derive v0.5.0 (/home/mrlogick/enumset/enumset_derive)
error[E0432]: unresolved import `syn::export`
  --> enumset_derive/src/lib.rs:10:10
   |
10 | use syn::export::Span;
   |          ^^^^^^ could not find `export` in `syn`

error: aborting due to previous error
ocboogie commented 3 years ago

I made a PR to fix the issue, although it might take a while for it to get merged and for downstream crates to update. So for now, here is a patch:

[patch.crates-io.enumset_derive]
git = "https://github.com/ocboogie/enumset"
branch = "span-fix" 

I'll update this snippet with Lymia's repo once the PR gets merged.

coolreader18 commented 3 years ago

I think if it's only released as a patch (0.5.1) and 0.5.0 is yanked, it shouldn't be necessary for downstream crates to update.

emk commented 3 years ago

According to this comment, the syn::export APIs are private and should not be used. They link to this: https://github.com/dtolnay/syn/blob/5e23a9b9ac13733a56cf55777dc42bb23ee00bbc/src/lib.rs#L789-L791

Lymia commented 3 years ago

Sorry about the delay in fixing this. I've set up an email client locally so I won't miss things like this in the future.

JOSBEAK commented 2 years ago

Hey! Is this issue still active ?

I am getting something like this while doing a cargo run to a project.

 --> /home/josbeak/.cargo/registry/src/github.com-1ecc6299db9ec823/enumset_derive-0.4.4/src/lib.rs:10:10
   |
10 | use syn::export::Span;
   |          ^^^^^^ could not find `export` in `syn`

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

Please Help !

Lymia commented 2 years ago

Try cargo update. There's been a version published with this bug fixed for a long time.

JOSBEAK commented 2 years ago

Try cargo update. There's been a version published with this bug fixed for a long time.

nope no help :( cargo update , updates syn from v1.0.96->v1.0.98 but on cargo run the error is still there.

Lymia commented 2 years ago

What's your Cargo.toml say? This was fixed long ago, and 0.4.4 is pretty old.

JOSBEAK commented 2 years ago

What's your Cargo.toml say? This was fixed long ago, and 0.4.4 is pretty old.

It works now somehow, Thanks for the help though 👍🏼