rust/src/libcore/num
bors 94ede93467 Auto merge of #44042 - LukasKalbertodt:ascii-methods-on-instrinsics, r=alexcrichton
Copy all `AsciiExt` methods to the primitive types directly in order to deprecate it later

**EDIT:** [this PR is ready now](https://github.com/rust-lang/rust/pull/44042#issuecomment-333883548). I edited this post to reflect the current status of discussion, which is (apart from code review) pretty much settled.

---

This is my current progress in order to prepare stabilization of #39658. As discussed there (and in #39659), the idea is to deprecated `AsciiExt` and copy all methods to the type directly. Apparently there isn't really a reason to have those methods in an extension trait¹.

~~This is **work in progress**: copy&pasting code while slightly modifying the documentation isn't the most exciting thing to do. Therefore I wanted to already open this WIP PR after doing basically 1/4 of the job (copying methods to `&[u8]`, `char` and `&str` is still missing) to get some feedback before I continue. Some questions possibly worth discussing:~~

1. ~~Does everyone agree that deprecating `AsciiExt` is a good idea? Does everyone agree with the goal of this PR?~~ => apparently yes
2. ~~Are my changes OK so far? Did I do something wrong?~~
3. ~~The issue of the unstable-attribute is currently set to 0. I would wait until you say "Ok" to the whole thing, then create a tracking issue and then insert the correct issue id. Is that ok?~~
4. ~~I tweaked `eq_ignore_ascii_case()`: it now takes the argument `other: u8` instead of `other: &u8`. The latter was enforced by the trait. Since we're not bound to a trait anymore, we can drop the reference, ok?~~ => I reverted this, because the interface has to match the `AsciiExt` interface exactly.

¹ ~~Could it be that we can't write `impl [u8] {}`? This might be the reason for `AsciiExt`. If that is the case: is there a good reason we can't write such an impl block? What can we do instead?~~ => we couldn't at the time this PR was opened, but Simon made it possible.

/cc @SimonSapin @zackw
2017-11-05 11:42:59 +00:00
..
dec2flt Removed the incorrect documentation for from_str 2017-09-04 22:16:15 -04:00
flt2dec use field init shorthand EVERYWHERE 2017-08-15 15:29:17 -07:00
bignum.rs Move libXtest into libX/tests 2017-04-03 20:49:39 +02:00
diy_float.rs use field init shorthand EVERYWHERE 2017-08-15 15:29:17 -07:00
f32.rs Update bootstrap compiler 2017-08-31 06:58:58 -07:00
f64.rs Fix overflowing_literals lint for large f32s 2017-07-19 03:22:45 +01:00
i8.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
i16.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
i32.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
i64.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
i128.rs Make members of {std,core}::{i128,u128} unstable 2017-01-06 03:53:55 +01:00
int_macros.rs Fix a few impl stability attributes 2017-01-29 13:31:47 +00:00
isize.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
mod.rs Auto merge of #44042 - LukasKalbertodt:ascii-methods-on-instrinsics, r=alexcrichton 2017-11-05 11:42:59 +00:00
u8.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
u16.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
u32.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
u64.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
u128.rs Make members of {std,core}::{i128,u128} unstable 2017-01-06 03:53:55 +01:00
uint_macros.rs Fix a few impl stability attributes 2017-01-29 13:31:47 +00:00
usize.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
wrapping.rs Manuall rebase of @Migi pull/41336 2017-09-03 09:12:22 -04:00