Add ui test of unsatisfied serde trait bound

This commit is contained in:
David Tolnay
2024-07-06 10:25:56 -07:00
parent 595019e979
commit 91aa40e749
2 changed files with 74 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
use serde::de::Deserialize;
use serde::ser::Serialize;
fn to_string<T>(_: &T) -> String
where
T: Serialize,
{
unimplemented!()
}
fn from_str<'de, T>(_: &'de str) -> T
where
T: Deserialize<'de>,
{
unimplemented!()
}
struct MyStruct;
fn main() {
to_string(&MyStruct);
let _: MyStruct = from_str("");
}