Skip to content
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 inherent_ascii_escape #77174

Closed
2 of 5 tasks
clarfonthey opened this issue Sep 25, 2020 · 14 comments
Closed
2 of 5 tasks

Tracking Issue for inherent_ascii_escape #77174

clarfonthey opened this issue Sep 25, 2020 · 14 comments
Labels
A-str Area: str and String C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@clarfonthey
Copy link
Contributor

clarfonthey commented Sep 25, 2020

Feature gate: #![feature(inherent_ascii_escape)]

Public API

impl u8 {
    pub fn escape_ascii(self) -> core::ascii::EscapeDefault;
}

impl [u8] {
    pub fn escape_ascii(&self) -> EscapeAscii<'_>;
}

// core::slice
pub struct EscapeAscii<'a>;

Steps / History

Unresolved Questions

  • Naming. escape_ascii, escape_default, ascii_escape_default, ... ?
  • Deprecate std::ascii::escape_default? (That is, all of std::ascii.)
@clarfonthey clarfonthey added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Sep 25, 2020
@tesuji

This comment has been minimized.

@LeSeulArtichaut LeSeulArtichaut added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 25, 2020
@KodrAus KodrAus added the Libs-Tracked Libs issues that are tracked on the team's project board. label Nov 6, 2020
@KodrAus KodrAus added the A-str Area: str and String label Jan 6, 2021
@tanriol
Copy link
Contributor

tanriol commented Sep 15, 2021

What's the status of this? Is it ready for stabilization or waiting for something?

@joshtriplett
Copy link
Member

This seems reasonable to me, and it seems to work as advertised.

Shall we stabilize these escape_ascii() methods?

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Oct 9, 2021

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), 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.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 9, 2021
@rfcbot
Copy link

rfcbot commented Oct 14, 2021

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Oct 14, 2021
@clarfonthey
Copy link
Contributor Author

One thing that wasn't mentioned in FCP: should stabilising this also lead to deprecating the std::ascii module? Since the naming seems to be fine re: the first unresolved question, but there's the one about deprecation as well.

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 24, 2021
@rfcbot
Copy link

rfcbot commented Oct 24, 2021

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@rfcbot rfcbot added the to-announce Announce this issue on triage meeting label Oct 24, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 5, 2021
…nytm

Re-export some iterators from `core` in `std`

These iterators seem to have been forgotten to be re-exported from `std` (through `alloc`)

These are stable:

`core::slice::{SplitInclusive, SplitInclusiveMut}`

This one is still unstable:

`core::slice::EscapeAscii` (cc rust-lang#77174)
@QuineDot
Copy link

QuineDot commented Nov 9, 2021

Happy to see this land.

The documentation should

  • link to escape_default or include the list of escapes inline
  • mention that the iterator is over u8
  • mention that it implements Display for those wishing to display escaped bytes without allocating (who aren't aware of the connection with ToString)

@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Nov 11, 2021
@clarfonthey
Copy link
Contributor Author

clarfonthey commented Feb 7, 2022

Adding another comment to this, since there hasn't been a stabilisation PR: should stabilising this also deprecate the std::ascii module, since this is basically the last thing from that module that hasn't been moved over to an inherent method? I personally vote yes, but I understand if others disagree. Would rather not close this issue before an official decision is made, but that's also not my decision to make, so :p

@yaahc yaahc added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Feb 7, 2022
@yaahc
Copy link
Member

yaahc commented Feb 7, 2022

Nominated so we can make sure this gets discussed during our next libs-api team meeting on Wednesday.

@clarfonthey
Copy link
Contributor Author

Also adding more details on what the deprecation would look like, for full clarity. When I say std here, that includes core as well.

  1. Deprecate std::ascii module, std::ascii::EscapeDefault struct, and std::ascii::escape_default function.
  2. Stably re-export std::ascii::EscapeDefault somewhere else. I vote putting it in std::num::EscapeAscii, but a case for putting it in std::char or std::str could probably be made.
  3. Presumably, we want to move the implementations in std::ascii to their "permanent" locations and make the std::ascii module simply a re-export with a deprecation attribute.
  4. One final thing to consider: is std::slice::EscapeAscii the right place for the slice-based iterator? There could be an argument for putting it in std::str instead, and then the single-byte version could go in std::char. Except, a version implemented for char would still just use the slice version, since chars can be multiple bytes. This bit isn't super important, but I feel that stabilising the method should still stabilise the iterator, so it can be embedded in structs easily.

@joshtriplett
Copy link
Member

We discussed this in today's @rust-lang/libs-api meeting. We agreed that we don't want to treat std::ascii deprecation as a blocker; that should be a separate PR.

We'd love to see a stabilization PR for this feature.

@clarfonthey
Copy link
Contributor Author

Opened stabilisation PR #93886 and tracking issue #93887 for discussing the deprecation of std::ascii, so that this can be closed post-stabilisation.

clarfonthey added a commit to clarfonthey/rust that referenced this issue Feb 12, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 13, 2022
…Mark-Simulacrum

Stabilise inherent_ascii_escape (FCP in rust-lang#77174)

Implements rust-lang#77174, which completed its FCP.

This does *not* deprecate any existing methods or structs, as that is tracked in rust-lang#93887. That stated, people should prefer using `u8::escape_ascii` to `std::ascii::escape_default`.
bors added a commit to rust-lang-ci/rust that referenced this issue Feb 13, 2022
…askrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#89926 (make `Instant::{duration_since, elapsed, sub}` saturating and remove workarounds)
 - rust-lang#90532 (More informative error message for E0015)
 - rust-lang#93810 (Improve chalk integration)
 - rust-lang#93851 (More practical examples for `Option::and_then` & `Result::and_then`)
 - rust-lang#93885 (bootstrap.py: Suggest disabling download-ci-llvm option if url fails to download)
 - rust-lang#93886 (Stabilise inherent_ascii_escape (FCP in rust-lang#77174))
 - rust-lang#93930 (add link to format_args! when mention it in docs)
 - rust-lang#93936 (Couple of driver cleanups)
 - rust-lang#93944 (Don't relabel to a team if there is already a team label)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@clarfonthey
Copy link
Contributor Author

("Implements" isn't on GitHub's close term list, but, this was merged.)

@dtolnay dtolnay removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-str Area: str and String C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. Libs-Tracked Libs issues that are tracked on the team's project board. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests