|
| 1 | +error[E0277]: the trait bound `MyStruct: Serialize` is not satisfied |
| 2 | + --> tests/ui/on_unimplemented.rs:21:15 |
| 3 | + | |
| 4 | +21 | to_string(&MyStruct); |
| 5 | + | --------- ^^^^^^^^^ the trait `Serialize` is not implemented for `MyStruct` |
| 6 | + | | |
| 7 | + | required by a bound introduced by this call |
| 8 | + | |
| 9 | + = note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type |
| 10 | + = note: for types from other crates check whether the crate offers a `serde` feature flag |
| 11 | + = help: the following other types implement trait `Serialize`: |
| 12 | + &'a T |
| 13 | + &'a mut T |
| 14 | + () |
| 15 | + (T,) |
| 16 | + (T0, T1) |
| 17 | + (T0, T1, T2) |
| 18 | + (T0, T1, T2, T3) |
| 19 | + (T0, T1, T2, T3, T4) |
| 20 | + and $N others |
| 21 | +note: required by a bound in `to_string` |
| 22 | + --> tests/ui/on_unimplemented.rs:6:8 |
| 23 | + | |
| 24 | +4 | fn to_string<T>(_: &T) -> String |
| 25 | + | --------- required by a bound in this function |
| 26 | +5 | where |
| 27 | +6 | T: Serialize, |
| 28 | + | ^^^^^^^^^ required by this bound in `to_string` |
| 29 | + |
| 30 | +error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied |
| 31 | + --> tests/ui/on_unimplemented.rs:22:23 |
| 32 | + | |
| 33 | +22 | let _: MyStruct = from_str(""); |
| 34 | + | ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct` |
| 35 | + | |
| 36 | + = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type |
| 37 | + = note: for types from other crates check whether the crate offers a `serde` feature flag |
| 38 | + = help: the following other types implement trait `Deserialize<'de>`: |
| 39 | + &'a Path |
| 40 | + &'a [u8] |
| 41 | + &'a str |
| 42 | + () |
| 43 | + (T,) |
| 44 | + (T0, T1) |
| 45 | + (T0, T1, T2) |
| 46 | + (T0, T1, T2, T3) |
| 47 | + and $N others |
| 48 | +note: required by a bound in `from_str` |
| 49 | + --> tests/ui/on_unimplemented.rs:13:8 |
| 50 | + | |
| 51 | +11 | fn from_str<'de, T>(_: &'de str) -> T |
| 52 | + | -------- required by a bound in this function |
| 53 | +12 | where |
| 54 | +13 | T: Deserialize<'de>, |
| 55 | + | ^^^^^^^^^^^^^^^^ required by this bound in `from_str` |
0 commit comments