-
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
libs: clean up enums now that namespacing has arrived #19253
Comments
Does someone want to make a list of the various enums this should apply to, so we can triage? |
Here's a list of enums whose variants are re-exported, by file:
I hope I haven't missed any. |
We don't really need to reexport Result's, Option's and Ordering's either since everyone will be pulling them from the prelude anyway. |
The type aliases json::JsonString and json::JsonObject were originally prefixed with 'json' to prevent collisions with (at the time) the enums json::String and json::Object respectively. Now that enum namespacing has landed, this 'json' prefix is redundant and can be removed: json::JsonArray -> json::Array json::JsonObject -> json::Object In addition, this commit also unpublicizes all of the re-exports in this JSON module, as a part of rust-lang#19253 [breaking-change]
All of the enum components had a redundant 'Type' specifier: TypeSymlink, TypeDirectory, TypeFile. This change removes them, replacing them with a namespace: FileType::Symlink, FileType::Directory, and FileType::RegularFile. RegularFile is used instead of just File, as File by itself could be mistakenly thought of as referring to the struct. Part of rust-lang#19253.
* Remove public reexports, as a part of rust-lang#19253 * Rename getopts::Fail_ to getopts::Fail * Didn't see a reason for the suffixed '_' * Removed getopts::FailType * Looked like it was only beings used for tests; refactored the tests to stop requiring it * A few other non-breaking trivial refactoring changes [breaking-change]
@sfackler I'll open a PR that gets rid of those reexports. If anyone has other suggestions for ones to get rid of, I can do them as well |
In regards to: rust-lang#19253 (comment) This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
In regards to: #19253 (comment) This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::\*, Result::\*, and Ordering::\*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
* Remove public reexports, as a part of #19253 * Rename getopts::Fail_ to getopts::Fail * Didn't see a reason for the suffixed '_' * Removed getopts::FailType * Looked like it was only beings used for tests; refactored the tests to stop requiring it * A few other non-breaking trivial refactoring changes [breaking-change]
In regards to: rust-lang#19253 (comment) This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
In regards to: rust-lang#19253 (comment) This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
Might as well mention that rust-lang/rfcs#497 will remove |
Remove most of the public reexports mentioned in rust-lang#19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/io/net/ip.rs * IpAddr * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
Remove most of the public reexports mentioned in rust-lang#19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/io/net/ip.rs * IpAddr * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
Remove most of the public reexports mentioned in rust-lang#19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
Part of rust-lang#19253 I would have removed this public reexport in rust-lang#19842, but rust-lang#19812 hadn't merged (and snapshotted) at the time In rust-lang#19407, I changed the codebase to stop utilizing this reexport [breaking-change]
Part of rust-lang#19253 I would have removed this public reexport in rust-lang#19842, but rust-lang#19812 hadn't merged (and snapshotted) at the time In rust-lang#19407, I changed the codebase to stop utilizing this reexport [breaking-change]
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes to the namespacing within the std::collections::hash_map, breaking some of Cargo code which imported these. rust-lang/rust@cf350ea, implementing changes proposed by RFC rust-lang#344, have also broken some code which relies on hash_set::SetItems (now renamed to hash_set::Iter). This commit fixes the incompatibilities: imports of std::collections::hash_map::{Occupied, Vacant} have been replaced by imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one instance where the SetItems has been used was replaced by the proper usage of Iter.
Status update with this issue: All of the public reexports that I mentioned in my previous comment have been removed (with the exceptions of the |
rust-lang/rust#19253 and rust-lang/rust@25f8051 have introduced changes to the namespacing within the std::collections::hash_map, breaking some of Cargo code which imported these. rust-lang/rust@cf350ea, implementing changes proposed by RFC #344, have also broken some code which relies on hash_set::SetItems (now renamed to hash_set::Iter). This PR fixes the incompatibilities: imports of std::collections::hash_map::{Occupied, Vacant} have been replaced by imports of std::collections::hash_map::Entry::{Occupied, Vacant} and one instance where the SetItems has been used was replaced by the proper usage of Iter.
Part of rust-lang#19253 [breaking-change]
Part of rust-lang#19253 [breaking-change]
Part of rust-lang#19253 [breaking-change]
Part of rust-lang#19253 [breaking-change]
Part of rust-lang#19253 [breaking-change]
Part of rust-lang#19253 [breaking-change]
Part of rust-lang#19253 [breaking-change]
I think this is done now, please let me know if there's anything left oustanding. |
In regards to: rust-lang/rust#19253 (comment) This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
In regards to: rust-lang/rust#19253 (comment) This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
Now that enums are namespaced, there's a fair amount of cleanup work to do in
libstd
.In particular:
A lot of this work will happen naturally during API stabilization, but it's also something that can tackled in parallel to help speed things up.
The text was updated successfully, but these errors were encountered: