Skip to content
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

Update backtrace Debug formatting #261

Closed
wants to merge 17 commits into from

Conversation

0paIescent
Copy link

Part of the PR for an issue over at rust-lang/rust here. Once this gets merged here, I'll submit the PR over there, just want to make sure everything integrates properly first.

@alexcrichton
Copy link
Member

Thanks for the PR here @0paIescent!

The changes in rust-lang/rust#65280 all sound reasonable to me, but I might recommend organizing this a bit differently. In the standard library we want to continue to have two implementations for std::fmt traits, one for Display and one for Debug. Today they are the same but I think we want Display's rendering to stay as-is and only Debug's rendering should be updated to use a flat array-like structure. In that sense I think this change will want to continue to support both renderings, chosen via methods and/or an enum value. I'd recommend leaving the currently builder largely as-is but adding something new which takes a fmt::DebugList (or something like that) for the debug implementation improvements.

Does that make sense?

With all that in place I think we'll want to update libstd to have a new Debug implementation (using the builder), but I think this library itself will want to keep Debug using the same rendering it has today. I want to be sure to not unexpectedly change a bunch of code relying on this crate in the wild by accident!

@0paIescent
Copy link
Author

Of course! You make some great points, I'll definitely keep those in mind when I refactor these changes.

Thanks for the tips!

@workingjubilee
Copy link
Contributor

Hello, it has been a while since this PR was opened and it has accumulated a number of conflicts and is likely to have a different reception in the year 2024. So, I am closing it for now, but if you wish to pursue this again, please feel free to open a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants