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
use serde::{Deserialize,Deserializer};pubtraitMyTrait:for<'x>Deserialize<'x>{}#[derive(Debug,Clone)]structInner<T:MyTrait>(core::marker::PhantomData<T>);impl<'de,T:MyTrait>Deserialize<'de>forInner<T>{fndeserialize<D:Deserializer<'de>>(_deserializer:D) -> Result<Self,D::Error>{unimplemented!()}}#[derive(Debug,Clone,Deserialize)]pubstructOuter<T:MyTrait>{e:Inner<T>,}fnmain(){}
This results in (on Rust 1.85):
error[E0283]: type annotations needed: cannot satisfy `T: Deserialize<'_>`
--> src/main.rs:16:12
|
16 | pub struct Outer<T: MyTrait> {
| ^^^^^^^^^^^^^^^^^
|
note: multiple `impl`s or `where` clauses satisfying `T: Deserialize<'_>` found
--> src/main.rs:15:24
|
15 | #[derive(Debug, Clone, Deserialize)]
| ^^^^^^^^^^^
16 | pub struct Outer<T: MyTrait> {
| ^^^^^^^
note: required for `Outer<T>` to implement `Deserialize<'de>`
--> src/main.rs:15:24
|
15 | #[derive(Debug, Clone, Deserialize)]
| ^^^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
16 | pub struct Outer<T: MyTrait> {
| ^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
<... long error output, see the playground link>
MRE (playground link):
This results in (on Rust 1.85):
This may be related to #2463.
The text was updated successfully, but these errors were encountered: