Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for str escaping #27791
Comments
alexcrichton
added
T-libs
B-unstable
E-easy
labels
Aug 13, 2015
This comment has been minimized.
This comment has been minimized.
AnthonyBroadCrawford
commented
Sep 21, 2015
|
@alexcrichton Mind if I take this issue? |
This comment has been minimized.
This comment has been minimized.
|
@AnthonyBroadCrawford certainly! The workflow for this would probably look like:
|
This comment has been minimized.
This comment has been minimized.
|
The reason given for why they're currently unstable says that they might be rewritten to return a char iterator instead? |
This comment has been minimized.
This comment has been minimized.
|
Maybe we can consider the idea of them returning iterators, but those iterators implementing |
This comment has been minimized.
This comment has been minimized.
|
@bluss You can already do |
This comment has been minimized.
This comment has been minimized.
|
True. With |
Manishearth
removed
the
E-easy
label
Oct 2, 2015
alexcrichton
added
I-nominated
final-comment-period
and removed
I-nominated
labels
Dec 16, 2015
This comment has been minimized.
This comment has been minimized.
|
For now this FCP will be for returning a |
This comment has been minimized.
This comment has been minimized.
|
Given that we have I do admit that I find it strange that these methods are in |
This comment has been minimized.
This comment has been minimized.
|
As previous, I favour using Display-based interfaces for composability. For example |
This comment has been minimized.
This comment has been minimized.
|
@BurntSushi The problem with going through |
This comment has been minimized.
This comment has been minimized.
|
@aturon Good point. If others feel good about returning an iterator, then I'm happy with that! |
This comment has been minimized.
This comment has been minimized.
|
The libs team discussed this in triage recently and the decision was to punt on this for now. It was brought up that with the exact same name as // signature
fn escape_default(&self) -> EscapeDefault;
As pointed out, just implementing It's also a possibility that we could return one trait implementation and then add the other in a backwards-compatible fashion in the future. While we decide this, however, this is being removed from FCP. |
alexcrichton
removed
the
final-comment-period
label
Jan 15, 2016
alexcrichton
referenced this issue
Jul 26, 2016
Merged
Escape fewer Unicode codepoints in `Debug` impl of `str` #34485
This comment has been minimized.
This comment has been minimized.
|
Just wanted to note that if it's decided that these methods are best implemented as (obviously that'd be a breaking change, but it's something definitely worth considering) |
This comment has been minimized.
This comment has been minimized.
|
@clarcharr
Probably we’d deprecate the old methods but not remove them. |
dtolnay
referenced this issue
Jun 3, 2017
Closed
Tracking issue for the functions for debug escaping `char_escape_debug` #35068
Mark-Simulacrum
added
the
C-tracking-issue
label
Jul 22, 2017
This comment has been minimized.
This comment has been minimized.
|
This feature is about three inherent methods of the The libs team discussed this and the consensus was to stabilize, after changing the return type (from @rfcbot fcp merge |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 28, 2018
•
|
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once a majority of reviewers approve (and none object), 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
added
the
proposed-final-comment-period
label
Mar 28, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Mar 28, 2018
|
|
rfcbot
added
the
final-comment-period
label
Mar 28, 2018
This comment has been minimized.
This comment has been minimized.
mominul
commented
May 31, 2018
|
As the FCP period is completed, now the rest is stabilization, isn't it? Should I follow these steps to tackle this? Sorry if I am getting things wrong! |
This comment has been minimized.
This comment has been minimized.
|
Correct, the next step is a stabilization PR. But those steps are for language features implemented in the compiler and mostly not relevant to library features. In the standard library some Note however that in this case we agreed to stabilized after making some changes to the API: #27791 (comment). (This can be two commits in the same PR.) If you want to submit a PR feel free to ping me on it for review. |
This comment has been minimized.
This comment has been minimized.
|
This is an interesting case here, as it is possibly the first time since the 1.26.0 release where we are stabilizing a function that returns an iterator. So we have the chance to return |
This comment has been minimized.
This comment has been minimized.
|
The agreed API is not just an iterator, but also something that implements Given the noted disadvantages I’m inclined to go with "traditional" dedicated types here. In particular, not being able to name the return type seems significant. |
This comment has been minimized.
This comment has been minimized.
Yes. Note that @mominul had been reaching out for help on |
This comment has been minimized.
This comment has been minimized.
|
Personally, I think that it would be best to make concrete types for now, like the rest of the standard library. At some point, though, it would be nice to be able to soft-deprecate all of the concrete iterator types and replace them with |
This comment has been minimized.
This comment has been minimized.
For many of the adapters, that will actually need to be quite longer. For |
This comment has been minimized.
This comment has been minimized.
|
Err, you're right. It seems that a few trait aliases might come in handy for that. Not sure about |
This comment has been minimized.
This comment has been minimized.
|
For most iterator adapters (including Map) that doesn't even work because many impls are conditional on what traits the wrapped iterator implements -- DoubleEndedIterator, ExactSizeIterator, Clone, etc. I also suspect there's problems with variance but that's probably less of a problem in practice. |
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
referenced this issue
Feb 1, 2019
Merged
Stabilize str::escape_* methods with new return types… #58051
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 1, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 3, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 3, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 6, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 6, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 7, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 7, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 12, 2019
SimonSapin
added a commit
to SimonSapin/rust
that referenced
this issue
Feb 12, 2019
bors
added a commit
that referenced
this issue
Feb 12, 2019
This comment has been minimized.
This comment has been minimized.
|
Stabilized in #58051. |
alexcrichton commentedAug 13, 2015
•
edited
This is a tracking issue for the unstable
str_escapefeature in the standard library. The open questions I know of here are:charimplementations)I suspect that because the implementations on
charare stable that we'll also stabilize these.Signatures: