Skip to content

tests: Don't check for self-printed output in std-backtrace.rs test #143401

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Jul 3, 2025

The Display implementation for Backtrace used to print

stack backtrace:

but that print was since removed. See rust-lang/backtrace-rs#286 and #69042. To make the existing test pass, the print was added to the test instead. But it doesn't make sense to check for something that the test itself does since that will not detect any regressions in the implementation of Backtrace.

What the test should check is that "stack backtrace:" is not printed in Display of Backtrace. So do that instead.

This is one small steps towards resolving #71706. The next steps after this step involves extending and hardening that test further.

@rustbot
Copy link
Collaborator

rustbot commented Jul 3, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 3, 2025
@Enselic
Copy link
Member Author

Enselic commented Jul 4, 2025

For the record I'm also fine with removing all "stack backtrace" checks if that is what my reviewer prefers.

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's much point in checking "stack backtrace" isn't present, the only reason we think to check at all is because it was previously present, it's not especially important that it isn't there.

r=me after that

@davidtwco davidtwco added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 8, 2025
The `Display` implementation for `Backtrace` used to print

    stack backtrace:

but that print was later removed. To make the existing test pass, the
print was added to the existing test. But it doesn't make sense to check
for something that the test itself does since that will not detect any
regressions in the implementation of `Backtrace`. Fully remove the
checks.
@Enselic Enselic force-pushed the no-stack-backtrace-print-in-display branch from 715362b to 54cc45d Compare July 9, 2025 07:56
@Enselic
Copy link
Member Author

Enselic commented Jul 9, 2025

I completely agree. I wasn't sure what my (then unknown) reviewer would think though so I went with the most defensive correction.

(I'm only part of wg-triage so I can't r without @bors delegate+.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants