-
Notifications
You must be signed in to change notification settings - Fork 55
Can not compile basic example on README.md #108
Comments
See #106, there are compatibility issues with new nightlies because of the builtin |
@Nemo157 : Thanks! error[E0432]: unresolved import `futures::prelude::await`========> ] 8/9: check_await
--> src/main.rs:7:24
|
7 | use futures::prelude::{await, async};
| ^^^^^ no `await` in `prelude` What is the right thing to do right now? Is there something I should add to the example, or should I just wait until this problem is resolved? Is there a solution I could use in the meantime, because currently the build is broken for my code, and development can not be continued. |
Also running into this - is there a known-good nightly to roll back to? |
@insanitybit : See: #106 (comment) The solution that worked for me was adding: #![feature(use_extern_macros)] There are still some modifications required to compile the example though (As I noted above), maybe we should open a pull request to update the documentation. |
Oh, you're right, that does fix it - I had tried it, but messed it up. Thank you. |
For compiling with a more recent nightly, a few more modifications are necessary. Use of Using rustc 1.30.0-nightly (9395f0af7 2018-09-02) #![feature(generators)]
#![feature(await_macro)]
#![feature(custom_attribute)]
extern crate futures_await as futures;
use futures::prelude::{await, async, Future};
#[async]
fn foo() -> Result<i32, i32> {
Ok(1 + await!(bar())?)
}
#[async]
fn bar() -> Result<i32, i32> {
Ok(2)
}
fn main() {
assert_eq!(foo().wait(), Ok(3));
} |
I can not successfully compile the basic await! example on the readme.
My first attempt to compile it gave me this compilation error:
According to the information in the error message, I added
#![feature(await_macro)]
. Later I also added#![feature(custom_attribute)]
, to obtain this source file:main.rs
Cargo.toml:
Compilation errors:
Is there anything I can do to resolve these issues?
The text was updated successfully, but these errors were encountered: