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

Cannot build: "cannot find export in syn #17

Closed
mrlogick opened this issue Jan 5, 2021 · 9 comments · Fixed by #18
Closed

Cannot build: "cannot find export in syn #17

mrlogick opened this issue Jan 5, 2021 · 9 comments · Fixed by #18

Comments

@mrlogick
Copy link

mrlogick commented Jan 5, 2021

$ 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
Copy link
Contributor

ocboogie commented Jan 5, 2021

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
Copy link
Contributor

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
Copy link

emk commented Jan 7, 2021

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

danobi added a commit to danobi/below that referenced this issue Jan 7, 2021
danobi added a commit to danobi/below that referenced this issue Jan 7, 2021
danobi added a commit to danobi/below that referenced this issue Jan 8, 2021
emk added a commit to dbcrossbar/dbcrossbar that referenced this issue Jan 14, 2021
This also includes a workaround for
Lymia/enumset#17. We replace `enumset` with
`big_enum_set`, which has a fix, and which is mostly API-compatible. And
more flag bits are always nice!
@Lymia Lymia closed this as completed in #18 Jan 25, 2021
@Lymia
Copy link
Owner

Lymia commented Jan 25, 2021

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
Copy link

JOSBEAK commented Jun 18, 2022

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
Copy link
Owner

Lymia commented Jun 18, 2022

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

@JOSBEAK
Copy link

JOSBEAK commented Jun 20, 2022

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
Copy link
Owner

Lymia commented Jun 20, 2022

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

@JOSBEAK
Copy link

JOSBEAK commented Jun 20, 2022

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 👍🏼

MeNsaaH pushed a commit to Go-phie/mythra that referenced this issue Apr 21, 2023
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

Successfully merging a pull request may close this issue.

6 participants