You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiling playground v0.0.1 (/playground)
error[[E0277]](https://doc.rust-lang.org/stable/error-index.html#E0277): the trait bound `T: Deserialize<'_>` is not satisfied
[--> src/lib.rs:26:21
](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b18092dc590b23aef26f009db6e015e7#) |
26 | has_deserialize(s);
| --------------- ^ the trait `Deserialize<'_>` is not implemented for `T`
| |
| required by a bound introduced by this call
|
note: required because of the requirements on the impl of `Deserialize<'_>` for `S<T>`
[--> src/lib.rs:7:10
](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b18092dc590b23aef26f009db6e015e7#) |
7 | #[derive(Deserialize)]
| ^^^^^^^^^^^
8 | #[serde(try_from = "SS")]
9 | struct S<T> {
| ^^^^
note: required by a bound in `has_deserialize`
[--> src/lib.rs:23:28
](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b18092dc590b23aef26f009db6e015e7#) |
23 | fn has_deserialize<'de, T: Deserialize<'de>>(_: T) {}
| ^^^^^^^^^^^^^^^^ required by this bound in `has_deserialize`
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
|
25 | fn f<T: serde::Deserialize<'_>>(s: S<T>) {
| ++++++++++++++++++++++++
For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` due to previous error
It compiles when replaced with some !Deserialize concrete type. Playground
The following code doesn't compile. Playground
It compiles when replaced with some
!Deserialize
concrete type. PlaygroundThe text was updated successfully, but these errors were encountered: