Skip to content

Conversation

GrigorenkoPV
Copy link
Contributor

@GrigorenkoPV GrigorenkoPV commented Aug 27, 2025

Tracking issue: #130366

The method was not initially marked const presumably because it is only useful with Deref. But now that const traits seem to be a thing that can actually become real, why not make it const?

PR constifying Deref: #145279

@rustbot
Copy link
Collaborator

rustbot commented Aug 27, 2025

r? @ibraheemdev

rustbot has assigned @ibraheemdev.
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-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 27, 2025
@clarfonthey
Copy link
Contributor

Confused how this could have possibly passed CI without a rustc_const_unstable attribute…

@GrigorenkoPV
Copy link
Contributor Author

I think they got reworked a few months ago to inherit stability and feature name from the non-const attributes.

@clarfonthey
Copy link
Contributor

Right! Sorry, I was forgetting that this method is still unstable. Carry on, then.

@joshtriplett
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Aug 28, 2025

📌 Commit e06cd9f has been approved by joshtriplett

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 Aug 28, 2025
bors added a commit that referenced this pull request Aug 28, 2025
Rollup of 9 pull requests

Successful merges:

 - #142727 (wasm: rm static mut)
 - #143193 (Port `#[link]` to the new attribute parsing infrastructure )
 - #144864 (No source fixes)
 - #145913 (Add spin_loop hint for LoongArch)
 - #145926 (compiletest: Remove several remnants of the old libtest-based executor)
 - #145928 (Rename `Location::file_with_nul` to `file_as_c_str`)
 - #145930 (`const`ify (the unstable) `str::as_str`)
 - #145941 (Disable `integer_to_ptr_transmutes` suggestion for unsized types)
 - #145953 (Update `icu_list` to 2.0)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f6c56bc into rust-lang:master Aug 28, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 28, 2025
rust-timer added a commit that referenced this pull request Aug 28, 2025
Rollup merge of #145930 - GrigorenkoPV:const_str_as_str, r=joshtriplett

`const`ify (the unstable) `str::as_str`

Tracking issue: #130366

The method was not initially marked `const` presumably because it is only useful with `Deref`. But now that const traits seem to be a thing that can actually become real, why not make it `const`?

PR `const`ifying `Deref`: #145279
@GrigorenkoPV GrigorenkoPV deleted the const_str_as_str branch August 28, 2025 17:32
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.

6 participants