mit-pdos / noria

Fast web applications through dynamic, partially-stateful dataflow
Apache License 2.0
4.97k stars 241 forks source link

`cargo doc` fails #153

Closed tomharmon closed 4 years ago

tomharmon commented 4 years ago

Trying to build the docs from the root of this repository fails on macOS 10.15.2 with rustc 1.42.0-nightly (698fcd38f 2020-01-26)

I receive the following error:

error[E0277]: the trait bound `(): std::future::Future` is not satisfied
  --> noria/src/controller.rs:65:5
   |
65 |     type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `()`
   |
   = note: the return type of a function must have a statically known size

error[E0277]: the trait bound `(): std::future::Future` is not satisfied
  --> noria/src/view.rs:38:5
   |
38 | /     type Future = impl Future<
39 | |         Output = Result<multiplex::MultiplexTransport<Transport, Tagger>, tokio::io::Error>,
40 | |     >;
   | |______^ the trait `std::future::Future` is not implemented for `()`
   |
   = note: the return type of a function must have a statically known size

error[E0277]: the trait bound `(): std::future::Future` is not satisfied
  --> noria/src/table.rs:42:5
   |
42 | /     type Future = impl Future<
43 | |         Output = Result<multiplex::MultiplexTransport<Transport, Tagger>, tokio::io::Error>,
44 | |     >;
   | |______^ the trait `std::future::Future` is not implemented for `()`
   |
   = note: the return type of a function must have a statically known size

error[E0277]: the trait bound `(): std::future::Future` is not satisfied
   --> noria/src/controller.rs:179:1
    |
179 | type RpcFuture<A, R> = impl Future<Output = Result<R, failure::Error>>;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `()`
    |
    = note: the return type of a function must have a statically known size

error[E0277]: the trait bound `(): std::future::Future` is not satisfied
   --> noria/src/table.rs:235:5
    |
235 |     type Future = impl Future<Output = Result<Tagged<()>, TableError>> + Send;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `()`
    |
    = note: the return type of a function must have a statically known size

error[E0277]: the trait bound `(): std::future::Future` is not satisfied
   --> noria/src/view.rs:201:5
    |
201 |     type Future = impl Future<Output = Result<Vec<Datas>, ViewError>> + Send;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `()`
    |
    = note: the return type of a function must have a statically known size

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0277`.
error: Could not document `noria`.
jonhoo commented 4 years ago

That's fascinating... cargo check and cargo test both work fine. I have absolutely no idea why it'd fail under cargo doc... Sort of sounds like a cargo bug. Any suggestions?

tomharmon commented 4 years ago

No idea. My friend tried it on Manjaro and it fails with the same error. cargo check and cargo test work for me so yes, definitely weird.

intendednull commented 4 years ago

Failing for me too on arch 5.5.3 w/ rustc 1.43.0-nightly (58b834344 2020-02-05). Can confirm everything else works.

jonhoo commented 4 years ago

Ah, this is https://github.com/rust-lang/rust/issues/65863, which also prevents the noria crates from working on docs.rs :cry:

anandijain commented 4 years ago

this may be a different bug, but on cargo doc --open, I get:

The binary 'vote' is specified by packages 'noria-applications v0.3.0' and 'noria-orchestration v0.3.0' but can be documented only once. Consider renaming or marking one of the targets as 'doc = false'.

it's not exactly clear where I should mark the target doc=false. thanks!

jonhoo commented 4 years ago

Ah, interesting... That's super weird. We can really mark both of those as doc = false. In the meantime, I think you'll want cargo doc --lib -p noria.

jonhoo commented 4 years ago

I pushed a commit to master now that should take care of it!

anandijain commented 4 years ago

Thanks!

anandijain commented 4 years ago

after git pulling, running cargo doc --lib -p noria and cargo doc --open now gives:

the trait `core::future::future::Future` is not implemented for `()`... 
error: Could not document `tokio-tower`.

So unlike the original issue, the error is on tokio-tower not noria.

jonhoo commented 4 years ago

Yup, although it's still the same underlying issue :)

jonhoo commented 4 years ago

This should now work (there are also now docs on docs.rs!), though you'll have to comment out the line indicate in the root-level Cargo.toml (or you'll hit https://github.com/rust-lang/rust/issues/73061).