Skip to content

Commit f62e93c

Browse files
authored
Merge pull request #1256 from mattheww/2022-08_termination
Update examples of what implements `Termination`
2 parents 28d60fb + c126440 commit f62e93c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/attributes/testing.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ functions are only compiled when in test mode. Test functions must be free,
1212
monomorphic functions that take no arguments, and the return type must implement the [`Termination`] trait, for example:
1313

1414
* `()`
15-
* `Result<(), E> where E: Debug`
15+
* `Result<T, E> where T: Termination, E: Debug`
1616
* `!`
17-
<!-- * Result<!, E> where E: Debug` -->
1817

1918
<!-- If the previous section needs updating (from "must take no arguments"
2019
onwards, also update it in the crates-and-source-files.md file -->

src/crates-and-source-files.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,9 @@ fn main() -> impl std::process::Termination {
123123
>
124124
> * `()`
125125
> * [`!`]
126+
> * [`Infallible`]
126127
> * [`ExitCode`]
127-
> * `Result<(), E> where E: Debug`
128-
> * `Result<Infallible, E> where E: Debug`
129-
<!-- > * Result<!, E> where E: Debug` -->
128+
> * `Result<T, E> where T: Termination, E: Debug`
130129
131130
<!-- If the previous section needs updating (from "must take no arguments"
132131
onwards, also update it in the testing.md file -->
@@ -165,6 +164,7 @@ or `_` (U+005F) characters.
165164
[_shebang_]: https://en.wikipedia.org/wiki/Shebang_(Unix)
166165
[_utf8 byte order mark_]: https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8
167166
[`ExitCode`]: ../std/process/struct.ExitCode.html
167+
[`Infallible`]: ../std/convert/enum.Infallible.html
168168
[`Termination`]: ../std/process/trait.Termination.html
169169
[attribute]: attributes.md
170170
[attributes]: attributes.md

0 commit comments

Comments
 (0)