Skip to content

Outline constant messages from panicking macros - #163766

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
hanna-kruppe:outline-panic-literals
Oct 24, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
hanna-kruppe:outline-panic-literals

Conversation

@hanna-kruppe

@hanna-kruppe hanna-kruppe commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

This emits (very slightly) less code per call site because it's passing one less argument (the implicit caller location is still passed).

Inspired by #163657

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 4, 2026
@hanna-kruppe

Copy link
Copy Markdown
Contributor Author

@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 Oct 4, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 4, 2026
[EXPERIMENT] Outline some panics with constant messages
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: caa37fb (caa37fb206c657fa2ce3b0adc2fe67084eaee0a8)
Base parent: f48b3e6 (f48b3e61eeece268609bd920fcca1ded047db7ca)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (caa37fb): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@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.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.1%, 0.1%] 2

Max RSS (memory usage)

Results (secondary 1.4%)

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)
4.1% [2.1%, 6.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 0.8%)

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)
6.7% [6.7%, 6.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.4%, -1.9%] 2
All ❌✅ (primary) - - 0

Binary size

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

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.2% [-0.3%, -0.2%] 11
Improvements ✅
(secondary)
-0.4% [-0.6%, -0.2%] 13
All ❌✅ (primary) -0.2% [-0.3%, -0.2%] 11

Bootstrap: 490.122s -> 490.205s (0.02%)
Artifact size: 408.65 MiB -> 408.94 MiB (0.07%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 4, 2026
@panstromek

panstromek commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

btw. I was wondering whether we should maybe do this automatically. Either change the panic macros to output a argument-less function definition and a call, or do the equivalent in some mir opt.

[edit] oh.. lol, that's what you did 😆 I should have looked at the code before commenting

@hanna-kruppe
hanna-kruppe force-pushed the outline-panic-literals branch 2 times, most recently from 1b49c26 to ac8f493 Compare October 10, 2026 14:22
@hanna-kruppe
hanna-kruppe marked this pull request as ready for review October 10, 2026 14:23
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 10, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 10, 2026
@rustbot

rustbot commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from JohnTitor, Mark-Simulacrum, clarfonthey

@hanna-kruppe hanna-kruppe changed the title [EXPERIMENT] Outline some panics with constant messages Outline constant messages from panicking macros Oct 10, 2026
@hanna-kruppe

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 10, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 10, 2026
Outline constant messages from panicking macros
@rust-log-analyzer

This comment has been minimized.

@hanna-kruppe
hanna-kruppe force-pushed the outline-panic-literals branch from ac8f493 to 61ca6bb Compare October 10, 2026 15:11
@rust-bors

rust-bors Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a6a14fb (a6a14fb59886aab396ff4e72ed178520f14a5f61)
Base parent: 5ec56e3 (5ec56e3902656f2460259fc3ac0f6e2255f94417)

@rust-timer

This comment has been minimized.

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 10, 2026
@hanna-kruppe

Copy link
Copy Markdown
Contributor Author

That can’t be right…

@panstromek

Copy link
Copy Markdown
Contributor

@ChrisDenton

Copy link
Copy Markdown
Member

r? ChrisDenton

This seems quite marginal?

@panstromek

Copy link
Copy Markdown
Contributor

I think we should re-measure this to get real results. It seems that this benchmark noise got stable in last few days.

@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 Oct 23, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 23, 2026
Outline constant messages from panicking macros
@hanna-kruppe

Copy link
Copy Markdown
Contributor Author

I’d expect the same results as on the first run (before I polished the code and extended it to todo!()): perf-neutral but a tiny win for binary size across quite a few benchmarks.

@rust-bors

rust-bors Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: fe83376 (fe83376e93930b5848d8e984ed3d04932072a5e2)
Base parent: e481b82 (e481b820663a10f5dad2478b2246daf73482ba82)

@rust-timer

This comment has been minimized.

@ChrisDenton

Copy link
Copy Markdown
Member

I’d expect the same results as on the first run (before I polished the code and extended it to todo!()): perf-neutral but a tiny win for binary size across quite a few benchmarks.

Fair enough. r=me unless the new perf results are somehow bad (though tbh in that case I'd suspecting something went wrong).

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (fe83376): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.4%, -0.1%] 7
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.9%, secondary 1.8%)

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

mean range count
Regressions ❌
(primary)
1.3% [0.4%, 7.3%] 16
Regressions ❌
(secondary)
1.8% [0.4%, 7.5%] 12
Improvements ✅
(primary)
-0.7% [-1.1%, -0.4%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.9% [-1.1%, 7.3%] 20

Cycles

Results (primary -0.4%, secondary 1.5%)

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

mean range count
Regressions ❌
(primary)
0.8% [0.5%, 1.1%] 4
Regressions ❌
(secondary)
5.4% [0.4%, 17.1%] 4
Improvements ✅
(primary)
-0.8% [-1.6%, -0.4%] 11
Improvements ✅
(secondary)
-0.7% [-1.5%, -0.5%] 7
All ❌✅ (primary) -0.4% [-1.6%, 1.1%] 15

Binary size

Results (primary -0.1%, secondary -1.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.1% [-0.3%, -0.0%] 29
Improvements ✅
(secondary)
-1.1% [-4.8%, -0.0%] 24
All ❌✅ (primary) -0.1% [-0.3%, -0.0%] 29

Bootstrap: 487.9s -> 486.879s (-0.21%)
Artifact size: 406.28 MiB -> 406.28 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 23, 2026
@ChrisDenton

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 400b05d has been approved by ChrisDenton

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 Oct 23, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors rollup=iffy

rust-bors Bot pushed a commit that referenced this pull request Oct 24, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #163766 (Outline constant messages from panicking macros)
 - #147368 (Add extra `unchecked_disjoint_bitor` implementations.)
 - #164748 (Use 64-bit futex syscalls on RV32 Linux)
 - #164520 (powerpc: implement c-variadic correctly for softfloat targets)
 - #164671 (add maintainers for tier 2 riscv64 targets (baremetal only))
@rust-bors
rust-bors Bot merged commit 9e8653b into rust-lang:main Oct 24, 2026
15 checks passed
rust-bors Bot pushed a commit that referenced this pull request Oct 24, 2026
Rollup merge of #163766 - hanna-kruppe:outline-panic-literals, r=ChrisDenton

Outline constant messages from panicking macros

This emits (very slightly) less code per call site because it's passing one less argument (the implicit caller location is still passed).

Inspired by #163657
@rustbot rustbot added this to the 1.101.0 milestone Oct 24, 2026
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Oct 24, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#163766 (Outline constant messages from panicking macros)
 - rust-lang/rust#147368 (Add extra `unchecked_disjoint_bitor` implementations.)
 - rust-lang/rust#164748 (Use 64-bit futex syscalls on RV32 Linux)
 - rust-lang/rust#164520 (powerpc: implement c-variadic correctly for softfloat targets)
 - rust-lang/rust#164671 (add maintainers for tier 2 riscv64 targets (baremetal only))
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.

8 participants