I'm trying to do something like this:
let whatever = path!(String / "whatever")
.and(warp::query::query::<WhateverQuery<'_>>())
.map(|_, _| "");
#[derive(Deserialize)]
pub struct WhateverQuery<'a> {
x: &'a str,
}
When I run it like this, I get an error:
error[E0279]: the requirement `for<'de> 'de : ` is not satisfied (`expected bound lifetime parameter 'de, found concrete lifetime`)
--> src/main.rs:29:14
29 | .and(warp::query::query::<WhateverQuery<'_>>())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: required because of the requirements on the impl of `for<'de> _IMPL_DESERIALIZE_FOR_WhateverQuery::_serde::Deserialize<'de>` for `WhateverQuery<'_>`
= note: required because of the requirements on the impl of `_IMPL_DESERIALIZE_FOR_WhateverQuery::_serde::de::DeserializeOwned` for `WhateverQuery<'_>`
= note: required by `warp::query`
I'm honestly not sure what this error means, so I've just tried to replace the hidden lifetime parameter with a static one - for testing - when I ran into this issue:
error: internal compiler error: broken MIR in DefId(0/0:11 ~ app[df35]::main[0]) (NoSolution): could not prove Binder(TraitPredicate(<WhateverQuery<'_> as _IMPL_DESERIALIZE_FOR_WhateverQuery::_serde::de::DeserializeOwned>))
thread 'main' panicked at 'no errors encountered even though `delay_span_bug` issued', librustc_errors/lib.rs:313:17
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.30.0-nightly (73c78734b 2018-08-05) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
Could someone please explain what exactly the problem is and how could it be solved? Thanks!