Skip to content

Commit

Permalink
Add test of 'following other types' diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 6, 2024
1 parent 883a38d commit 6184f60
Showing 1 changed file with 151 additions and 0 deletions.
151 changes: 151 additions & 0 deletions src/tests/and-others-verbose.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
test_normalize! {r#"
error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied
--> tests/ui/on_unimplemented.rs:22:23
|
22 | let _: MyStruct = from_str("");
| ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
note: required by a bound in `from_str`
--> tests/ui/on_unimplemented.rs:13:8
|
11 | fn from_str<'de, T>(_: &'de str) -> T
| -------- required by a bound in this function
12 | where
13 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied
--> tests/ui/on_unimplemented.rs:22:23
|
22 | let _: MyStruct = from_str("");
| ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
note: required by a bound in `from_str`
--> tests/ui/on_unimplemented.rs:13:8
|
11 | fn from_str<'de, T>(_: &'de str) -> T
| -------- required by a bound in this function
12 | where
13 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied
--> tests/ui/on_unimplemented.rs:22:23
|
22 | let _: MyStruct = from_str("");
| ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
note: required by a bound in `from_str`
--> tests/ui/on_unimplemented.rs:13:8
|
11 | fn from_str<'de, T>(_: &'de str) -> T
| -------- required by a bound in this function
12 | where
13 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
"# r#"
error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied
--> tests/ui/on_unimplemented.rs:22:23
|
22 | let _: MyStruct = from_str("");
| ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
note: required by a bound in `from_str`
--> tests/ui/on_unimplemented.rs:13:8
|
11 | fn from_str<'de, T>(_: &'de str) -> T
| -------- required by a bound in this function
12 | where
13 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied
--> tests/ui/on_unimplemented.rs:22:23
|
22 | let _: MyStruct = from_str("");
| ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
note: required by a bound in `from_str`
--> tests/ui/on_unimplemented.rs:13:8
|
11 | fn from_str<'de, T>(_: &'de str) -> T
| -------- required by a bound in this function
12 | where
13 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
error[E0277]: the trait bound `MyStruct: Deserialize<'_>` is not satisfied
--> tests/ui/on_unimplemented.rs:22:23
|
22 | let _: MyStruct = from_str("");
| ^^^^^^^^^^^^ the trait `Deserialize<'_>` is not implemented for `MyStruct`
|
= help: the following other types implement trait `Deserialize<'de>`:
&'a Path
&'a [u8]
&'a str
()
(T,)
(T0, T1)
(T0, T1, T2)
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
(T0, T1, T2, T3, T4, T5)
note: required by a bound in `from_str`
--> tests/ui/on_unimplemented.rs:13:8
|
11 | fn from_str<'de, T>(_: &'de str) -> T
| -------- required by a bound in this function
12 | where
13 | T: Deserialize<'de>,
| ^^^^^^^^^^^^^^^^ required by this bound in `from_str`
"#}

0 comments on commit 6184f60

Please sign in to comment.