Skip to content

Comments

Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned#152865

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
asder8215:path_display
Feb 22, 2026
Merged

Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned#152865
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
asder8215:path_display

Conversation

@asder8215
Copy link
Contributor

@asder8215 asder8215 commented Feb 19, 2026

Fixes #152804. Path's Display uses ByteStr's Display, which is where the problem was occurring.

The issue was coming from ByteStr implementation of fmt() in this particular area:

        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };

The docs for the align implies that Alignment::Left, Alignment::Right, Alignment::Center comes from :<, :>, and :^ respectively with align() returning None if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:

assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");

We shouldn't write to f and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet

@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 Feb 19, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 19, 2026

joboet is currently at their maximum review capacity.
They may take a while to respond.

@asder8215 asder8215 changed the title Fixed ByteStr not padding within its Display trait when no specific a… Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned Feb 19, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 20, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 20, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 20, 2026
…lignment is not mentioned (e.g. ':10' instead of ':<10', ':>10', or ':^1')
@asder8215
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 20, 2026
@asder8215 asder8215 requested a review from joboet February 20, 2026 22:54
@joboet
Copy link
Member

joboet commented Feb 21, 2026

Great, thanks!
@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

📌 Commit d6ff921 has been approved by joboet

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Feb 21, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 21, 2026
Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned

Fixes rust-lang#152804. `Path`'s `Display` uses `ByteStr`'s `Display`, which is where the problem was occurring.

The issue was coming from `ByteStr` implementation of `fmt()` in this particular area:
```rust
        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };
```

The docs for the align implies that `Alignment::Left`, `Alignment::Right`, `Alignment::Center` comes from `:<`, `:>`, and `:^` respectively with `align()` returning `None` if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:
```rust
assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");
```
We shouldn't write to `f` and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet
rust-bors bot pushed a commit that referenced this pull request Feb 21, 2026
Rollup of 14 pull requests

Successful merges:

 - #150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - #151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - #151740 (Fix short backtraces from stripped executables)
 - #151871 (don't use env with infer vars)
 - #152591 (Simplify internals of `{Rc,Arc}::default`)
 - #152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - #152908 (Enable rust.remap-debuginfo in the dist profile)
 - #152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - #152767 (fix typo in `carryless_mul` macro invocation)
 - #152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - #152871 (Fix warnings in rs{begin,end}.rs files)
 - #152921 (Add build.rustdoc option to bootstrap config)
 - #152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - #152937 (remove unneeded reboxing)
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 22, 2026
Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned

Fixes rust-lang#152804. `Path`'s `Display` uses `ByteStr`'s `Display`, which is where the problem was occurring.

The issue was coming from `ByteStr` implementation of `fmt()` in this particular area:
```rust
        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };
```

The docs for the align implies that `Alignment::Left`, `Alignment::Right`, `Alignment::Center` comes from `:<`, `:>`, and `:^` respectively with `align()` returning `None` if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:
```rust
assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");
```
We shouldn't write to `f` and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
Rollup of 15 pull requests

Successful merges:

 - #149366 (GVN: consider constants of primitive types as deterministic)
 - #150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - #151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - #151871 (don't use env with infer vars)
 - #152591 (Simplify internals of `{Rc,Arc}::default`)
 - #152657 (std: move `exit` out of PAL)
 - #152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - #152908 (Enable rust.remap-debuginfo in the dist profile)
 - #152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - #152767 (fix typo in `carryless_mul` macro invocation)
 - #152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - #152871 (Fix warnings in rs{begin,end}.rs files)
 - #152921 (Add build.rustdoc option to bootstrap config)
 - #152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - #152937 (remove unneeded reboxing)
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 22, 2026
Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned

Fixes rust-lang#152804. `Path`'s `Display` uses `ByteStr`'s `Display`, which is where the problem was occurring.

The issue was coming from `ByteStr` implementation of `fmt()` in this particular area:
```rust
        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };
```

The docs for the align implies that `Alignment::Left`, `Alignment::Right`, `Alignment::Center` comes from `:<`, `:>`, and `:^` respectively with `align()` returning `None` if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:
```rust
assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");
```
We shouldn't write to `f` and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
Rollup of 14 pull requests

Successful merges:

 - #150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - #151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - #151871 (don't use env with infer vars)
 - #152591 (Simplify internals of `{Rc,Arc}::default`)
 - #152657 (std: move `exit` out of PAL)
 - #152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - #152908 (Enable rust.remap-debuginfo in the dist profile)
 - #152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - #152767 (fix typo in `carryless_mul` macro invocation)
 - #152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - #152871 (Fix warnings in rs{begin,end}.rs files)
 - #152921 (Add build.rustdoc option to bootstrap config)
 - #152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - #152937 (remove unneeded reboxing)
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 22, 2026
Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned

Fixes rust-lang#152804. `Path`'s `Display` uses `ByteStr`'s `Display`, which is where the problem was occurring.

The issue was coming from `ByteStr` implementation of `fmt()` in this particular area:
```rust
        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };
```

The docs for the align implies that `Alignment::Left`, `Alignment::Right`, `Alignment::Center` comes from `:<`, `:>`, and `:^` respectively with `align()` returning `None` if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:
```rust
assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");
```
We shouldn't write to `f` and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
Rollup of 13 pull requests

Successful merges:

 - #150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - #151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - #151871 (don't use env with infer vars)
 - #152591 (Simplify internals of `{Rc,Arc}::default`)
 - #152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - #152908 (Enable rust.remap-debuginfo in the dist profile)
 - #152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - #152767 (fix typo in `carryless_mul` macro invocation)
 - #152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - #152871 (Fix warnings in rs{begin,end}.rs files)
 - #152921 (Add build.rustdoc option to bootstrap config)
 - #152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - #152937 (remove unneeded reboxing)
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 22, 2026
Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned

Fixes rust-lang#152804. `Path`'s `Display` uses `ByteStr`'s `Display`, which is where the problem was occurring.

The issue was coming from `ByteStr` implementation of `fmt()` in this particular area:
```rust
        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };
```

The docs for the align implies that `Alignment::Left`, `Alignment::Right`, `Alignment::Center` comes from `:<`, `:>`, and `:^` respectively with `align()` returning `None` if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:
```rust
assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");
```
We shouldn't write to `f` and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
Rollup of 15 pull requests

Successful merges:

 - #150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - #151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - #151871 (don't use env with infer vars)
 - #152591 (Simplify internals of `{Rc,Arc}::default`)
 - #152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - #152908 (Enable rust.remap-debuginfo in the dist profile)
 - #147859 (reduce the amount of panics in `{TokenStream, Literal}::from_str` calls)
 - #152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - #152767 (fix typo in `carryless_mul` macro invocation)
 - #152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - #152871 (Fix warnings in rs{begin,end}.rs files)
 - #152879 (Remove `impl IntoQueryParam<P> for &'a P`.)
 - #152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - #152937 (remove unneeded reboxing)
 - #152953 (Fix typo in armv7a-vex-v5.md)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 22, 2026
Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned

Fixes rust-lang#152804. `Path`'s `Display` uses `ByteStr`'s `Display`, which is where the problem was occurring.

The issue was coming from `ByteStr` implementation of `fmt()` in this particular area:
```rust
        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };
```

The docs for the align implies that `Alignment::Left`, `Alignment::Right`, `Alignment::Center` comes from `:<`, `:>`, and `:^` respectively with `align()` returning `None` if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:
```rust
assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");
```
We shouldn't write to `f` and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - #151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - #151871 (don't use env with infer vars)
 - #152591 (Simplify internals of `{Rc,Arc}::default`)
 - #152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - #147859 (reduce the amount of panics in `{TokenStream, Literal}::from_str` calls)
 - #152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - #152767 (fix typo in `carryless_mul` macro invocation)
 - #152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - #152871 (Fix warnings in rs{begin,end}.rs files)
 - #152879 (Remove `impl IntoQueryParam<P> for &'a P`.)
 - #152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - #152937 (remove unneeded reboxing)
 - #152953 (Fix typo in armv7a-vex-v5.md)
rust-bors bot pushed a commit that referenced this pull request Feb 22, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - #151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - #151871 (don't use env with infer vars)
 - #152591 (Simplify internals of `{Rc,Arc}::default`)
 - #152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - #147859 (reduce the amount of panics in `{TokenStream, Literal}::from_str` calls)
 - #152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - #152767 (fix typo in `carryless_mul` macro invocation)
 - #152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - #152871 (Fix warnings in rs{begin,end}.rs files)
 - #152879 (Remove `impl IntoQueryParam<P> for &'a P`.)
 - #152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - #152937 (remove unneeded reboxing)
 - #152953 (Fix typo in armv7a-vex-v5.md)
@rust-bors rust-bors bot merged commit 3ed70ba into rust-lang:main Feb 22, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 22, 2026
rust-timer added a commit that referenced this pull request Feb 22, 2026
Rollup merge of #152865 - asder8215:path_display, r=joboet

Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned

Fixes #152804. `Path`'s `Display` uses `ByteStr`'s `Display`, which is where the problem was occurring.

The issue was coming from `ByteStr` implementation of `fmt()` in this particular area:
```rust
        let Some(align) = f.align() else {
            return fmt_nopad(self, f);
        };
        let nchars: usize = self
            .utf8_chunks()
            .map(|chunk| {
                chunk.valid().chars().count() + if chunk.invalid().is_empty() { 0 } else { 1 }
            })
            .sum();
        let padding = f.width().unwrap_or(0).saturating_sub(nchars);
        let fill = f.fill();
        let (lpad, rpad) = match align {
            fmt::Alignment::Left => (0, padding),
            fmt::Alignment::Right => (padding, 0),
            fmt::Alignment::Center => {
                let half = padding / 2;
                (half, half + padding % 2)
            }
        };
```

The docs for the align implies that `Alignment::Left`, `Alignment::Right`, `Alignment::Center` comes from `:<`, `:>`, and `:^` respectively with `align()` returning `None` if neither of those symbols are used in the formatted string. However, while padding is taken care of in the aligned cases, we could still have padding for things that don't use alignment like:
```rust
assert_eq!(format!("{:10}", Path::new("/foo/bar").display()), "/foo/bar  ");
```
We shouldn't write to `f` and return from there when there's no alignment; we should also include any potential padding/filling bytes here.

r? @joboet
@JonathanBrouwer
Copy link
Contributor

@rust-timer build 96b04ea

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (96b04ea): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.4% [0.2%, 0.8%] 3
Regressions ❌
(secondary)
0.8% [0.8%, 0.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 0.8%] 3

Max RSS (memory usage)

Results (primary 2.6%, secondary 6.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
6.4% [6.4%, 6.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Cycles

Results (primary 2.3%, secondary 13.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
16.9% [3.6%, 25.6%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 1

Binary size

Results (secondary -0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Bootstrap: 481.835s -> 481.254s (-0.12%)
Artifact size: 397.84 MiB -> 395.89 MiB (-0.49%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 22, 2026
@asder8215
Copy link
Contributor Author

I'm assuming LLVM optimizes away dead for loops for l_pad in (0, padding) or r_pad in (padding, 0). But I can see in most cases that Alignment:None has no padding (r_pad would be 0 in most cases), which I'm not sure if that right padding for loop would be optimized away.

I'm wondering if this is something that we can optimize in the code?

@JonathanBrouwer
Copy link
Contributor

Note that the regressions are all in doc builds, not sure why

github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Feb 23, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - rust-lang/rust#151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - rust-lang/rust#151871 (don't use env with infer vars)
 - rust-lang/rust#152591 (Simplify internals of `{Rc,Arc}::default`)
 - rust-lang/rust#152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - rust-lang/rust#147859 (reduce the amount of panics in `{TokenStream, Literal}::from_str` calls)
 - rust-lang/rust#152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - rust-lang/rust#152767 (fix typo in `carryless_mul` macro invocation)
 - rust-lang/rust#152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - rust-lang/rust#152871 (Fix warnings in rs{begin,end}.rs files)
 - rust-lang/rust#152879 (Remove `impl IntoQueryParam<P> for &'a P`.)
 - rust-lang/rust#152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - rust-lang/rust#152937 (remove unneeded reboxing)
 - rust-lang/rust#152953 (Fix typo in armv7a-vex-v5.md)
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Feb 23, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#150468 (rustc_target: callconv: powerpc64: Use the ABI set in target options instead of guessing)
 - rust-lang/rust#151628 (Fix ICE in const eval of packed SIMD types with non-power-of-two element counts)
 - rust-lang/rust#151871 (don't use env with infer vars)
 - rust-lang/rust#152591 (Simplify internals of `{Rc,Arc}::default`)
 - rust-lang/rust#152865 (Fixed ByteStr not padding within its Display trait when no specific alignment is mentioned)
 - rust-lang/rust#147859 (reduce the amount of panics in `{TokenStream, Literal}::from_str` calls)
 - rust-lang/rust#152705 (Test(lib/win/proc): Skip `raw_attributes` doctest under Win7)
 - rust-lang/rust#152767 (fix typo in `carryless_mul` macro invocation)
 - rust-lang/rust#152837 (fix(codegen): Use `body_codegen_attrs` For Caller In `adjust_target_feature_sig`)
 - rust-lang/rust#152871 (Fix warnings in rs{begin,end}.rs files)
 - rust-lang/rust#152879 (Remove `impl IntoQueryParam<P> for &'a P`.)
 - rust-lang/rust#152933 (Start migration for `LintDiagnostic` items by adding API and migrating `LinkerOutput` lint)
 - rust-lang/rust#152937 (remove unneeded reboxing)
 - rust-lang/rust#152953 (Fix typo in armv7a-vex-v5.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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.

std::path::Display regressed in 1.95.0 Nightly

5 participants