rust/src/liballoc
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
..
benches Remove unused AsciiExt imports and fix tests related to ascii methods 2017-11-03 21:27:40 +01:00
btree Implement entry_and_modify 2017-10-06 09:10:31 +01:00
tests Remove unused AsciiExt imports and fix tests related to ascii methods 2017-11-03 21:27:40 +01:00
allocator.rs Fix most rendering warnings from switching to CommonMark 2017-10-20 15:29:35 -04:00
arc.rs Modify Rc/Arc language around mutability 2017-10-05 16:54:56 -04:00
binary_heap.rs address some FIXMEs whose associated issues were marked as closed 2017-09-30 11:33:47 +03:00
borrow.rs Remove unused AsciiExt imports and fix tests related to ascii methods 2017-11-03 21:27:40 +01:00
boxed_test.rs
boxed.rs Auto merge of #44877 - nvzqz:box-conversions, r=alexcrichton 2017-10-10 11:07:25 +00:00
Cargo.toml
fmt.rs Fix most rendering warnings from switching to CommonMark 2017-10-20 15:29:35 -04:00
heap.rs
lib.rs Mark several ascii methods as unstable again 2017-11-03 21:28:04 +01:00
linked_list.rs address some FIXMEs whose associated issues were marked as closed 2017-09-30 11:33:47 +03:00
macros.rs
range.rs
raw_vec.rs Fix typo. 2017-11-01 21:02:08 +08:00
rc.rs Modify Rc/Arc language around mutability 2017-10-05 16:54:56 -04:00
slice.rs Mark several ascii methods as unstable again 2017-11-03 21:28:04 +01:00
str.rs Mark several ascii methods as unstable again 2017-11-03 21:28:04 +01:00
string.rs Remove unused AsciiExt imports and fix tests related to ascii methods 2017-11-03 21:27:40 +01:00
vec_deque.rs address some FIXMEs whose associated issues were marked as closed 2017-09-30 11:33:47 +03:00
vec.rs Remove unused AsciiExt imports and fix tests related to ascii methods 2017-11-03 21:27:40 +01:00