rust/src/libsyntax
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
..
diagnostics Make the difference between lint codes and error codes explicit 2017-11-02 10:19:41 +01:00
ext Lifting Generics from MethodSig to TraitItem and ImplItem since we want to support generics in each variant of TraitItem and ImplItem 2017-10-17 22:14:14 -04:00
parse Auto merge of #45711 - tirr-c:unicode-span, r=estebank 2017-11-04 23:09:19 +00:00
print Fix unsafe auto trait pretty print. 2017-11-03 16:13:23 -02:00
util Add support for ..= syntax 2017-09-22 22:05:18 +02:00
abi.rs add thiscall calling convention support 2017-05-24 16:40:03 -04:00
ast.rs add auto keyword, parse auto trait, lower to HIR 2017-11-03 16:13:20 -02:00
attr.rs Fix ICE 2017-09-20 20:48:06 +02:00
build.rs rustc: Add some build scripts for librustc crates 2017-07-22 22:04:13 -07:00
Cargo.toml Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
codemap.rs Display spans correctly when there are non-half-width characters 2017-11-03 03:15:39 +09:00
config.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
diagnostic_list.rs Add support for ..= syntax 2017-09-22 22:05:18 +02:00
entry.rs Cleanup InternedString. 2016-11-21 09:00:56 +00:00
feature_gate.rs Auto merge of #44042 - LukasKalbertodt:ascii-methods-on-instrinsics, r=alexcrichton 2017-11-05 11:42:59 +00:00
fold.rs add auto keyword, parse auto trait, lower to HIR 2017-11-03 16:13:20 -02:00
json.rs Make the difference between lint codes and error codes explicit 2017-11-02 10:19:41 +01:00
lib.rs Remove rustc_bitflags; use the bitflags crate 2017-09-17 14:19:24 -04:00
ptr.rs Replace some matches with try. 2017-06-07 12:15:39 +09:00
README.md rework the README.md for rustc and add other readmes 2017-09-19 09:00:59 -04:00
show_span.rs use field init shorthand EVERYWHERE 2017-08-15 15:29:17 -07:00
std_inject.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
str.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
test.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
test_snippet.rs Add short message-format 2017-10-20 16:04:32 +02:00
tokenstream.rs Make fields of Span private 2017-08-30 01:38:54 +03:00
visit.rs add auto keyword, parse auto trait, lower to HIR 2017-11-03 16:13:20 -02:00

NB: This crate is part of the Rust compiler. For an overview of the compiler as a whole, see the README.md file found in librustc.

The syntax crate contains those things concerned purely with syntax that is, the AST ("abstract syntax tree"), parser, pretty-printer, lexer, macro expander, and utilities for traversing ASTs.