Skip to content

implement inherent str constructors#136517

Merged
bors merged 2 commits intorust-lang:masterfrom
m4rch3n1ng:inherent-str-constructors
Feb 6, 2025
Merged

implement inherent str constructors#136517
bors merged 2 commits intorust-lang:masterfrom
m4rch3n1ng:inherent-str-constructors

Conversation

@m4rch3n1ng
Copy link
Copy Markdown
Contributor

implement #131114

this implements

  • str::from_utf8
  • str::from_utf8_mut
  • str::from_utf8_unchecked
  • str::from_utf8_unchecked_mut

i left std::str::from_raw_parts and std::str::from_raw_parts_mut out of this as those are unstable and were not mentioned by the tracking issue or the original pull request, but i can add those here as well.

i was also unsure of what to do with the rustc_const_(un)stable attributes: i removed the #[rustc_const_stable] attribute from str::from_utf8, str::from_utf8_unchecked and str::from_utf8_unchecked_mut, and left the#[rust_const_unstable] in str::from_utf8_mut (btw why is that one not const stable yet with #57349 merged?).

is there a way to redirect users to the stable std::str::from_utf8 instead of only saying "hey this is unstable"?

for now i just removed the check for str::from_utf8 in the test in tests/ui/suggestions/suggest-std-when-using-type.rs.

Loading
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

5 participants