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

Flatten bool arguments under -Zflatten-format-args=yes #111995

Open
KisaragiEffective opened this issue May 26, 2023 · 1 comment
Open

Flatten bool arguments under -Zflatten-format-args=yes #111995

KisaragiEffective opened this issue May 26, 2023 · 1 comment
Assignees
Labels
A-fmt Area: `core::fmt` I-slow Issue: Problems and improvements with respect to performance of generated code. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@KisaragiEffective
Copy link
Contributor

KisaragiEffective commented May 26, 2023

cc #78356

The following code can be optimized:

// pub is avoiding DCE on godbolt, please ignore it
pub fn main() {
    println!("Hello World {}", false);
}

as if written as:

pub fn main() {
    println!("Hello World false");
}

compiler version: rustc 1.71.0-nightly (a2b1646c5 2023-05-25)

@rustbot label: +I-slow

@rustbot rustbot added the I-slow Issue: Problems and improvements with respect to performance of generated code. label May 26, 2023
@jyn514 jyn514 added T-libs Relevant to the library team, which will review and decide on the PR/issue. A-fmt Area: `core::fmt` labels May 26, 2023
@m-ou-se m-ou-se self-assigned this Jul 5, 2023
@m-ou-se
Copy link
Member

m-ou-se commented Jul 5, 2023

@KisaragiEffective Do you have any real world examples that would benefit from inlining boolean literals into format_args?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-fmt Area: `core::fmt` I-slow Issue: Problems and improvements with respect to performance of generated code. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants