Skip to content

Conversation

joboet
Copy link
Member

@joboet joboet commented Sep 23, 2025

Just use a CStr-literal...

Just use a `CStr`-literal...
@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 Sep 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 23, 2025

r? @tgross35

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

@tgross35
Copy link
Contributor

Lol, great find

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 23, 2025

📌 Commit aa53782 has been approved by tgross35

It is now in the queue for this repository.

@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 Sep 23, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 24, 2025
core: simplify `CStr::default()`

Just use a `CStr`-literal...
@joboet
Copy link
Member Author

joboet commented Sep 24, 2025

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 24, 2025
@joboet
Copy link
Member Author

joboet commented Sep 24, 2025

I noticed Box<CStr>::default() and Rc<CStr>::default() were unnecessarily complicated as well. Arc<CStr>::default() uses some special logic to reuse the same allocation for all returned instances, so this doesn't apply there.

@joboet joboet 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 Sep 24, 2025
@tgross35
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 24, 2025

📌 Commit a875f77 has been approved by tgross35

It is now in the queue for this repository.

@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 Sep 24, 2025
bors added a commit that referenced this pull request Sep 24, 2025
Rollup of 7 pull requests

Successful merges:

 - #146556 (Fix duration_since panic on unix when std is built with integer overflow checks)
 - #146679 (Clarify Display for error should not include source)
 - #146753 (Improve the pretty print of UnstableFeature clause)
 - #146894 (Improve derive suggestion of const param)
 - #146950 (core: simplify `CStr::default()`)
 - #146958 (Fix infinite recursion in Path::eq with String)
 - #146971 (fix ICE in writeback due to bound regions)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Sep 25, 2025
Rollup of 7 pull requests

Successful merges:

 - #146556 (Fix duration_since panic on unix when std is built with integer overflow checks)
 - #146679 (Clarify Display for error should not include source)
 - #146753 (Improve the pretty print of UnstableFeature clause)
 - #146894 (Improve derive suggestion of const param)
 - #146950 (core: simplify `CStr::default()`)
 - #146958 (Fix infinite recursion in Path::eq with String)
 - #146971 (fix ICE in writeback due to bound regions)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6618ac7 into rust-lang:master Sep 25, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 25, 2025
rust-timer added a commit that referenced this pull request Sep 25, 2025
Rollup merge of #146950 - joboet:cstr_default, r=tgross35

core: simplify `CStr::default()`

Just use a `CStr`-literal...
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Sep 29, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#146556 (Fix duration_since panic on unix when std is built with integer overflow checks)
 - rust-lang/rust#146679 (Clarify Display for error should not include source)
 - rust-lang/rust#146753 (Improve the pretty print of UnstableFeature clause)
 - rust-lang/rust#146894 (Improve derive suggestion of const param)
 - rust-lang/rust#146950 (core: simplify `CStr::default()`)
 - rust-lang/rust#146958 (Fix infinite recursion in Path::eq with String)
 - rust-lang/rust#146971 (fix ICE in writeback due to bound regions)

r? `@ghost`
`@rustbot` modify labels: rollup
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.

4 participants