Skip to content

Conversation

@dishmaker
Copy link
Contributor

186 llvm-lines less on rustc 1.91.1

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Most of that reduction is coming from write!(formatter, "{}", expr)➡️Display::fmt(&expr, formatter).

That transformation is not generally correct inside a Display impl. When there is width, fill, alignment, or other formatting options on the incoming formatter, applying those onto every path segment is almost certainly not what the caller would expect.

I am open to arranging this code in some way that is not a Display impl, but while it is a Display impl it needs to be written correctly as a Display impl.

@dtolnay dtolnay closed this Nov 20, 2025
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.

2 participants