Skip to content
Myr

Merge pull request #2963 from dtolnay/diagnosticpath

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Override diagnostic::on_unimplemented message for all serde_core traits

authored by David Tolnay · committed by GitHub · parents 723fcac, 4bddf1b · Browse files · 9 files+331 added−92 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

9 files+331 added−92 removed

  • tests:+211 added−92 removed
  • other:+120 added−0 removed

9 files+331 added−92 removed

modified:serde_core/src/de/mod.rs+63 added
156 unmodified lines
157 /// The [example data format] presented on the website shows an error158 /// type appropriate for a basic JSON data format.159 ///160 /// [example data format]: https://serde.rs/data-format.html161 #[cfg_attr(162 not(no_diagnostic_namespace),163 diagnostic::on_unimplemented(164 message = "the trait bound `{Self}: serde::de::Error` is not satisfied",165 )166 )]167 pub trait Error: Sized $(+ $($supertrait)::+)* {168 /// Raised when there is general error when deserializing a type.169 ///170 /// The message should not be capitalized and should not end with a period.
305 unmodified lines
476/// &"a negative integer",477/// ));478/// # }479/// ```480#[cfg_attr(481 not(no_diagnostic_namespace),482 diagnostic::on_unimplemented(483 message = "the trait bound `{Self}: serde::de::Expected` is not satisfied",484 )485)]486pub trait Expected {487 /// Format an explanation of what data was being expected. Same signature as488 /// the `Display` and `Debug` traits.489 fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result;
55 unmodified lines
545/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html546#[cfg_attr(547 not(no_diagnostic_namespace),548 diagnostic::on_unimplemented(549 // Prevents `serde_core::de::Deserialize` appearing in the error message550 // in projects with no direct dependency on serde_core.551 message = "the trait bound `{Self}: serde::Deserialize<'de>` is not satisfied",552 note = "for local types consider adding `#[derive(serde::Deserialize)]` to your `{Self}` type",553 note = "for types from other crates check whether the crate offers a `serde` feature flag",554 )555)]
68 unmodified lines
624/// bounds is explained in more detail on the page [Understanding deserializer625/// lifetimes].626///627/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html628#[cfg_attr(629 not(no_diagnostic_namespace),630 diagnostic::on_unimplemented(631 message = "the trait bound `{Self}: serde::de::DeserializeOwned` is not satisfied",632 )633)]634pub trait DeserializeOwned: for<'de> Deserialize<'de> {}635impl<T> DeserializeOwned for T where T: for<'de> Deserialize<'de> {}636637/// `DeserializeSeed` is the stateful form of the `Deserialize` trait. If you
157 unmodified lines
795/// let flattened: Vec<u64> = deserializer.deserialize_seq(visitor)?;796/// # Ok(())797/// # }798/// ```799#[cfg_attr(800 not(no_diagnostic_namespace),801 diagnostic::on_unimplemented(802 message = "the trait bound `{Self}: serde::de::DeserializeSeed<'de>` is not satisfied",803 )804)]805pub trait DeserializeSeed<'de>: Sized {806 /// The type produced by using this seed.807 type Value;808
128 unmodified lines
937/// The [example data format] presented on the website contains example code for938/// a basic JSON `Deserializer`.939///940/// [example data format]: https://serde.rs/data-format.html941#[cfg_attr(942 not(no_diagnostic_namespace),943 diagnostic::on_unimplemented(944 message = "the trait bound `{Self}: serde::de::Deserializer<'de>` is not satisfied",945 )946)]947pub trait Deserializer<'de>: Sized {948 /// The error type that can be returned if some error occurs during949 /// deserialization.950 type Error: Error;
348 unmodified lines
1299/// }1300/// }1301/// }1302/// ```1303#[cfg_attr(1304 not(no_diagnostic_namespace),1305 diagnostic::on_unimplemented(1306 message = "the trait bound `{Self}: serde::de::Visitor<'de>` is not satisfied",1307 )1308)]1309pub trait Visitor<'de>: Sized {1310 /// The value produced by this visitor.1311 type Value;1312
418 unmodified lines
1731/// The [example data format] presented on the website demonstrates an1732/// implementation of `SeqAccess` for a basic JSON data format.1733///1734/// [example data format]: https://serde.rs/data-format.html1735#[cfg_attr(1736 not(no_diagnostic_namespace),1737 diagnostic::on_unimplemented(1738 message = "the trait bound `{Self}: serde::de::SeqAccess<'de>` is not satisfied",1739 )1740)]1741pub trait SeqAccess<'de> {1742 /// The error type that can be returned if some error occurs during1743 /// deserialization.1744 type Error: Error;
74 unmodified lines
1819/// The [example data format] presented on the website demonstrates an1820/// implementation of `MapAccess` for a basic JSON data format.1821///1822/// [example data format]: https://serde.rs/data-format.html1823#[cfg_attr(1824 not(no_diagnostic_namespace),1825 diagnostic::on_unimplemented(1826 message = "the trait bound `{Self}: serde::de::MapAccess<'de>` is not satisfied",1827 )1828)]1829pub trait MapAccess<'de> {1830 /// The error type that can be returned if some error occurs during1831 /// deserialization.1832 type Error: Error;
184 unmodified lines
2017/// The [example data format] presented on the website demonstrates an2018/// implementation of `EnumAccess` for a basic JSON data format.2019///2020/// [example data format]: https://serde.rs/data-format.html2021#[cfg_attr(2022 not(no_diagnostic_namespace),2023 diagnostic::on_unimplemented(2024 message = "the trait bound `{Self}: serde::de::EnumAccess<'de>` is not satisfied",2025 )2026)]2027pub trait EnumAccess<'de>: Sized {2028 /// The error type that can be returned if some error occurs during2029 /// deserialization.2030 type Error: Error;
39 unmodified lines
2070/// The [example data format] presented on the website demonstrates an2071/// implementation of `VariantAccess` for a basic JSON data format.2072///2073/// [example data format]: https://serde.rs/data-format.html2074#[cfg_attr(2075 not(no_diagnostic_namespace),2076 diagnostic::on_unimplemented(2077 message = "the trait bound `{Self}: serde::de::VariantAccess<'de>` is not satisfied",2078 )2079)]2080pub trait VariantAccess<'de>: Sized {2081 /// The error type that can be returned if some error occurs during2082 /// deserialization. Must match the error type of our `EnumAccess`.2083 type Error: Error;
301 unmodified lines
modified:serde_core/src/ser/mod.rs+57 added
137 unmodified lines
138 /// The [example data format] presented on the website shows an error139 /// type appropriate for a basic JSON data format.140 ///141 /// [example data format]: https://serde.rs/data-format.html142 #[cfg_attr(143 not(no_diagnostic_namespace),144 diagnostic::on_unimplemented(145 message = "the trait bound `{Self}: serde::ser::Error` is not satisfied",146 )147 )]148 pub trait Error: Sized $(+ $($supertrait)::+)* {149 /// Used when a [`Serialize`] implementation encounters any error150 /// while serializing a type.151 ///
71 unmodified lines
223/// [derive section of the manual]: https://serde.rs/derive.html224#[cfg_attr(225 not(no_diagnostic_namespace),226 diagnostic::on_unimplemented(227 // Prevents `serde_core::ser::Serialize` appearing in the error message228 // in projects with no direct dependency on serde_core.229 message = "the trait bound `{Self}: serde::Serialize` is not satisfied",230 note = "for local types consider adding `#[derive(serde::Serialize)]` to your `{Self}` type",231 note = "for types from other crates check whether the crate offers a `serde` feature flag",232 )233)]
111 unmodified lines
345/// The [example data format] presented on the website contains example code for346/// a basic JSON `Serializer`.347///348/// [example data format]: https://serde.rs/data-format.html349#[cfg_attr(350 not(no_diagnostic_namespace),351 diagnostic::on_unimplemented(352 message = "the trait bound `{Self}: serde::Serializer` is not satisfied",353 )354)]355pub trait Serializer: Sized {356 /// The output type produced by this `Serializer` during successful357 /// serialization. Most serializers that produce text or binary output358 /// should set `Ok = ()` and serialize into an [`io::Write`] or buffer
1149 unmodified lines
1508/// The [example data format] presented on the website demonstrates an1509/// implementation of `SerializeSeq` for a basic JSON data format.1510///1511/// [example data format]: https://serde.rs/data-format.html1512#[cfg_attr(1513 not(no_diagnostic_namespace),1514 diagnostic::on_unimplemented(1515 message = "the trait bound `{Self}: serde::ser::SerializeSeq` is not satisfied",1516 )1517)]1518pub trait SerializeSeq {1519 /// Must match the `Ok` type of our `Serializer`.1520 type Ok;1521
92 unmodified lines
1614/// The [example data format] presented on the website demonstrates an1615/// implementation of `SerializeTuple` for a basic JSON data format.1616///1617/// [example data format]: https://serde.rs/data-format.html1618#[cfg_attr(1619 not(no_diagnostic_namespace),1620 diagnostic::on_unimplemented(1621 message = "the trait bound `{Self}: serde::ser::SerializeTuple` is not satisfied",1622 )1623)]1624pub trait SerializeTuple {1625 /// Must match the `Ok` type of our `Serializer`.1626 type Ok;1627
37 unmodified lines
1665/// The [example data format] presented on the website demonstrates an1666/// implementation of `SerializeTupleStruct` for a basic JSON data format.1667///1668/// [example data format]: https://serde.rs/data-format.html1669#[cfg_attr(1670 not(no_diagnostic_namespace),1671 diagnostic::on_unimplemented(1672 message = "the trait bound `{Self}: serde::ser::SerializeTupleStruct` is not satisfied",1673 )1674)]1675pub trait SerializeTupleStruct {1676 /// Must match the `Ok` type of our `Serializer`.1677 type Ok;1678
50 unmodified lines
1729/// The [example data format] presented on the website demonstrates an1730/// implementation of `SerializeTupleVariant` for a basic JSON data format.1731///1732/// [example data format]: https://serde.rs/data-format.html1733#[cfg_attr(1734 not(no_diagnostic_namespace),1735 diagnostic::on_unimplemented(1736 message = "the trait bound `{Self}: serde::ser::SerializeTupleVariant` is not satisfied",1737 )1738)]1739pub trait SerializeTupleVariant {1740 /// Must match the `Ok` type of our `Serializer`.1741 type Ok;1742
58 unmodified lines
1801/// The [example data format] presented on the website demonstrates an1802/// implementation of `SerializeMap` for a basic JSON data format.1803///1804/// [example data format]: https://serde.rs/data-format.html1805#[cfg_attr(1806 not(no_diagnostic_namespace),1807 diagnostic::on_unimplemented(1808 message = "the trait bound `{Self}: serde::ser::SerializeMap` is not satisfied",1809 )1810)]1811pub trait SerializeMap {1812 /// Must match the `Ok` type of our `Serializer`.1813 type Ok;1814
82 unmodified lines
1897/// The [example data format] presented on the website demonstrates an1898/// implementation of `SerializeStruct` for a basic JSON data format.1899///1900/// [example data format]: https://serde.rs/data-format.html1901#[cfg_attr(1902 not(no_diagnostic_namespace),1903 diagnostic::on_unimplemented(1904 message = "the trait bound `{Self}: serde::ser::SerializeStruct` is not satisfied",1905 )1906)]1907pub trait SerializeStruct {1908 /// Must match the `Ok` type of our `Serializer`.1909 type Ok;1910
56 unmodified lines
1967/// The [example data format] presented on the website demonstrates an1968/// implementation of `SerializeStructVariant` for a basic JSON data format.1969///1970/// [example data format]: https://serde.rs/data-format.html1971#[cfg_attr(1972 not(no_diagnostic_namespace),1973 diagnostic::on_unimplemented(1974 message = "the trait bound `{Self}: serde::ser::SerializeStructVariant` is not satisfied",1975 )1976)]1977pub trait SerializeStructVariant {1978 /// Must match the `Ok` type of our `Serializer`.1979 type Ok;1980
30 unmodified lines
added:test_suite/tests/ui/unimplemented/required_by_dependency.rs+6 added
1struct MyStruct;23fn main() {4 serde_test::assert_ser_tokens(&MyStruct, &[]);5 serde_test::assert_de_tokens(&MyStruct, &[]);6}
added:test_suite/tests/ui/unimplemented/required_by_dependency.stderr+113 added
1error[E0277]: the trait bound `MyStruct: serde::Serialize` is not satisfied2 --> tests/ui/unimplemented/required_by_dependency.rs:4:353 |44 | serde_test::assert_ser_tokens(&MyStruct, &[]);5 | ----------------------------- ^^^^^^^^^ unsatisfied trait bound6 | |7 | required by a bound introduced by this call8 |9help: the trait `serde_core::ser::Serialize` is not implemented for `MyStruct`10 --> tests/ui/unimplemented/required_by_dependency.rs:1:111 |121 | struct MyStruct;13 | ^^^^^^^^^^^^^^^14 = note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type15 = note: for types from other crates check whether the crate offers a `serde` feature flag16 = help: the following other types implement trait `serde_core::ser::Serialize`:17 &'a T18 &'a mut T19 ()20 (T,)21 (T0, T1)22 (T0, T1, T2)23 (T0, T1, T2, T3)24 (T0, T1, T2, T3, T4)25 and $N others26note: required by a bound in `assert_ser_tokens`27 --> $CARGO/serde_test-$VERSION/src/assert.rs28 |29 | pub fn assert_ser_tokens<T>(value: &T, tokens: &[Token])30 | ----------------- required by a bound in this function31 | where32 | T: ?Sized + Serialize,33 | ^^^^^^^^^ required by this bound in `assert_ser_tokens`3435error[E0277]: the trait bound `MyStruct: serde::Deserialize<'de>` is not satisfied36 --> tests/ui/unimplemented/required_by_dependency.rs:5:3437 |385 | serde_test::assert_de_tokens(&MyStruct, &[]);39 | ---------------------------- ^^^^^^^^^ unsatisfied trait bound40 | |41 | required by a bound introduced by this call42 |43help: the trait `serde_core::de::Deserialize<'_>` is not implemented for `MyStruct`44 --> tests/ui/unimplemented/required_by_dependency.rs:1:145 |461 | struct MyStruct;47 | ^^^^^^^^^^^^^^^48 = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type49 = note: for types from other crates check whether the crate offers a `serde` feature flag50 = help: the following other types implement trait `serde_core::de::Deserialize<'de>`:51 &'a Path52 &'a [u8]53 &'a str54 ()55 (T,)56 (T0, T1)57 (T0, T1, T2)58 (T0, T1, T2, T3)59 and $N others60note: required by a bound in `assert_de_tokens`61 --> $CARGO/serde_test-$VERSION/src/assert.rs62 |63 | pub fn assert_de_tokens<'de, T>(value: &T, tokens: &'de [Token])64 | ---------------- required by a bound in this function65 | where66 | T: Deserialize<'de> + PartialEq + Debug,67 | ^^^^^^^^^^^^^^^^ required by this bound in `assert_de_tokens`6869error[E0277]: can't compare `MyStruct` with `MyStruct`70 --> tests/ui/unimplemented/required_by_dependency.rs:5:3471 |725 | serde_test::assert_de_tokens(&MyStruct, &[]);73 | ---------------------------- ^^^^^^^^^ no implementation for `MyStruct == MyStruct`74 | |75 | required by a bound introduced by this call76 |77 = help: the trait `PartialEq` is not implemented for `MyStruct`78note: required by a bound in `assert_de_tokens`79 --> $CARGO/serde_test-$VERSION/src/assert.rs80 |81 | pub fn assert_de_tokens<'de, T>(value: &T, tokens: &'de [Token])82 | ---------------- required by a bound in this function83 | where84 | T: Deserialize<'de> + PartialEq + Debug,85 | ^^^^^^^^^ required by this bound in `assert_de_tokens`86help: consider annotating `MyStruct` with `#[derive(PartialEq)]`87 |88 1 + #[derive(PartialEq)]89 2 | struct MyStruct;90 |9192error[E0277]: `MyStruct` doesn't implement `Debug`93 --> tests/ui/unimplemented/required_by_dependency.rs:5:3494 |955 | serde_test::assert_de_tokens(&MyStruct, &[]);96 | ---------------------------- ^^^^^^^^^ the trait `Debug` is not implemented for `MyStruct`97 | |98 | required by a bound introduced by this call99 |100 = note: add `#[derive(Debug)]` to `MyStruct` or manually `impl Debug for MyStruct`101note: required by a bound in `assert_de_tokens`102 --> $CARGO/serde_test-$VERSION/src/assert.rs103 |104 | pub fn assert_de_tokens<'de, T>(value: &T, tokens: &'de [Token])105 | ---------------- required by a bound in this function106 | where107 | T: Deserialize<'de> + PartialEq + Debug,108 | ^^^^^ required by this bound in `assert_de_tokens`109help: consider annotating `MyStruct` with `#[derive(Debug)]`110 |111 1 + #[derive(Debug)]112 2 | struct MyStruct;113 |
added:test_suite/tests/ui/unimplemented/required_locally.rs+23 added
1use serde::de::Deserialize;2use serde::ser::Serialize;34fn to_string<T>(_: &T) -> String5where6 T: Serialize,7{8 unimplemented!()9}1011fn from_str<'de, T>(_: &'de str) -> T12where13 T: Deserialize<'de>,14{15 unimplemented!()16}1718struct MyStruct;1920fn main() {21 to_string(&MyStruct);22 let _: MyStruct = from_str("");23}
added:test_suite/tests/ui/unimplemented/required_locally.stderr+65 added
1error[E0277]: the trait bound `MyStruct: serde::Serialize` is not satisfied2 --> tests/ui/unimplemented/required_locally.rs:21:153 |421 | to_string(&MyStruct);5 | --------- ^^^^^^^^^ unsatisfied trait bound6 | |7 | required by a bound introduced by this call8 |9help: the trait `Serialize` is not implemented for `MyStruct`10 --> tests/ui/unimplemented/required_locally.rs:18:111 |1218 | struct MyStruct;13 | ^^^^^^^^^^^^^^^14 = note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type15 = note: for types from other crates check whether the crate offers a `serde` feature flag16 = help: the following other types implement trait `Serialize`:17 &'a T18 &'a mut T19 ()20 (T,)21 (T0, T1)22 (T0, T1, T2)23 (T0, T1, T2, T3)24 (T0, T1, T2, T3, T4)25 and $N others26note: required by a bound in `to_string`27 --> tests/ui/unimplemented/required_locally.rs:6:828 |29 4 | fn to_string<T>(_: &T) -> String30 | --------- required by a bound in this function31 5 | where32 6 | T: Serialize,33 | ^^^^^^^^^ required by this bound in `to_string`3435error[E0277]: the trait bound `MyStruct: serde::Deserialize<'de>` is not satisfied36 --> tests/ui/unimplemented/required_locally.rs:22:2337 |3822 | let _: MyStruct = from_str("");39 | ^^^^^^^^^^^^ unsatisfied trait bound40 |41help: the trait `Deserialize<'_>` is not implemented for `MyStruct`42 --> tests/ui/unimplemented/required_locally.rs:18:143 |4418 | struct MyStruct;45 | ^^^^^^^^^^^^^^^46 = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type47 = note: for types from other crates check whether the crate offers a `serde` feature flag48 = help: the following other types implement trait `Deserialize<'de>`:49 &'a Path50 &'a [u8]51 &'a str52 ()53 (T,)54 (T0, T1)55 (T0, T1, T2)56 (T0, T1, T2, T3)57 and $N others58note: required by a bound in `from_str`59 --> tests/ui/unimplemented/required_locally.rs:13:860 |6111 | fn from_str<'de, T>(_: &'de str) -> T62 | -------- required by a bound in this function6312 | where6413 | T: Deserialize<'de>,65 | ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
modified:test_suite/tests/ui/with/incorrect_type.stderr+4 added-4 removed
1error[E0277]: the trait bound `&u8: Serializer` is not satisfied1error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied2 --> tests/ui/with/incorrect_type.rs:14:103 |414 | #[derive(Serialize, Deserialize)]5 | ^^^^^^^^^ the trait `Serializer` is not implemented for `&u8`
23 unmodified lines
29 |30 9 | pub fn serialize<T, S: Serializer>(_: S) -> Result<S::Ok, S::Error> {31 | ^^^^^^^^^3233error[E0277]: the trait bound `&u8: Serializer` is not satisfied33error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied34 --> tests/ui/with/incorrect_type.rs:15:2535 |3615 | struct W(#[serde(with = "w")] u8, u8);37 | ^^^ the trait `Serializer` is not implemented for `&u8`
10 unmodified lines
48 | ^^^ expected `u8`, found `()`49 |50 = note: `?` operator cannot convert from `()` to `u8`5152error[E0277]: the trait bound `&u8: Serializer` is not satisfied52error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied53 --> tests/ui/with/incorrect_type.rs:17:1054 |5517 | #[derive(Serialize, Deserialize)]56 | ^^^^^^^^^ the trait `Serializer` is not implemented for `&u8`
23 unmodified lines
80 |81 9 | pub fn serialize<T, S: Serializer>(_: S) -> Result<S::Ok, S::Error> {82 | ^^^^^^^^^8384error[E0277]: the trait bound `&u8: Serializer` is not satisfied84error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied85 --> tests/ui/with/incorrect_type.rs:18:3586 |8718 | struct S(#[serde(serialize_with = "w::serialize")] u8, u8);88 | ^^^^^^^^^^^^^^ the trait `Serializer` is not implemented for `&u8`
13 unmodified lines
deleted:test_suite/tests/ui/on_unimplemented.rs-23 removed
1use serde::de::Deserialize;2use serde::ser::Serialize;34fn to_string<T>(_: &T) -> String5where6 T: Serialize,7{8 unimplemented!()9}1011fn from_str<'de, T>(_: &'de str) -> T12where13 T: Deserialize<'de>,14{15 unimplemented!()16}1718struct MyStruct;1920fn main() {21 to_string(&MyStruct);22 let _: MyStruct = from_str("");23}
deleted:test_suite/tests/ui/on_unimplemented.stderr-65 removed
1error[E0277]: the trait bound `MyStruct: Serialize` is not satisfied2 --> tests/ui/on_unimplemented.rs:21:153 |421 | to_string(&MyStruct);5 | --------- ^^^^^^^^^ unsatisfied trait bound6 | |7 | required by a bound introduced by this call8 |9help: the trait `Serialize` is not implemented for `MyStruct`10 --> tests/ui/on_unimplemented.rs:18:111 |1218 | struct MyStruct;13 | ^^^^^^^^^^^^^^^14 = note: for local types consider adding `#[derive(serde::Serialize)]` to your `MyStruct` type15 = note: for types from other crates check whether the crate offers a `serde` feature flag16 = help: the following other types implement trait `Serialize`:17 &'a T18 &'a mut T19 ()20 (T,)21 (T0, T1)22 (T0, T1, T2)23 (T0, T1, T2, T3)24 (T0, T1, T2, T3, T4)25 and $N others26note: required by a bound in `to_string`27 --> tests/ui/on_unimplemented.rs:6:828 |29 4 | fn to_string<T>(_: &T) -> String30 | --------- required by a bound in this function31 5 | where32 6 | T: Serialize,33 | ^^^^^^^^^ required by this bound in `to_string`3435error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied36 --> tests/ui/on_unimplemented.rs:22:2337 |3822 | let _: MyStruct = from_str("");39 | ^^^^^^^^^^^^ unsatisfied trait bound40 |41help: the trait `Deserialize<'_>` is not implemented for `MyStruct`42 --> tests/ui/on_unimplemented.rs:18:143 |4418 | struct MyStruct;45 | ^^^^^^^^^^^^^^^46 = note: for local types consider adding `#[derive(serde::Deserialize)]` to your `MyStruct` type47 = note: for types from other crates check whether the crate offers a `serde` feature flag48 = help: the following other types implement trait `Deserialize<'de>`:49 &'a Path50 &'a [u8]51 &'a str52 ()53 (T,)54 (T0, T1)55 (T0, T1, T2)56 (T0, T1, T2, T3)57 and $N others58note: required by a bound in `from_str`59 --> tests/ui/on_unimplemented.rs:13:860 |6111 | fn from_str<'de, T>(_: &'de str) -> T62 | -------- required by a bound in this function6312 | where6413 | T: Deserialize<'de>,65 | ^^^^^^^^^^^^^^^^ required by this bound in `from_str`