diff options
| author | Andre Bogus <bogusandre@gmail.com> | 2019-05-28 19:10:39 +0200 |
|---|---|---|
| committer | Andre Bogus <bogusandre@gmail.com> | 2019-05-28 19:10:39 +0200 |
| commit | 6bb6c001be34d0932a014df981ee18f165c43374 (patch) | |
| tree | 566572ce7fe6ba14e58e5121c6c4ad5e0e36ef1a /src/test/rustdoc | |
| parent | 7da118581c9dc839c8bf3fbb622bab9ce32bbf38 (diff) | |
| download | rust-6bb6c001be34d0932a014df981ee18f165c43374.tar.gz rust-6bb6c001be34d0932a014df981ee18f165c43374.zip | |
implicit `Option`-returning doctests
This distinguishes `Option` and `Result`-returning doctests with implicit `main` method, where the former tests must end with `Some(())`.
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/process-termination.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/rustdoc/process-termination.rs b/src/test/rustdoc/process-termination.rs index 32258792b6e..31ae0143d47 100644 --- a/src/test/rustdoc/process-termination.rs +++ b/src/test/rustdoc/process-termination.rs @@ -21,4 +21,16 @@ /// Err("This is returned from `main`, leading to panic")?; /// Ok::<(), &'static str>(()) /// ``` +/// +/// This also works with `Option<()>`s now: +/// +/// ```rust +/// Some(()) +/// ``` +/// +/// ```rust,should_panic +/// let x: &[u32] = &[]; +/// let _ = x.iter().next()?; +/// Some(()) +/// ``` pub fn check_process_termination() {} |
