summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-07-24Add `string::raw::from_buf`Adolfo Ochagavía-2/+1
2014-07-24Fix travis errorsAdolfo Ochagavía-1/+1
2014-07-24Deprecated `str::raw::from_buf_len`Adolfo Ochagavía-5/+5
Replaced by `string::raw::from_buf_len` [breaking-change]
2014-07-24Deprecated `str::raw::from_c_str`Adolfo Ochagavía-1/+1
Use `string::raw::from_buf` instead [breaking-change]
2014-07-24Remove OwnedStr traitAdolfo Ochagavía-6/+2
This trait was only implemented by `String`. It provided the methods `into_bytes` and `append`, both of which **are already implemented as normal methods** of `String` (not as trait methods). This change improves the consistency of strings. This shouldn't break any code, except if somebody has implemented `OwnedStr` for a user-defined type.
2014-07-24Cleanup HashMap documentation.Jonas Hietala-53/+68
Link to mentioned methods. Use `# Failure` tags to describe failure. Make `pop_equiv`, `find_equiv` and `get_copy` standalone.
2014-07-24Cleanup LruCache doc.Jonas Hietala-9/+8
2014-07-24Documentation examples for LruCache.Jonas Hietala-0/+86
2014-07-24Remove explicit rust code specifier. Unhide use HashMap.Jonas Hietala-56/+56
2014-07-24Fill in example code for HashMap.Jonas Hietala-19/+293
Add an example showing how to use the map with a custom type. Fill in examples for methods in the hashmap file without ones. Also move pop_equiv next to related public methods, to not create a duplicate trait implementation in the docs.
2014-07-23Just land alreadyBrian Anderson-1/+1
2014-07-23Remove kludgy imports from vec! macroBrian Anderson-3/+1
2014-07-23collections: Move push/pop to MutableSeqBrian Anderson-9/+16
Implement for Vec, DList, RingBuf. Add MutableSeq to the prelude. Since the collections traits are in the prelude most consumers of these methods will continue to work without change. [breaking-change]
2014-07-22auto merge of #15876 : brson/rust/failfat, r=pcwaltonbors-2/+3
Adds a new runtime unwinding function that encapsulates the printing of the words "explicit failure" when `fail!()` is called w/o arguments. The before/after optimized assembly: ``` leaq "str\"str\"(1412)"(%rip), %rax movq %rax, 24(%rsp) movq $16, 32(%rsp) leaq "str\"str\"(1413)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 24(%rsp), %rdi leaq 8(%rsp), %rsi movl $11, %edx callq _ZN6unwind12begin_unwind21h15836560661922107792E ``` ``` leaq "str\"str\"(1369)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 8(%rsp), %rdi movl $11, %esi callq _ZN6unwind31begin_unwind_no_time_to_explain20hd1c720cdde6a116480dE@PLT ``` Before/after filesizes: rwxrwxr-x 1 brian brian 21479503 Jul 20 22:09 stage2-old/lib/librustc-4e7c5e5c.so rwxrwxr-x 1 brian brian 21475415 Jul 20 22:30 x86_64-unknown-linux-gnu/stage2/lib/librustc-4e7c5e5c.so This is the lowest-hanging fruit in the fail-bloat wars. Further fixes are going to require harder tradeoffs. r? @pcwalton
2014-07-22auto merge of #15867 : cmr/rust/rewrite-lexer4, r=alexcrichtonbors-0/+18
2014-07-21Add a ton of ignore-lexer-testCorey Richardson-0/+14
2014-07-21Use fewer instructions for `fail!`Brian Anderson-2/+3
Adds a special-case fail function, rustrt::unwind::begin_unwind_no_time_to_explain, that encapsulates the printing of the words "explicit failure". The before/after optimized assembly: ``` leaq "str\"str\"(1369)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 8(%rsp), %rdi movl $11, %esi callq _ZN6unwind31begin_unwind_no_time_to_explain20hd1c720cdde6a116480dE@PLT ``` ``` leaq "str\"str\"(1412)"(%rip), %rax movq %rax, 24(%rsp) movq $16, 32(%rsp) leaq "str\"str\"(1413)"(%rip), %rax movq %rax, 8(%rsp) movq $19, 16(%rsp) leaq 24(%rsp), %rdi leaq 8(%rsp), %rsi movl $11, %edx callq _ZN6unwind12begin_unwind21h15836560661922107792E ``` Before/after filesizes: rwxrwxr-x 1 brian brian 21479503 Jul 20 22:09 stage2-old/lib/librustc-4e7c5e5c.so rwxrwxr-x 1 brian brian 21475415 Jul 20 22:30 x86_64-unknown-linux-gnu/stage2/lib/librustc-4e7c5e5c.so
2014-07-21ignore-lexer-test to broken files and remove some tray hyphensCorey Richardson-0/+4
I blame @ChrisMorgan for the hyphens.
2014-07-21Rename to_str to to_stringSteven Fackler-4/+4
Closes #15796. [breaking-change]
2014-07-20auto merge of #15797 : brson/rust/taskstab, r=alexcrichtonbors-22/+37
Summary: * alloc::rc module stable * Rc type stable * Functions relating to weak references experimental * core::cmp module stable * PartialEq/Eq/PartialOrd/Ord unstable because trait reform will make them change again * Equiv experimental because there may be better sol'ns * lexical_ordering deprecated because it can be done trivially with the Ord trait * min/max stable * std::task module stable * TaskBuilder::stdout/stderr experimental because we aren't certain we want to configure the environment this way * try_future experimental because Future is experimental * try unstable because the error type might change * deschedule/failing unstable The major thing I did differently than previously-discussed is that I made `try` experimental: there's been discussion that the error type `Box<Any + Send>` is not sufficient. Per https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-07-16.md.
2014-07-19auto merge of #15746 : steveklabnik/rust/docs_random, r=alexcrichtonbors-9/+14
This is now linked to in the guide, so I want to make sure it's good. This adds a bit more explanation, and brings usage in line with current good style.
2014-07-18std: Stabilize task module.Brian Anderson-22/+37
Most stable. deschedule/failing experimental because of concerns about naming and desirability. Adds task::name() to replace deprecated task::with_name().
2014-07-18Improve documentation for rand::randomSteve Klabnik-9/+14
This is now linked to in the guide, so I want to make sure it's good. This adds a bit more explanation, and brings usage in line with current good style.
2014-07-18Remove examples from trait implementations. Unhide imports.Jonas Hietala-154/+18
2014-07-18Fill in documentation for HashSet.Jonas Hietala-37/+267
Example how to use the set with a custom type. Fill in examples for the missing methods.
2014-07-16Extend HashSet documentation.Jonas Hietala-4/+159
Add main example and simple examples for the methods.
2014-07-15auto merge of #15619 : kwantam/rust/master, r=huonwbors-6/+5
- `width()` computes the displayed width of a string, ignoring the width of control characters. - arguably we might do *something* else for control characters, but the question is, what? - users who want to do something else can iterate over chars() - `graphemes()` returns a `Graphemes` struct, which implements an iterator over the grapheme clusters of a &str. - fully compliant with [UAX#29](http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries) - passes all [Unicode-supplied tests](http://www.unicode.org/reports/tr41/tr41-15.html#Tests29) - added code to generate additionial categories in `unicode.py` - `Cn` aka `Not_Assigned` - categories necessary for grapheme cluster breaking - tidied up the exports from libunicode - all exports are exposed through a module rather than directly at crate root. - std::prelude imports UnicodeChar and UnicodeStrSlice from std::char and std::str rather than directly from libunicode closes #7043
2014-07-15Fix errorsAdolfo Ochagavía-18/+11
2014-07-15Deprecate `str::from_utf8_lossy`Adolfo Ochagavía-15/+14
Use `String::from_utf8_lossy` instead [breaking-change]
2014-07-15Deprecate `str::from_utf16_lossy`Adolfo Ochagavía-1/+1
Use `String::from_utf16_lossy` instead. [breaking-change]
2014-07-15Deprecate `str::from_utf16`Adolfo Ochagavía-4/+4
Use `String::from_utf16` instead [breaking-change]
2014-07-15Deprecate `str::from_char`Adolfo Ochagavía-14/+10
Use `String::from_char` or `.to_str` instead [breaking-change]
2014-07-15Deprecate `str::from_utf8_owned`Adolfo Ochagavía-20/+15
Use `String::from_utf8` instead [breaking-change]
2014-07-14add Graphemes iterator; tidy unicode exportskwantam-6/+5
- Graphemes and GraphemeIndices structs implement iterators over grapheme clusters analogous to the Chars and CharOffsets for chars in a string. Iterator and DoubleEndedIterator are available for both. - tidied up the exports for libunicode. crate root exports are now moved into more appropriate module locations: - UnicodeStrSlice, Words, Graphemes, GraphemeIndices are in str module - UnicodeChar exported from char instead of crate root - canonical_combining_class is exported from str rather than crate root Since libunicode's exports have changed, programs that previously relied on the old export locations will need to change their `use` statements to reflect the new ones. See above for more information on where the new exports live. closes #7043 [breaking-change]
2014-07-14std: Make unlink() more consistentAlex Crichton-5/+43
Currently when a read-only file has unlink() invoked on it on windows, the call will fail. On unix, however, the call will succeed. In order to have a more consistent behavior across platforms, this error is recognized on windows and the file is changed to read-write before removal is attempted.
2014-07-14auto merge of #15653 : erickt/rust/master, r=alexcrichtonbors-2/+2
2014-07-14auto merge of #15649 : catharsis/rust/rust-libstd-examples, r=alexcrichtonbors-7/+45
This patch adds doc examples for the make_absolute, change_dir, errors_string and args functions in the os module.
2014-07-13std: make std::io::IoError{,Kind} implement EqErick Tryzelaar-2/+2
2014-07-13auto merge of #15591 : aturon/rust/box-cell-stability, r=alexcrichtonbors-23/+26
This PR is the outcome of the library stabilization meeting for the `liballoc::owned` and `libcore::cell` modules. Aside from the stability attributes, there are a few breaking changes: * The `owned` modules is now named `boxed`, to better represent its contents. (`box` was unavailable, since it's a keyword.) This will help avoid the misconception that `Box` plays a special role wrt ownership. * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move` method is renamed to `downcast`, in both cases to improve clarity. * The recently-added `AnySendOwnExt` extension trait is removed; it was not being used and is unnecessary. [breaking-change]
2014-07-13Stabilization for `owned` (now `boxed`) and `cell`Aaron Turon-23/+26
This PR is the outcome of the library stabilization meeting for the `liballoc::owned` and `libcore::cell` modules. Aside from the stability attributes, there are a few breaking changes: * The `owned` modules is now named `boxed`, to better represent its contents. (`box` was unavailable, since it's a keyword.) This will help avoid the misconception that `Box` plays a special role wrt ownership. * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move` method is renamed to `downcast`, in both cases to improve clarity. * The recently-added `AnySendOwnExt` extension trait is removed; it was not being used and is unnecessary. [breaking-change]
2014-07-13libstd: Add a few doc examplesAnton Lofgren-7/+45
This patch adds doc examples for the make_absolute, change_dir, errors_string and args functions in the os module.
2014-07-13auto merge of #15639 : supr/rust/master, r=sfacklerbors-1/+1
* Fixes a typo in the libstd documentation, referring UPD instead of UDP
2014-07-13auto merge of #15584 : alexcrichton/rust/warn-annoyances, r=cmrbors-1/+6
* Don't warn about `#[crate_name]` if `--crate-name` is specified * Don't warn about non camel case identifiers on `#[repr(C)]` structs * Switch `mode` to `mode_t` in libc.
2014-07-12Fix Documentation Typo in libstdPrudhvi Krishna Surapaneni-1/+1
2014-07-12auto merge of #15617 : aturon/rust/std-more-experimental, r=alexcrichtonbors-0/+2
The `hash` module was not included in an earlier pass that sets baseline stability of modules within `std` to `experimental`.
2014-07-12auto merge of #15610 : brson/rust/0.12.0, r=alexcrichtonbors-1/+1
2014-07-12auto merge of #15592 : arjantop/rust/bufwriter-write-fix, r=alexcrichtonbors-2/+4
First condition is not needed and just prevents 0 length writes Fixes #15583
2014-07-12auto merge of #15588 : alexcrichton/rust/issue-15478, r=cmrbors-6/+12
If modified, you can safely unmap arbitrary memory. These fields are not intended to be modified, so read-only accessors are the only ones that are provided. Closes #15478
2014-07-11libc: Switch open to use a mode_t on unixAlex Crichton-1/+6
While I'm at it, export O_SYNC with the other flags that are exported. Closes #15582
2014-07-11std: Move MemoryMap fields to methodsAlex Crichton-6/+12
If modified, you can safely unmap arbitrary memory. These fields are not intended to be modified, so read-only accessors are the only ones that are provided. Closes #15478