rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.63k stars 12.48k forks source link

error[E0275]: overflow evaluating the requirement only with incremental build involved #56629

Open upsuper opened 5 years ago

upsuper commented 5 years ago

Steps to reproduce:

  1. clone https://github.com/upsuper/telegram-rustevalbot (and checkout 2502973017d39a867dc2cde089b535127bc86e3b which is what I'm currently seeing)
  2. run cargo build
  3. then run cargo build again

It builds correctly in step 2, but fails in step 3 and shows the following error:

``` error[E0275]: overflow evaluating the requirement `http::response::Parts: std::marker::Send` | = help: consider adding a `#![recursion_limit="128"]` attribute to your crate = note: required because it appears within the type `http::response::Response<()>` = note: required because it appears within the type `h2::proto::peer::PollMessage` = note: required because it appears within the type `h2::proto::streams::recv::Event` = note: required because it appears within the type `h2::proto::streams::buffer::Slot` = note: required because it appears within the type `slab::Entry>` = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique>>` = note: required because it appears within the type `alloc::raw_vec::RawVec>>` = note: required because it appears within the type `std::vec::Vec>>` = note: required because it appears within the type `slab::Slab>` = note: required because it appears within the type `h2::proto::streams::buffer::Buffer` = note: required because it appears within the type `h2::proto::streams::recv::Recv` = note: required because it appears within the type `h2::proto::streams::streams::Actions` = note: required because it appears within the type `h2::proto::streams::streams::Inner` = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex` = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc>` = note: required because it appears within the type `h2::proto::streams::streams::OpaqueStreamRef` = note: required because it appears within the type `h2::share::ReleaseCapacity` = note: required because it appears within the type `h2::share::RecvStream` = note: required because it appears within the type `hyper::body::body::Kind` = note: required because it appears within the type `hyper::body::body::Body` = note: required because it appears within the type `http::request::Request` = note: required because it appears within the type `(http::request::Request, hyper::client::dispatch::Callback, http::response::Response>)` = note: required because it appears within the type `std::option::Option<(http::request::Request, hyper::client::dispatch::Callback, http::response::Response>)>` = note: required because it appears within the type `hyper::client::dispatch::Envelope, http::response::Response>` = note: required because of the requirements on the impl of `std::marker::Send` for `futures::sync::mpsc::Inner, http::response::Response>>` = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc, http::response::Response>>>` = note: required because it appears within the type `futures::sync::mpsc::Sender, http::response::Response>>` = note: required because it appears within the type `futures::sync::mpsc::UnboundedSender, http::response::Response>>` = note: required because it appears within the type `hyper::client::dispatch::Sender, http::response::Response>` = note: required because it appears within the type `hyper::client::conn::SendRequest` = note: required because it appears within the type `hyper::client::PoolTx` = note: required because it appears within the type `hyper::client::PoolClient` = note: required because it appears within the type `hyper::client::pool::Idle>` = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique>>` = note: required because it appears within the type `alloc::raw_vec::RawVec>>` = note: required because it appears within the type `std::vec::Vec>>` = note: required because it appears within the type `(std::sync::Arc, std::vec::Vec>>)` = note: required because it appears within the type `std::marker::PhantomData<(std::sync::Arc, std::vec::Vec>>)>` = note: required because it appears within the type `std::collections::hash::table::RawTable, std::vec::Vec>>>` = note: required because it appears within the type `std::collections::HashMap, std::vec::Vec>>>` = note: required because it appears within the type `hyper::client::pool::PoolInner>` = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex>>` = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc>>>` = note: required because it appears within the type `std::option::Option>>>>` = note: required because it appears within the type `hyper::client::pool::Pool>` = note: required because it appears within the type `hyper::client::Client` = note: required because it appears within the type `reqwest::async_impl::client::ClientRef` = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc` = note: required because it appears within the type `reqwest::async_impl::client::PendingRequest` = note: required because it appears within the type `reqwest::async_impl::client::PendingInner` = note: required because it appears within the type `reqwest::async_impl::client::Pending` = note: required because it appears within the type `futures::future::chain::Chain, [closure@src/cratesio/mod.rs:76:23: 76:53]>` = note: required because it appears within the type `futures::future::and_then::AndThen, [closure@src/cratesio/mod.rs:76:23: 76:53]>` = note: required because it appears within the type `futures::future::chain::Chain, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>` = note: required because it appears within the type `futures::future::and_then::AndThen, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>` = note: required because it appears within the type `futures::future::map::Map, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:40:75: 42:18]]>` = note: required because it appears within the type `futures::future::either::Either, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:40:75: 42:18]]>, futures::future::map::Map, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:50:50: 50:76]]>>` = note: required because it appears within the type `futures::future::map_err::MapErr, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:40:75: 42:18]]>, futures::future::map::Map, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:50:50: 50:76]]>>, [closure@src/cratesio/mod.rs:54:22: 54:65]>` = note: required because it appears within the type `futures::future::chain::Chain, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:40:75: 42:18]]>, futures::future::map::Map, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:50:50: 50:76]]>>, [closure@src/cratesio/mod.rs:54:22: 54:65]>, futures::future::map_err::MapErr>, [closure@src/bot.rs:143:23: 143:45]>, fn(reqwest::error::Error) -> bot::Error {>::from}>, std::result::Result, [closure@src/bot.rs:145:23: 145:90]>, futures::future::result_::FutureResult>, [closure@src/cratesio/mod.rs:59:26: 59:32]>, [closure@src/cratesio/mod.rs:60:30: 60:74]>, [closure@src/cratesio/mod.rs:55:23: 61:14 bot:bot::Bot, query:telegram_types::bot::inline_mode::InlineQuery]>` = note: required because it appears within the type `futures::future::and_then::AndThen, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:40:75: 42:18]]>, futures::future::map::Map, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:50:50: 50:76]]>>, [closure@src/cratesio/mod.rs:54:22: 54:65]>, futures::future::map_err::MapErr>, [closure@src/bot.rs:143:23: 143:45]>, fn(reqwest::error::Error) -> bot::Error {>::from}>, std::result::Result, [closure@src/bot.rs:145:23: 145:90]>, futures::future::result_::FutureResult>, [closure@src/cratesio/mod.rs:59:26: 59:32]>, [closure@src/cratesio/mod.rs:60:30: 60:74]>, [closure@src/cratesio/mod.rs:55:23: 61:14 bot:bot::Bot, query:telegram_types::bot::inline_mode::InlineQuery]>` = note: required because it appears within the type `futures::future::either::Either, futures::future::and_then::AndThen, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:40:75: 42:18]]>, futures::future::map::Map, [closure@src/cratesio/mod.rs:76:23: 76:53]>, reqwest::async_impl::response::Json, [closure@src/cratesio/mod.rs:77:23: 77:45]>, [closure@src/cratesio/mod.rs:78:18: 83:14 get_crates:[closure@src/cratesio/mod.rs:50:50: 50:76]]>>, [closure@src/cratesio/mod.rs:54:22: 54:65]>, futures::future::map_err::MapErr>, [closure@src/bot.rs:143:23: 143:45]>, fn(reqwest::error::Error) -> bot::Error {>::from}>, std::result::Result, [closure@src/bot.rs:145:23: 145:90]>, futures::future::result_::FutureResult>, [closure@src/cratesio/mod.rs:59:26: 59:32]>, [closure@src/cratesio/mod.rs:60:30: 60:74]>, [closure@src/cratesio/mod.rs:55:23: 61:14 bot:bot::Bot, query:telegram_types::bot::inline_mode::InlineQuery]>>` = note: required because of the requirements on the impl of `bot_runner::UpdateHandler` for `bot_runner::BotRun fn(&'r cratesio::CratesioBot, telegram_types::bot::types::Update) -> impl futures::future::Future {cratesio::CratesioBot::handle_update}>` = note: required because of the requirements on the impl of `futures::future::Future` for `bot_runner::BotRun fn(&'r cratesio::CratesioBot, telegram_types::bot::types::Update) -> impl futures::future::Future {cratesio::CratesioBot::handle_update}>` = note: required because of the requirements on the impl of `futures::future::IntoFuture` for `bot_runner::BotRun fn(&'r cratesio::CratesioBot, telegram_types::bot::types::Update) -> impl futures::future::Future {cratesio::CratesioBot::handle_update}>` ```

(Note: this projects always rebuild because its build script uses git-version which tricks cargo to rebuild even when nothing changes.)

Further note: if I remove the incremental directory in target, then it builds again. But after that, it fails again.

I have verified that it reproduces in both my macOS and a Linux VPS.

upsuper commented 5 years ago

A largely simplified version: testcase.zip

I guess the incremental build somehow pushes some stuff closer to the limitation, and thus triggers this error while non-incremental build doesn't, since removing many of the steps would have the error resolved.