-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #23104 - japaric:inherent, r=nikomatsakis
- Allow inherent implementations on `char`, `str`, `[T]`, `*const T`, `*mut T` and all the numeric primitives. - copy `unicode::char::CharExt` methods into `impl char` - remove `unicode::char::CharExt`, its re-export `std::char::CharExt` and `CharExt` from the prelude - copy `collections::str::StrExt` methods into `impl str` - remove `collections::str::StrExt` its re-export `std::str::StrExt`, and `StrExt` from the prelude - copy `collections::slice::SliceExt` methods into `impl<T> [T]` - remove `collections::slice::SliceExt` its re-export `std::slice::SliceExt`, and `SliceExt` from the prelude - copy `core::ptr::PtrExt` methods into `impl<T> *const T` - remove `core::ptr::PtrExt` its re-export `std::ptr::PtrExt`, and `PtrExt` from the prelude - copy `core::ptr::PtrExt` and `core::ptr::MutPtrExt` methods into `impl<T> *mut T` - remove `core::ptr::MutPtrExt` its re-export `std::ptr::MutPtrExt`, and `MutPtrExt` from the prelude - copy `core::num::Int` and `core::num::SignedInt` methods into `impl i{8,16,32,64,size}` - copy `core::num::Int` and `core::num::UnsignedInt` methods into `impl u{8,16,32,64,size}` - remove `core::num::UnsignedInt` and its re-export `std::num::UnsignedInt` - move `collections` tests into its own crate: `collectionstest` - copy `core::num::Float` methods into `impl f{32,64}` Because this PR removes several traits, this is a [breaking-change], however functionality remains unchanged and breakage due to unresolved imports should be minimal. If you encounter an error due to an unresolved import, simply remove the import: ``` diff fn main() { - use std::num::UnsignedInt; //~ error: unresolved import `std::num::UnsignedInt`. - println!("{}", 8_usize.is_power_of_two()); } ``` --- cc #16862 [preview docs](http://japaric.github.io/inherent/std/index.html) [unicode::char](http://japaric.github.io/inherent/unicode/primitive.char.html) [collections::str](http://japaric.github.io/inherent/collections/primitive.str.html) [std::f32](http://japaric.github.io/inherent/std/primitive.f32.html)
- Loading branch information
Showing
90 changed files
with
15,384 additions
and
8,830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.