Mark every trait impl for a private type with do_not_recommend

This commit is contained in:
David Tolnay
2025-09-14 19:45:07 -07:00
parent 6c316d7cb5
commit bf9ebea392
6 changed files with 87 additions and 16 deletions
+4 -16
View File
@@ -6,10 +6,7 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
15 | struct W(#[serde(with = "w")] u8, u8);
| --- required by a bound introduced by this call
|
= help: the following other types implement trait `Serializer`:
&mut Formatter<'a>
FlatMapSerializer<'a, M>
_::_serde::__private::ser::content::ContentSerializer<E>
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
note: required by a bound in `w::serialize`
--> tests/ui/with/incorrect_type.rs:9:28
|
@@ -36,10 +33,7 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
15 | struct W(#[serde(with = "w")] u8, u8);
| ^^^ the trait `Serializer` is not implemented for `&u8`
|
= help: the following other types implement trait `Serializer`:
&mut Formatter<'a>
FlatMapSerializer<'a, M>
_::_serde::__private::ser::content::ContentSerializer<E>
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
error[E0308]: `?` operator has incompatible types
--> tests/ui/with/incorrect_type.rs:15:25
@@ -57,10 +51,7 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
18 | struct S(#[serde(serialize_with = "w::serialize")] u8, u8);
| -------------- required by a bound introduced by this call
|
= help: the following other types implement trait `Serializer`:
&mut Formatter<'a>
FlatMapSerializer<'a, M>
_::_serde::__private::ser::content::ContentSerializer<E>
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
note: required by a bound in `w::serialize`
--> tests/ui/with/incorrect_type.rs:9:28
|
@@ -87,10 +78,7 @@ error[E0277]: the trait bound `&u8: serde::Serializer` is not satisfied
18 | struct S(#[serde(serialize_with = "w::serialize")] u8, u8);
| ^^^^^^^^^^^^^^ the trait `Serializer` is not implemented for `&u8`
|
= help: the following other types implement trait `Serializer`:
&mut Formatter<'a>
FlatMapSerializer<'a, M>
_::_serde::__private::ser::content::ContentSerializer<E>
= help: the trait `Serializer` is implemented for `&mut Formatter<'a>`
error[E0308]: `?` operator has incompatible types
--> tests/ui/with/incorrect_type.rs:21:37