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

error: expected item after attributes using Rust 1.41 #2061

Closed
galich opened this issue Feb 4, 2020 · 5 comments
Closed

error: expected item after attributes using Rust 1.41 #2061

galich opened this issue Feb 4, 2020 · 5 comments
Labels
A-macro Area: macro related

Comments

@galich
Copy link

galich commented Feb 4, 2020

Our app fails to compile because of the following error given by rustc 1.41.0 (5e1a79984 2020-01-27)

error: expected item after attributes
   --> C:\Users\serg\.cargo\registry\src\github.com-1ecc6299db9ec823\futures-0.3.1\src\lib.rs:529:19
    |
529 |     #[macro_export]
    |                   ^
@Nemo157
Copy link
Member

Nemo157 commented Feb 4, 2020

This appears to be an incompatibility introduced with futures-util 0.3.2, probably related to #1891 #1976. Easy fix is to update to 0.3.2 of futures as well or downgrade futures-util back to 0.3.1.

@cramertj worth yanking 0.3.2 (maybe just -util) and publishing a fix as 0.3.3? Seems like a difficult situation to get into unless you're pinning the version of futures but not pinning the underlying libraries.

@Nemo157
Copy link
Member

Nemo157 commented Feb 4, 2020

Tested with

> cargo download -x futures==0.3.1
INFO: cargo-download v0.1.2
INFO: Crate `futures==0.3.1` downloaded successfully
INFO: Crate content extracted to ./futures-0.3.1/
> cd futures-0.3.1
> cargo +1.41.0 build
   Compiling proc-macro2 v1.0.8
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.14
   Compiling proc-macro-nested v0.1.3
   Compiling memchr v2.3.0
   Compiling futures-sink v0.3.2
   Compiling futures-core v0.3.2
   Compiling slab v0.4.2
   Compiling futures-io v0.3.2
   Compiling futures-task v0.3.2
   Compiling pin-utils v0.1.0-alpha.4
   Compiling futures-channel v0.3.2
   Compiling quote v1.0.2
   Compiling proc-macro-hack v0.5.11
   Compiling futures-macro v0.3.2
   Compiling futures-util v0.3.2
   Compiling futures-executor v0.3.2
   Compiling futures v0.3.1 (/private/var/folders/0p/5yvmrvhj5w3_vy1y8x7dvk7m0000gn/T/tmp.hJzVLqqR/futures-0.3.1)
error: expected item after attributes
   --> src/lib.rs:529:19
    |
529 |     #[macro_export]
    |                   ^

error: aborting due to previous error

error: could not compile `futures`.

To learn more, run the command again with --verbose.
> cargo update -p futures-util -p futures-executor --precise 0.3.1
    Updating crates.io index
    Updating futures-executor v0.3.2 -> v0.3.1
    Updating futures-util v0.3.2 -> v0.3.1
> cargo +1.41.0 build
   Compiling futures-util v0.3.1
   Compiling futures-executor v0.3.1
   Compiling futures v0.3.1 (/private/var/folders/0p/5yvmrvhj5w3_vy1y8x7dvk7m0000gn/T/tmp.hJzVLqqR/futures-0.3.1)
    Finished dev [unoptimized + debuginfo] target(s) in 5.53s

@cramertj
Copy link
Member

cramertj commented Feb 4, 2020

Sure, I'll publish 0.3.3 once #2062 is in. In general, though, using old futures facades with new versions of futures-util is a pretty odd usecase that we won't be testing against, and I'd advise against pinning the futures facade without pinning the inner crates-- I can't think of any reason why you'd want that behavior.

@galich
Copy link
Author

galich commented Feb 4, 2020

Good catch, we do actually pin in the app. But we can't do that for 3rd party crates obviously. May be it's time to re-evalutate Cargo.lock for pinning.

@galich
Copy link
Author

galich commented Feb 5, 2020

thanks for the update, it works perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro Area: macro related
Projects
None yet
Development

No branches or pull requests

4 participants