-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking issue for str_checked_slicing #39932
Comments
Should be a relatively easy API to add! I believe this just needs to mirror slices and can likely use the same trait for abstractions. |
i'd like to do it |
Nominating for libs team discussion -- I think it's reasonable to stabilize this. It's been implemented for about two cycles (PR merged March 31st), I believe. The API surface is fairly small -- extending slice |
@rfcbot fcp merge Sounds good to me to stabilize! |
Note though that we should avoid deprecating stable functions until the alternative, |
Wouldn't deprecating and stabilizing at the same time work? Then all code can transition immediately, right? |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@Mark-Simulacrum nah unfortunately the downside of that is that if you have a library which spans all three channels it's impossible to compile without warnings. On stable you can't use the replacement and on nightly you get warnings. The alternative is that we wait for all three channels to have the replacement, then we turn the warnings on, and that way libraries which span all three channels can immediately update to the newer methods and take action to rid the warnings. |
Yeah it's best to wait to deprecate things until their replacements are stable a while. As soon as you publish a deprecation to nightly people will start migrating away from it and breaking their own downstreams, and breaking backwards compatibility. Best to leave a stable compatibility window. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period is now complete. |
Stabilized * `<str>::get` * `<str>::get_mut` * `<str>::get_unchecked` * `<str>::get_unchecked_mut` Closes rust-lang#39932
slice::get_unchecked now takes ranges, whereas str takes explicit usize.
str
does not provide an explicit method to slice unsafely with ranges either.The text was updated successfully, but these errors were encountered: