-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[rustdoc] Correctly handle should_panic
doctest attribute and fix --no-run
test flag on the 2024 edition
#143900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This PR modifies cc @jieyouxu |
This comment has been minimized.
This comment has been minimized.
I... do not see anything like that in the patch? There's two checks for exit code 101. |
Woups, copied/pasted comment from original PR which was outdated after discussion with you (on the previous PR). ^^' EDIT: Updated comment. |
if langstr.should_panic {
if out.status.code() == Some(101) {
return Ok(());
} else if out.status.success() {
return Err(TestFailure::UnexpectedRunPass);
}
}
if !out.status.success() {
return Err(TestFailure::ExecutionFailure(out));
} Do you think something like this would make sense, so that it's easier for the user to differentiate between aborts and panic-less success? |
|
Wouldn't changing |
That wouldn't cover |
I've amended my comment a moment before you replied, apologies. |
Replied too fast then. 😅 The message for |
I think we're talking past each other. I suggest that:
Wouldn't that work? |
I still think it's too general. For end users, |
That makes sense, yeah. Let's delay it until after this PR lands then. |
☔ The latest upstream changes (presumably #144692) made this pull request unmergeable. Please resolve the merge conflicts. |
72aadc6
to
248c61c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
248c61c
to
c365e6e
Compare
This comment has been minimized.
This comment has been minimized.
…Amanieu Make `libtest::ERROR_EXIT_CODE` const public to not redefine it in rustdoc I think it's better to make this constant public so it can be used by crates using `libtest` as dependency. As a side-note, I will update rust-lang#143900 to make use of this constant once this is current PR is merged.
Why can't I reproduce this bug locally? O.o |
Maybe attempt a bors try (I haven't the required privileges to do it, you'll have to request it from someone else). |
I have the needed rights, just surprised that it keeps failing in CI and not locally. @bors try |
[rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition
…Amanieu Make `libtest::ERROR_EXIT_CODE` const public to not redefine it in rustdoc I think it's better to make this constant public so it can be used by crates using `libtest` as dependency. As a side-note, I will update rust-lang#143900 to make use of this constant once this is current PR is merged.
So seems like it's another PR that creates an issue with this common PR. Let's wait a bit before putting it back in I guess... |
Since I've r-ed -:, let's r+ back but iffy: @bors r=lolbinarycat,fmease rollup=iffy |
[rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition Fixes #143009. Fixes #143858. Since it includes fixes from #143453, it's taking it over (commits 2, 3 and 4 are from #143453). For `--no-run`, we forgot to check the "global" options in the 2024 edition, fixed in the first commit. For `should_panic` fix, the exit code check has been fixed. cc `@TroyKomodo` (thanks so much for providing such a complete test, made my life a lot easier!) r? `@notriddle`
…narycat,fmease [rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition Fixes rust-lang#143009. Fixes rust-lang#143858. Since it includes fixes from rust-lang#143453, it's taking it over (commits 2, 3 and 4 are from rust-lang#143453). For `--no-run`, we forgot to check the "global" options in the 2024 edition, fixed in the first commit. For `should_panic` fix, the exit code check has been fixed. cc `@TroyKomodo` (thanks so much for providing such a complete test, made my life a lot easier!) r? `@notriddle`
Rollup of 14 pull requests Successful merges: - #143857 (Port #[macro_export] to the new attribute parsing infrastructure) - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition) - #144070 (Implement `hash_map` macro ) - #144322 (Add lint against dangling pointers from local variables) - #144443 (Make target pointer width in target json an integer) - #144667 (`AlignmentEnum` should just be `repr(usize)` now) - #144779 (Implement debugging output of the bootstrap Step graph into a DOT file) - #144790 (Multiple bounds checking elision failures) - #144794 (Port `#[coroutine]` to the new attribute system) - #144808 (`Interner` arg to `EarlyBinder` does not affect auto traits) - #144816 (Update E0562 to account for the new impl trait positions) - #144822 (Return a struct with named fields from `hash_owner_nodes`) - #144824 (Updated test links in compiler) - #144829 (Use full flag name in strip command for Darwin) r? `@ghost` `@rustbot` modify labels: rollup
[rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition Fixes #143009. Fixes #143858. Since it includes fixes from #143453, it's taking it over (commits 2, 3 and 4 are from #143453). For `--no-run`, we forgot to check the "global" options in the 2024 edition, fixed in the first commit. For `should_panic` fix, the exit code check has been fixed. cc `@TroyKomodo` (thanks so much for providing such a complete test, made my life a lot easier!) r? `@notriddle`
…narycat,fmease [rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition Fixes rust-lang#143009. Fixes rust-lang#143858. Since it includes fixes from rust-lang#143453, it's taking it over (commits 2, 3 and 4 are from rust-lang#143453). For `--no-run`, we forgot to check the "global" options in the 2024 edition, fixed in the first commit. For `should_panic` fix, the exit code check has been fixed. cc `@TroyKomodo` (thanks so much for providing such a complete test, made my life a lot easier!) r? `@notriddle`
Rollup of 13 pull requests Successful merges: - #143857 (Port #[macro_export] to the new attribute parsing infrastructure) - #143900 ([rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition) - #144070 (Implement `hash_map` macro ) - #144322 (Add lint against dangling pointers from local variables) - #144443 (Make target pointer width in target json an integer) - #144667 (`AlignmentEnum` should just be `repr(usize)` now) - #144790 (Multiple bounds checking elision failures) - #144794 (Port `#[coroutine]` to the new attribute system) - #144808 (`Interner` arg to `EarlyBinder` does not affect auto traits) - #144816 (Update E0562 to account for the new impl trait positions) - #144822 (Return a struct with named fields from `hash_owner_nodes`) - #144824 (Updated test links in compiler) - #144829 (Use full flag name in strip command for Darwin) r? `@ghost` `@rustbot` modify labels: rollup
[rustdoc] Correctly handle `should_panic` doctest attribute and fix `--no-run` test flag on the 2024 edition Fixes #143009. Fixes #143858. Since it includes fixes from #143453, it's taking it over (commits 2, 3 and 4 are from #143453). For `--no-run`, we forgot to check the "global" options in the 2024 edition, fixed in the first commit. For `should_panic` fix, the exit code check has been fixed. cc `@TroyKomodo` (thanks so much for providing such a complete test, made my life a lot easier!) r? `@notriddle`
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Fixes #143009.
Fixes #143858.
Since it includes fixes from #143453, it's taking it over (commits 2, 3 and 4 are from #143453).
For
--no-run
, we forgot to check the "global" options in the 2024 edition, fixed in the first commit.For
should_panic
fix, the exit code check has been fixed.cc @TroyKomodo (thanks so much for providing such a complete test, made my life a lot easier!)
r? @notriddle