Prelude: rename and consolidate extension traits#18559
Prelude: rename and consolidate extension traits#18559alexcrichton merged 1 commit intorust-lang:masterfrom
Conversation
There was a problem hiding this comment.
Would this be a good time to consolidate Str and StrPrelude? (or can we not do that?)
There was a problem hiding this comment.
People are definitely using Str for generics in libraries (for better or worse), so I don't want to lose it until we have a more general replacement (which I have some thoughts about, but for a different PR.)
|
Love seeing |
There was a problem hiding this comment.
I wonder, could this be called OrdSlicePrelude, and then we could use modules/renaming to import both this and the libcore version into the prelude?
There was a problem hiding this comment.
That may not help the docs, however.
There was a problem hiding this comment.
Yeah, so this is why I was thinking it might be nice for std to just define its own set of extension traits that hook into the underlying traits from core etc. I can't see a way to do that without duplicating the docs, though :-/
091700c to
ca1ba39
Compare
|
Pushed a fix for some of your changes, but looks like at least one of my comments got lost. I definitely agree that the names here are... terrible... but that's a little intentional (e.g with the That said, generalized Let me know whether you prefer the strategy I've taken here, or something with more concise names and where |
|
@alexcrichton Oh, the other comment that got eaten: the story with |
|
Sounds good to me, r=me with a rebase. |
|
We can discuss pursuing more aggressive options later, but this is certainly a good step forward |
e6ff48a to
8db009e
Compare
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](rust-lang/rfcs#344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes rust-lang#17917
8db009e to
cfafc1b
Compare
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](rust-lang/rfcs#344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes #17917
|
I pushed this manually because all tests passed and @bors is having a tough time catching up. |
fix: Fix a stack overflow when computing the sizedness of a struct that includes itself as the tail field
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses.
The renamings are consistent with the new
-Preludesuffix. There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules.Because this renames traits, it is a:
[breaking-change]
However, I do not expect any code that currently uses the standard library to actually break.
Closes #17917