-
Notifications
You must be signed in to change notification settings - Fork 9
Rename AllocErr to AllocError #57
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
As we are in the module |
Maybe, though those modules only have one error type while |
On a less serious note, we also have an |
|
That… hadn’t occurred to me but it makes sense. It may even be worth making the move and having re-exports for compat. |
Actually I was just about posting a proposal... #59 |
We should decide, if we want One other thing to consider is, that We basically have to decide, if we want to go the old |
I don't mind the way it is right now, especially considering |
Doing a quick survey of all the error types in std, we have: Errorstd::io::Error
std::fmt::Error _ Errorstd::array::TryFromSliceError
std::cell::BorrowError
std::cell::BorrowMutError
std::char::CharTryFromError
std::char::DecodeUtf16Error
std::char::ParseCharError
std::collections::TryReserveError [unstable]
std::env::JoinPathsError
std::env::VarError
std::ffi::FromBytesWithNulError
std::ffi::FromVecWithNulError [unstable]
std::ffi::IntoStringError
std::ffi::NulError
std::io::IntoInnerError
std::net::AddrParseError
std::num::ParseFloatError
std::num::ParseIntError
std::num::TryFromIntError
std::option::NoneError
std::path::StripPrefixError
std::str::Utf8Error
std::string::FromUtf16Error
std::string::FromUtf8Error
std::string::ParseError
std::sync::PoisonError
std::sync::TryLockError
std::sync::mpsc::RecvError
std::sync::mpsc::RecvTimeoutError
std::sync::mpsc::SendError
std::sync::mpsc::TryRecvError
std::sync::mpsc::TrySendError
std::thread::AccessError
std::time::SystemTimeError _ Errstd::alloc::LayoutErr I think it makes the most sense to go with Also I think it would be nice if we could deprecate |
|
Is it possible to write #[stable]
pub type LayoutError = LayoutErr; and deprecate Is a type alias 100% backwards compatible when changing it to the actual struct? Or vice versa? |
Iff we change |
You could also "soft deprecate" it, by simply writing a note in the docs about it.
I believe so |
Assuming this works, we should rename However, if I'd go with @exrook suggestion and just rename
|
io::Error and fmt::Error are actually the ones that don't fit the style of the rest of the standard library. (In a world where we could rename everything, they'd probably get a rename too.) |
…plett Rename AllocErr to AllocError Implements rust-lang/wg-allocators#57
…plett Rename AllocErr to AllocError Implements rust-lang/wg-allocators#57
Almost every error type in the standard library is named
SomethingError
, notSomethingErr
. The one exception isLayoutErr
, which is stable and so can’t easily be renamed. AlthoughLayoutErr
has more "proximity" toAllocErr
(being in the same module) I think we should leave it as a lone inconsistency rather than make it a second naming pattern to follow.The text was updated successfully, but these errors were encountered: