about summary refs log tree commit diff
path: root/src/librustc_unicode
AgeCommit message (Collapse)AuthorLines
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-3842/+0
Fixes #26554.
2016-11-26Auto merge of #38008 - bluss:rustbuild-benches, r=alexcrichtonbors-0/+1
Add rustbuild command `bench` Add command bench to rustbuild, so that `./x.py bench <path>` can compile and run benchmarks. `./x.py bench --stage 1 src/libcollections` and `./x.py bench --stage 1 src/libstd` should both compile well. Just `./x.py bench` runs all benchmarks for the libstd crates. Fixes #37897
2016-11-26rustbuild: Add bench = false to std shim cratesUlrik Sverdrup-0/+1
2016-11-23Use "radices" instead of "radicum"Sam Estep-2/+2
2016-10-01std: Correct stability attributes for some implementationsOliver Middleton-0/+3
These are displayed by rustdoc so should be correct.
2016-09-28[breaking-change] std: change `encode_utf{8,16}()` to take a buffer and ↵tormol-28/+74
return a slice They panic if the buffer is too small.
2016-08-29Implement TryFrom<u32> for charSimon Sapin-0/+3
For symmetry with From<char> for u32.
2016-08-18Add a FusedIterator trait.Steven Allen-1/+15
This trait can be used to avoid the overhead of a fuse wrapper when an iterator is already well-behaved. Conforming to: RFC 1581 Closes: #35602
2016-07-28Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichtonbors-1/+37
Escape fewer Unicode codepoints in `Debug` impl of `str` Use the same procedure as Python to determine whether a character is printable, described in [PEP 3138]. In particular, this means that the following character classes are escaped: - Cc (Other, Control) - Cf (Other, Format) - Cs (Other, Surrogate), even though they can't appear in Rust strings - Co (Other, Private Use) - Cn (Other, Not Assigned) - Zl (Separator, Line) - Zp (Separator, Paragraph) - Zs (Separator, Space), except for the ASCII space `' '` `0x20` This allows for user-friendly inspection of strings that are not English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`). Fixes #34318. CC #34422. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-28Rename `char::escape` to `char::escape_debug` and add tracking issueTobias Bucher-5/+5
2016-07-26Restore `char::escape_default` and add `char::escape` insteadTobias Bucher-1/+37
2016-07-22Fixed to spelling errors in char.rsCamille Roussel-2/+2
Fixed two small spelling mistakes (interator -> iterator) in the documentation for encode_utf8 and encode_utf16
2016-07-14Auto merge of #34599 - cuviper:unicode-9.0, r=alexcrichtonbors-848/+949
Update Unicode tables to 9.0 I just updated `unicode.py`'s generated copyright year, then ran it.
2016-07-14Auto merge of #33907 - strake:decode_utf8, r=alexcrichtonbors-0/+3
add core::char::DecodeUtf8 See [issue](https://github.com/rust-lang/rust/issues/33906)
2016-07-13add core::char::DecodeUtf8M Farkas-Dyck-0/+3
2016-07-09Auto merge of #33987 - crlf0710:patch-1, r=steveklabnikbors-2/+2
doc: Correct char::escape_unicode documentation. A quick fix for documentation.
2016-07-01Update Unicode tables to 9.0Josh Stone-848/+949
2016-06-08docs: Improve char::to_{lower,upper}case examplesOliver Middleton-9/+15
Collect the results to a String to make it clear that it will not always return only one char and add examples showing that.
2016-06-05run rustfmt on librustc_unicodeSrinivas Reddy Thatiparthy-13/+17
2016-06-01doc: Correct char::escape_unicode documentation.CrLF0710-2/+2
2016-04-20Add comment, reduce storage requirementsRaph Levien-161/+149
Adds a comment which explains the trie structure, and also does a little arithmetic on lookup (no measurable impact, looks like modern CPUs do this arithmetic in parallel with the memory lookup to find the node) to save a bit of space. As a result, the memory impact of the compiled tables is within a couple hundred bytes of the old bsearch-range structure.
2016-04-19Fix wrong shift in trie_lookup_range_tableRaph Levien-1/+1
Somehow got in my head that >> 8 was the right shift for a chunk of 64. Oops, sorry.
2016-04-19Efficient trie lookup for boolean Unicode propertiesRaph Levien-1130/+1261
Replace binary search of ranges with trie lookup using leaves of 64-bit bitmap chunks. Benchmarks suggest this is approximately 10x faster than the bsearch approach.
2016-04-11std: Stabilize APIs for the 1.9 releaseAlex Crichton-17/+38
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-03-28style: Use `iter` for IntoIterator parameter namesKamal Marhubi-3/+3
This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-26Rollup merge of #32440 - tshepang:compact, r=steveklabnikManish Goregaokar-132/+48
doc: remove needless bindings The extra syntax is more noise than help in simple examples like this
2016-03-24doc: remove needless bindingsTshepang Lekhonkhobe-132/+48
2016-03-22std: Change `encode_utf{8,16}` to return iteratorsAlex Crichton-62/+31
Currently these have non-traditional APIs which take a buffer and report how much was filled in, but they're not necessarily ergonomic to use. Returning an iterator which *also* exposes an underlying slice shouldn't result in any performance loss as it's just a lazy version of the same implementation, and it's also much more ergonomic! cc #27784
2016-03-11Auto merge of #32133 - alexcrichton:linkchecker, r=brsonbors-6/+6
Add a link validator to rustbuild This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general. There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time. The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely: 1. New steps are defined for building the tool and running the tool 2. The dependencies are configured 3. The steps are implemented In terms of the link checker, these commits do a few things: * A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet). * A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed. * A few rustdoc bugs here and there were fixed
2016-03-08doc: Fix a bunch of broken linksAlex Crichton-6/+6
A few categories: * Links into compiler docs were just all removed as we're not generating compiler docs. * Move up one more level to forcibly go to std docs to fix inlined documentation across the facade crates.
2016-03-07Auto merge of #29734 - Ryman:whitespace_consistency, r=Aatchbors-0/+14
libsyntax: be more accepting of whitespace in lexer Fixes #29590. Perhaps this may need more thorough testing? r? @Aatch
2016-02-24Use a character that requires two `u16`s in the examples for ↵tormol-6/+6
`char.encode_utf16()`
2016-02-23Correct char.encode_utf16() documentationtormol-1/+1
The "A buffer that's too small" example was calling encode_utf8().
2016-02-21Fix to_lowercase exampleGökhan Karabulut-3/+3
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-3/+3
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+12
These describe the structure of all our crate dependencies.
2016-02-01docs: Standardize on 'Errors' header in std docsKamal Marhubi-1/+1
2016-01-24mk: Move from `-D warnings` to `#![deny(warnings)]`Alex Crichton-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-16libsyntax: accept only whitespace with the PATTERN_WHITE_SPACE propertyKevin Butler-0/+14
This aligns with unicode recommendations and should be stable for all future unicode releases. See http://unicode.org/reports/tr31/#R3. This renames `libsyntax::lexer::is_whitespace` to `is_pattern_whitespace` so potentially breaks users of libsyntax.
2016-01-13Fix some broken and missing links in the docsOliver Middleton-4/+4
2016-01-12Auto merge of #30695 - ranma42:cleanup-unicode, r=alexcrichtonbors-19/+15
and the associated update of tables.rs The last commit is related to my comment to #29734.
2016-01-05Fix the spelling of "hexadecimal"Matt Kraai-2/+2
2016-01-04Update librustc_unicode/tables.rsAndrea Canciani-19/+15
with a new version generated by src/etc/unicode.py.
2015-12-21Register new snapshotsAlex Crichton-6/+0
Lots of cruft to remove!
2015-12-10Auto merge of #30182 - alexcrichton:remove-deprecated, r=aturonbors-96/+3
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-10std: Remove deprecated functionality from 1.5Alex Crichton-96/+3
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-09Fix link in char docsSteve Klabnik-3/+4
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-5/+1
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-25Remove all uses of `#[staged_api]`Vadim Petrochenkov-1/+1
2015-11-25Improve docs for std::charSteve Klabnik-20/+27
Part of #29428