diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-04-25 22:04:50 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-04-25 22:04:50 +0200 |
| commit | 3ef98a55ef95b058e55897f1b213dd965839e3ed (patch) | |
| tree | 2e633ff2bbfb15b91b38e96aab490a5a68a90f83 /tests/rustdoc-ui/doctest | |
| parent | 3ededc1053f752d993a0b25286faebfe3616819d (diff) | |
| download | rust-3ef98a55ef95b058e55897f1b213dd965839e3ed.tar.gz rust-3ef98a55ef95b058e55897f1b213dd965839e3ed.zip | |
If there is a `;` alone, we consider that the doctest needs to be put inside a function
Diffstat (limited to 'tests/rustdoc-ui/doctest')
| -rw-r--r-- | tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.rs | 4 | ||||
| -rw-r--r-- | tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.stdout | 27 |
2 files changed, 4 insertions, 27 deletions
diff --git a/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.rs b/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.rs index 508faadcf67..ca5dd787467 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.rs +++ b/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.rs @@ -4,12 +4,12 @@ //@ compile-flags:--test //@ normalize-stdout: "tests/rustdoc-ui/doctest" -> "$$DIR" //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" -//@ failure-status: 101 +//@ check-pass /// <https://github.com/rust-lang/rust/issues/91014> /// /// ```rust -/// struct S {}; // unexpected semicolon after struct def +/// struct S {}; /// /// fn main() { /// assert_eq!(0, 1); diff --git a/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.stdout b/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.stdout index 9eb8b391e78..1068b98cb0f 100644 --- a/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.stdout +++ b/tests/rustdoc-ui/doctest/failed-doctest-extra-semicolon-on-item.stdout @@ -1,29 +1,6 @@ running 1 test -test $DIR/failed-doctest-extra-semicolon-on-item.rs - m (line 11) ... FAILED +test $DIR/failed-doctest-extra-semicolon-on-item.rs - m (line 11) ... ok -failures: - ----- $DIR/failed-doctest-extra-semicolon-on-item.rs - m (line 11) stdout ---- -error: expected item, found `;` - --> $DIR/failed-doctest-extra-semicolon-on-item.rs:12:12 - | -LL | struct S {}; // unexpected semicolon after struct def - | ^ - | - = help: braced struct declarations are not followed by a semicolon -help: remove this semicolon - | -LL - struct S {}; // unexpected semicolon after struct def -LL + struct S {} // unexpected semicolon after struct def - | - -error: aborting due to 1 previous error - -Couldn't compile the test. - -failures: - $DIR/failed-doctest-extra-semicolon-on-item.rs - m (line 11) - -test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME +test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME |
