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

specialize impl of ToString on bool #106662

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

Ezrashaw
Copy link
Contributor

Fixes #106611

Specialize bools ToString impl by copying it from Display. This is a significant optimization as we avoid lots of dynamic dispatch. AFAIK, this doesn't require a API Change Proposal as this doesn't regress existing code and can be undone without regressing code.

@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2023

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 10, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 10, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@cuviper
Copy link
Member

cuviper commented Jan 10, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 10, 2023

📌 Commit 203bbfa has been approved by cuviper

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 10, 2023

🌲 The tree is currently closed for pull requests below priority 999. This pull request will be tested once the tree is reopened.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 11, 2023
Rollup of 14 pull requests

Successful merges:

 - rust-lang#105194 (Add comment to cleanup_kinds)
 - rust-lang#106521 (remove E0280)
 - rust-lang#106628 (Remove unneeded ItemId::Primitive variant)
 - rust-lang#106635 (std sync tests: better type name, clarifying comment)
 - rust-lang#106642 (Add test for rust-lang#106062)
 - rust-lang#106645 ([RFC 2397] Initial implementation)
 - rust-lang#106653 (Fix help docs for -Zallow-features)
 - rust-lang#106657 (Remove myself from rust-lang/rust reviewers)
 - rust-lang#106662 (specialize impl of `ToString` on `bool`)
 - rust-lang#106669 (create helper function for `rustc_lint_defs::Level` and remove it's duplicated code)
 - rust-lang#106671 (Change flags with a fixed default value from Option<bool> to bool)
 - rust-lang#106689 (Fix invalid files array re-creation in rustdoc-gui tester)
 - rust-lang#106690 (Fix scrolling for item declaration block)
 - rust-lang#106698 (Add compiler-errors to some trait system notification groups)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit feca61e into rust-lang:master Jan 11, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 11, 2023
@Ezrashaw Ezrashaw deleted the specialize-bool-tostring branch January 11, 2023 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inefficient code generated from ToString::to_string() for bool
4 participants