-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc: use the correct span for doctests
- Loading branch information
Showing
5 changed files
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
With a code sample, that has an error: | ||
|
||
```rust | ||
fn main() { | ||
let x = 234 // no semicolon here! oh no! | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@ compile-flags:--test --test-args=--test-threads=1 | ||
//@ normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR" | ||
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME" | ||
//@ failure-status: 101 | ||
|
||
// https://github.com/rust-lang/rust/issues/130470 | ||
#![doc = include_str!("doctest-output-include-fail.md")] |
24 changes: 24 additions & 0 deletions
24
tests/rustdoc-ui/doctest/doctest-output-include-fail.stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
running 1 test | ||
test $DIR/doctest-output-include-fail.md - (line 3) ... FAILED | ||
|
||
failures: | ||
|
||
---- $DIR/doctest-output-include-fail.md - (line 3) stdout ---- | ||
error: expected `;`, found `}` | ||
--> $DIR/doctest-output-include-fail.md:5:16 | ||
| | ||
LL | let x = 234 // no semicolon here! oh no! | ||
| ^ help: add `;` here | ||
LL | } | ||
| - unexpected token | ||
|
||
error: aborting due to 1 previous error | ||
|
||
Couldn't compile the test. | ||
|
||
failures: | ||
$DIR/doctest-output-include-fail.md - (line 3) | ||
|
||
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters