Skip to content

Nul terminate rust string literals #138504

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Mar 14, 2025

This allows taking advantage of the C string merging functionality of linkers, reducing code size.

Marked as draft to see if this actually has much of an effect. The disadvantage of this is that people may start to rely on string literals getting nul terminated. A potential solution for that would be to put a byte that is not part of a valid UTF-8 character right before the nul terminator.

Builds on #138503

@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2025

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 14, 2025
@bjorn3
Copy link
Member Author

bjorn3 commented Mar 14, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 14, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 14, 2025
…r=<try>

Nul terminate rust string literals

This allows taking advantage of the C string merging functionality of linkers, reducing code size.

Marked as draft to see if this actually has much of an effect. The disadvantage of this is that people may start to rely on string literals getting nul terminated. A potential solution for that would be to put a byte that is not part of a valid UTF-8 character right before the nul terminator.

Builds on rust-lang#138503
@bors
Copy link
Collaborator

bors commented Mar 14, 2025

⌛ Trying commit 7c1cd9b with merge f949c9f...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Mar 14, 2025

☀️ Try build successful - checks-actions
Build commit: f949c9f (f949c9f96faec0a24e98f55e36cfa88c14c2199c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f949c9f): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [0.3%, 1.8%] 5
Improvements ✅
(primary)
-1.2% [-4.3%, -0.3%] 12
Improvements ✅
(secondary)
-1.5% [-6.6%, -0.4%] 21
All ❌✅ (primary) -1.2% [-4.3%, -0.3%] 12

Max RSS (memory usage)

Results (primary 1.6%, secondary 2.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.2% [1.1%, 4.4%] 4
Regressions ❌
(secondary)
3.7% [1.9%, 4.8%] 3
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.3%] 1
All ❌✅ (primary) 1.6% [-1.2%, 4.4%] 5

Cycles

Results (primary -2.3%, secondary -3.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.4% [2.3%, 2.6%] 2
Improvements ✅
(primary)
-2.3% [-3.8%, -1.2%] 3
Improvements ✅
(secondary)
-5.5% [-6.4%, -4.1%] 5
All ❌✅ (primary) -2.3% [-3.8%, -1.2%] 3

Binary size

Results (primary -0.5%, secondary -0.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.1%] 8
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 32
Improvements ✅
(primary)
-0.6% [-2.5%, -0.0%] 100
Improvements ✅
(secondary)
-0.5% [-3.0%, -0.0%] 43
All ❌✅ (primary) -0.5% [-2.5%, 0.1%] 108

Bootstrap: 775.364s -> 772.882s (-0.32%)
Artifact size: 365.01 MiB -> 365.44 MiB (0.12%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 14, 2025
@bjorn3 bjorn3 force-pushed the string_merging_rust_strings branch from 7c1cd9b to 827d66e Compare March 17, 2025 11:16
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the string_merging_rust_strings branch from 827d66e to d42a662 Compare March 17, 2025 12:33
@bors
Copy link
Collaborator

bors commented Mar 28, 2025

☔ The latest upstream changes (presumably #138503) made this pull request unmergeable. Please resolve the merge conflicts.

@bjorn3 bjorn3 force-pushed the string_merging_rust_strings branch from d42a662 to dce272b Compare March 30, 2025 14:05
@oxalica
Copy link
Contributor

oxalica commented Apr 12, 2025

This allows taking advantage of the C string merging functionality of linkers, reducing code size.

I don't like this. Why Rust is the one to pretend to be C in order to benefit from a (for no reason but) C-only optimization, instead of making that optimization more general to be applicable on Rust strings?

I got here by searching why Rust currently cannot merge "a long string" with any of its substrings like "long" or "a", which is an advantage of no-NUL-terminators and is more widely applicable for tiny strings with a single or two characters. But this PR seems to do the opposite to make it impossible.

@bjorn3
Copy link
Member Author

bjorn3 commented Apr 13, 2025

Why Rust is the one to pretend to be C in order to benefit from a (for no reason but) C-only optimization, instead of making that optimization more general to be applicable on Rust strings?

Because this optimization needs to be done by the linker to be effective and there is no reasonable way for us to modify every linker a user may want to use to support string merging for non-C strings. For Windows and macOS I think it is unrealistic to expect this will be added within the next 10 years. The Windows linker doesn't even support weak symbols despite being a relatively common C feature (it does seem to support weak aliases though). And Apple is betting om Swift rather than Rust. And on Linux we still support systems from before Rust 1.0 was released, with associated ancient linker.

@oxalica
Copy link
Contributor

oxalica commented Apr 13, 2025

Because this optimization needs to be done by the linker to be effective and there is no reasonable way for us to modify every linker a user may want to use to support string merging for non-C strings. For Windows and macOS I think it is unrealistic to expect this will be added within the next 10 years. The Windows linker doesn't even support weak symbols despite being a relatively common C feature (it does seem to support weak aliases though). And Apple is betting om Swift rather than Rust. And on Linux we still support systems from before Rust 1.0 was released, with associated ancient linker.

I agree that it's better done in linkers and they are likely to only support C strings. But I think it's too early to just give up before any existing attempt to improve eg. lld. At least I couldn't find discussions under LLVM issues. Note that lld is already shipped with Rust toolchain and is used by default on some platforms (#124129).

Adding NUL for strings without the need for C-interop (unlike #135054) should be more conservative without proven to be required. This PR seems to add NUL for Rust type names, which is not for C-interop and also less applicable for suffix merging. When will you have both foo::Bar and another::foo::Bar? Perf report seems to agree with this.

I also tried to get some numbers on possible size reduction of librustc_driver's all .rodata* sections, by compile it to staticlib, parse all inner ELFs and run manual merging algorithms1. This should be an upper-bound of size reduction because 1. all .rodata* subsections are subject to merge, not only strings; 2. linker may remove (gc) more unused sections. It seems that a simple dedup (currently being done) is good enough, and suffix and subarray (aka. substring) merging are probably not worth it, considering the total archive weighs 349MiB and the linked .so is still 128MiB.

copy .rodata*: 135428 sections, total bytes: 6638549
dedup simple: 42456 sections, total bytes: 3675613 (previous - 2.83MiB)
merge suffix: 37281 sections, total bytes: 3526647 (previous - 145.47KiB)
merge subarray: 28527 sections, total bytes: 3353123 (previous - 169.46KiB)

Footnotes

  1. Code: https://gist.github.com/oxalica/c3a67f56486ad77772f9df72f703eaa4 I'm using online suffix tree for substring search on an increasing haystack. It's not performance-wise good, but is good enough in complexity (O(N)) so it can at least complete in seconds.

@bors
Copy link
Collaborator

bors commented Apr 14, 2025

☔ The latest upstream changes (presumably #139766) made this pull request unmergeable. Please resolve the merge conflicts.

@Noratrieb
Copy link
Member

Noratrieb commented May 29, 2025

I'd like to see a perf run of 0xFF, 0x0 termination (or something like it). If that still appears beneficial (even for some embedded programs) this would be great. While just this seems pretty beneficial and good, I think it makes it way too easy to accidentally rely on, so I think only null termination shouldn't be done (we definitely don't want to guarantee that in the language :D).

@bjorn3 bjorn3 force-pushed the string_merging_rust_strings branch from dce272b to 0676972 Compare May 29, 2025 10:32
@bjorn3
Copy link
Member Author

bjorn3 commented May 29, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 29, 2025
@bjorn3 bjorn3 force-pushed the string_merging_rust_strings branch from 0676972 to 4749fc0 Compare May 29, 2025 11:19
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the string_merging_rust_strings branch from 4749fc0 to 701f892 Compare May 29, 2025 13:14
@bjorn3
Copy link
Member Author

bjorn3 commented May 29, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented May 29, 2025

⌛ Trying commit 701f892 with merge 7cb6c31...

bors added a commit that referenced this pull request May 29, 2025
Nul terminate rust string literals

This allows taking advantage of the C string merging functionality of linkers, reducing code size.

Marked as draft to see if this actually has much of an effect. The disadvantage of this is that people may start to rely on string literals getting nul terminated. A potential solution for that would be to put a byte that is not part of a valid UTF-8 character right before the nul terminator.

Builds on #138503
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented May 29, 2025

☀️ Try build successful - checks-actions
Build commit: 7cb6c31 (7cb6c31959da1f738049a068d93b97de160ac573)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7cb6c31): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [0.1%, 2.1%] 10
Improvements ✅
(primary)
-0.8% [-1.3%, -0.2%] 10
Improvements ✅
(secondary)
-0.8% [-3.8%, -0.4%] 31
All ❌✅ (primary) -0.8% [-1.3%, -0.2%] 10

Max RSS (memory usage)

Results (primary -1.9%, secondary -1.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.9% [0.4%, 2.3%] 19
Improvements ✅
(primary)
-1.9% [-1.9%, -1.9%] 1
Improvements ✅
(secondary)
-4.3% [-8.5%, -0.5%] 13
All ❌✅ (primary) -1.9% [-1.9%, -1.9%] 1

Cycles

Results (secondary -1.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.0% [0.5%, 1.8%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-6.9%, -0.5%] 12
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.4%, secondary -0.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 25
Regressions ❌
(secondary)
0.1% [0.0%, 0.3%] 43
Improvements ✅
(primary)
-0.5% [-1.7%, -0.0%] 99
Improvements ✅
(secondary)
-0.5% [-3.0%, -0.1%] 52
All ❌✅ (primary) -0.4% [-1.7%, 0.3%] 124

Bootstrap: 777.423s -> 777.095s (-0.04%)
Artifact size: 368.47 MiB -> 368.95 MiB (0.13%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 29, 2025
@Kobzol
Copy link
Member

Kobzol commented May 29, 2025

It's interesting that for the only two benchmarks that are optimized for minimum binary size this was actually a small binary size regression. I wonder if it's caused by using strip = true, where most strings are stripped anyway, but some of them remained, and these are (slightly) larger now?

@workingjubilee
Copy link
Member

Maybe string merging went first, before determining whether the strings were necessary?

@Noratrieb
Copy link
Member

My guess would be that more size-conscious codebases have fewer mergeable strings is the first place, so the overhead of the terminator outweighs gains from merging. But I haven't verified this.

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 8, 2025

Let's do a retry now that #135054 has landed.

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 8, 2025

⌛ Trying commit 701f892 with merge fc3fe28

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 8, 2025
Nul terminate rust string literals

This allows taking advantage of the C string merging functionality of linkers, reducing code size.

Marked as draft to see if this actually has much of an effect. The disadvantage of this is that people may start to rely on string literals getting nul terminated. A potential solution for that would be to put a byte that is not part of a valid UTF-8 character right before the nul terminator.

Builds on #138503
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 8, 2025
@rust-bors
Copy link

rust-bors bot commented Jun 8, 2025

☀️ Try build successful (CI)
Build commit: fc3fe28 (fc3fe284ad1777473962b4eedf74cc17ce326145)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fc3fe28): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.2% [0.3%, 2.0%] 10
Improvements ✅
(primary)
-1.1% [-1.6%, -0.3%] 9
Improvements ✅
(secondary)
-0.9% [-3.7%, -0.4%] 34
All ❌✅ (primary) -1.1% [-1.6%, -0.3%] 9

Max RSS (memory usage)

Results (primary -1.4%, secondary -3.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.4% [-1.5%, -1.2%] 2
Improvements ✅
(secondary)
-3.3% [-4.7%, -2.8%] 6
All ❌✅ (primary) -1.4% [-1.5%, -1.2%] 2

Cycles

Results (secondary -3.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [3.5%, 3.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.0% [-7.8%, -3.8%] 4
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.4%, secondary -0.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.2%] 25
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 46
Improvements ✅
(primary)
-0.5% [-1.6%, -0.0%] 78
Improvements ✅
(secondary)
-0.4% [-1.4%, -0.0%] 57
All ❌✅ (primary) -0.4% [-1.6%, 0.2%] 103

Bootstrap: 752.812s -> 752.48s (-0.04%)
Artifact size: 372.43 MiB -> 375.02 MiB (0.70%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 8, 2025
bjorn3 added 2 commits August 6, 2025 15:17
This allows taking advantage of the C string merging functionality of
linkers, reducing code size.
This prevents people depending on nul-termination.
@bjorn3 bjorn3 force-pushed the string_merging_rust_strings branch from 701f892 to b6cb0ed Compare August 6, 2025 15:38
@bjorn3 bjorn3 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 6, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [mir-opt] tests/mir-opt/building/issue_101867.rs stdout ----
72     }
73 }
74 
- ALLOC0 (size: 14, align: 1) {
-     65 78 70 6c 69 63 69 74 20 70 61 6e 69 63       │ explicit panic
+ ALLOC0 (size: 16, align: 1) {
+     65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 ff 00 │ explicit panic..
77 }
78 


thread '[mir-opt] tests/mir-opt/building/issue_101867.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/building/issue_101867.main.built.after.mir
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- [mir-opt] tests/mir-opt/building/storage_live_dead_in_statics.rs stdout ----
199     }
200 }
201 
- ALLOC0 (size: 2, align: 1) {
-     68 69                                           │ hi
+ ALLOC0 (size: 4, align: 1) {
+     68 69 ff 00                                     │ hi..
204 }
205 


thread '[mir-opt] tests/mir-opt/building/storage_live_dead_in_statics.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/building/storage_live_dead_in_statics.XXX.built.after.mir

---- [mir-opt] tests/mir-opt/building/user_type_annotations.rs stdout ----
79     }
80 }
81 
- ALLOC0 (size: 40, align: 1) {
+ ALLOC0 (size: 42, align: 1) {
83     0x00 │ 69 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 3a 20 │ internal error: 
84     0x10 │ 65 6e 74 65 72 65 64 20 75 6e 72 65 61 63 68 61 │ entered unreacha
-     0x20 │ 62 6c 65 20 63 6f 64 65                         │ ble code
+     0x20 │ 62 6c 65 20 63 6f 64 65 ff 00                   │ ble code..
86 }
87 


thread '[mir-opt] tests/mir-opt/building/user_type_annotations.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/building/user_type_annotations.let_else.built.after.mir

---- [mir-opt] tests/mir-opt/const_debuginfo.rs stdout ----
123   
124   ALLOC1 (size: 4, align: 2) { .. }
125   
-   ALLOC2 (size: 13, align: 1) { .. }
+   ALLOC2 (size: 15, align: 1) { .. }
127   
128 


thread '[mir-opt] tests/mir-opt/const_debuginfo.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/const_debuginfo.main.SingleUseConsts.diff

---- [mir-opt] tests/mir-opt/const_prop/control_flow_simplification.rs stdout ----
24       }
25   }
26   
-   ALLOC0 (size: 14, align: 1) {
-       65 78 70 6c 69 63 69 74 20 70 61 6e 69 63       │ explicit panic
+   ALLOC0 (size: 16, align: 1) {
+       65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 ff 00 │ explicit panic..
29   }
30   
31 


thread '[mir-opt] tests/mir-opt/const_prop/control_flow_simplification.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/const_prop/control_flow_simplification.hello.GVN.panic-unwind.diff

---- [mir-opt] tests/mir-opt/dead-store-elimination/place_mention.rs stdout ----
17       }
18   }
19   
-   ALLOC0 (size: 5, align: 1) {
-       57 6f 72 6c 64                                  │ World
+   ALLOC0 (size: 7, align: 1) {
+       57 6f 72 6c 64 ff 00                            │ World..
22   }
23   
-   ALLOC1 (size: 5, align: 1) {
-       48 65 6c 6c 6f                                  │ Hello
+   ALLOC1 (size: 7, align: 1) {
+       48 65 6c 6c 6f ff 00                            │ Hello..
26   }
27   
28 


thread '[mir-opt] tests/mir-opt/dead-store-elimination/place_mention.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/dead-store-elimination/place_mention.main.DeadStoreElimination-initial.diff

---- [mir-opt] tests/mir-opt/gvn.rs stdout ----
47       }
48   }
49   
-   ALLOC0 (size: 14, align: 1) { .. }
+   ALLOC0 (size: 16, align: 1) { .. }
51   
52 


thread '[mir-opt] tests/mir-opt/gvn.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/gvn.wrap_unwrap.GVN.panic-unwind.diff

---- [mir-opt] tests/mir-opt/inline/inline_diverging.rs stdout ----
40       }
41 + }
42 + 
- + ALLOC0 (size: 14, align: 1) {
- +     65 78 70 6c 69 63 69 74 20 70 61 6e 69 63       │ explicit panic
+ + ALLOC0 (size: 16, align: 1) {
+ +     65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 ff 00 │ explicit panic..
45   }
46   
47 


thread '[mir-opt] tests/mir-opt/inline/inline_diverging.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/inline/inline_diverging.g.Inline.panic-unwind.diff

---- [mir-opt] tests/mir-opt/inline_coroutine_body.rs stdout ----
369 +     }
370 + }
371 + 
- + ALLOC0 (size: 31, align: 1) {
+ + ALLOC0 (size: 33, align: 1) {
373 +     0x00 │ 60 52 65 61 64 79 60 20 70 6f 6c 6c 65 64 20 61 │ `Ready` polled a
- +     0x10 │ 66 74 65 72 20 63 6f 6d 70 6c 65 74 69 6f 6e    │ fter completion
+ +     0x10 │ 66 74 65 72 20 63 6f 6d 70 6c 65 74 69 6f 6e ff │ fter completion.
+ +     0x20 │ 00                                              │ .
375   }
376   
377 


thread '[mir-opt] tests/mir-opt/inline_coroutine_body.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff

---- [mir-opt] tests/mir-opt/instsimplify/aggregate_array.rs stdout ----
11       }
12   }
13   
-   ALLOC0 (size: 1, align: 1) {
-       61                                              │ a
+   ALLOC0 (size: 3, align: 1) {
+       61 ff 00                                        │ a..
16   }
17   
18 

---
---- [mir-opt] tests/mir-opt/issue_76432.rs stdout ----
51       }
52   }
53   
-   ALLOC0 (size: 40, align: 1) {
+   ALLOC0 (size: 42, align: 1) {
55       0x00 │ 69 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 3a 20 │ internal error: 
56       0x10 │ 65 6e 74 65 72 65 64 20 75 6e 72 65 61 63 68 61 │ entered unreacha
-       0x20 │ 62 6c 65 20 63 6f 64 65                         │ ble code
+       0x20 │ 62 6c 65 20 63 6f 64 65 ff 00                   │ ble code..
58   }
59   
60 


thread '[mir-opt] tests/mir-opt/issue_76432.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff

---- [mir-opt] tests/mir-opt/no_drop_for_inactive_variant.rs stdout ----
42     }
43 }
44 
- ALLOC0 (size: 14, align: 1) {
-     65 78 70 6c 69 63 69 74 20 70 61 6e 69 63       │ explicit panic
+ ALLOC0 (size: 16, align: 1) {
+     65 78 70 6c 69 63 69 74 20 70 61 6e 69 63 ff 00 │ explicit panic..
47 }
48 


thread '[mir-opt] tests/mir-opt/no_drop_for_inactive_variant.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-pre-optimizations.after.panic-unwind.mir

---- [mir-opt] tests/mir-opt/no_spurious_drop_after_call.rs stdout ----
39     }
40 }
41 
- ALLOC0 (size: 0, align: 1) {}
+ ALLOC0 (size: 2, align: 1) {
+     ff 00                                           │ ..
+ }
43 


thread '[mir-opt] tests/mir-opt/no_spurious_drop_after_call.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.panic-unwind.mir

---- [mir-opt] tests/mir-opt/single_use_consts.rs stdout ----
34       }
35   }
36   
-   ALLOC0 (size: 5, align: 1) {
-       77 6f 72 6c 64                                  │ world
+   ALLOC0 (size: 7, align: 1) {
+       77 6f 72 6c 64 ff 00                            │ world..
39   }
40   
-   ALLOC1 (size: 5, align: 1) {
-       74 6f 77 65 6c                                  │ towel
+   ALLOC1 (size: 7, align: 1) {
+       74 6f 77 65 6c ff 00                            │ towel..
43   }
44   
-   ALLOC2 (size: 5, align: 1) {
-       68 65 6c 6c 6f                                  │ hello
+   ALLOC2 (size: 7, align: 1) {
+       68 65 6c 6c 6f ff 00                            │ hello..
47   }
48   
49 


thread '[mir-opt] tests/mir-opt/single_use_consts.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/single_use_consts.match_const.SingleUseConsts.panic-unwind.diff

---- [mir-opt] tests/mir-opt/sroa/structs.rs stdout ----
75       }
76   }
77   
-   ALLOC0 (size: 1, align: 1) {
-       61                                              │ a
+   ALLOC0 (size: 3, align: 1) {
+       61 ff 00                                        │ a..
80   }
81   
82 


thread '[mir-opt] tests/mir-opt/sroa/structs.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/sroa/structs.flat.ScalarReplacementOfAggregates.diff

---- [mir-opt] tests/mir-opt/unreachable_enum_branching.rs stdout ----
51       }
52   }
53   
-   ALLOC0 (size: 1, align: 1) {
-       43                                              │ C
+   ALLOC0 (size: 3, align: 1) {
+       43 ff 00                                        │ C..
56   }
57   
-   ALLOC1 (size: 8, align: 1) {
-       42 28 45 6d 70 74 79 29                         │ B(Empty)
+   ALLOC1 (size: 10, align: 1) {
+       42 28 45 6d 70 74 79 29 ff 00                   │ B(Empty)..
60   }
61   
-   ALLOC2 (size: 8, align: 1) {
-       41 28 45 6d 70 74 79 29                         │ A(Empty)
+   ALLOC2 (size: 10, align: 1) {
+       41 28 45 6d 70 74 79 29 ff 00                   │ A(Empty)..
64   }
65   
66 


thread '[mir-opt] tests/mir-opt/unreachable_enum_branching.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/unreachable_enum_branching.simple.UnreachableEnumBranching.panic-unwind.diff


failures:
    [mir-opt] tests/mir-opt/building/issue_101867.rs
    [mir-opt] tests/mir-opt/building/storage_live_dead_in_statics.rs

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-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants