summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-05-25Paper over privacy issues with Deref by changing field names.Huon Wilson-7/+9
Types that implement Deref can cause weird error messages due to their private fields conflicting with a field of the type they deref to, e.g., previously struct Foo { x: int } let a: Arc<Foo> = ...; println!("{}", a.x); would complain the the `x` field of `Arc` was private (since Arc has a private field called `x`) rather than just ignoring it. This patch doesn't fix that issue, but does mean one would have to write `a._ptr` to hit the same error message, which seems far less common. (This patch `_`-prefixes all private fields of `Deref`-implementing types.) cc #12808
2014-05-24auto merge of #14401 : aochagavia/rust/pr4, r=alexcrichtonbors-6/+48
Some functions implemented for the Ascii struct have the same functionality as other functions implemented for the normal chars. For consistency, I think they should have the same name, so I renamed the functions in Ascii to match the names in the Char trait. * Renamed `to_lower` to `to_lowercase` * Renamed `to_upper` to `to_uppercase` * Renamed `is_alpha` to `is_alphabetic` * Renamed `is_alnum` to `is_alphanumeric` * Renamed `is_lower` to `is_lowercase` * Renamed `is_upper` to `is_uppercase` [breaking-change]
2014-05-24auto merge of #14378 : huonw/rust/deque-adjustments, r=alexcrichtonbors-5/+5
Might as well remove the duplication/`forget` call.
2014-05-24auto merge of #14396 : vhbit/rust/opaque-mutex, r=alexcrichtonbors-23/+31
On some systems (iOS for example) mutex is represented by opaque data structure which doesn't play well with simple data copy. Therefore mutex should be initialized from magic static value and filled by OS only when it landed RC. Initially written for iOS but since landing iOS support might require quite a lot of time I think it is better to split parts which aren't directly related to iOS and merge them in
2014-05-24std: minor simplification to sync::deque.Huon Wilson-5/+5
2014-05-24Rename functions in AsciiAdolfo OchagavĂ­a-6/+48
Some functions implemented for the Ascii struct have the same functionality as other functions implemented for the normal chars. For consistency, I think they should have the same name, so I renamed the functions in Ascii to match the names in the Char trait. * Renamed `to_lower` to `to_lowercase` * Renamed `to_upper` to `to_uppercase` * Renamed `is_alpha` to `is_alphabetic` * Renamed `is_alnum` to `is_alphanumeric` * Renamed `is_lower` to `is_lowercase` * Renamed `is_upper` to `is_uppercase` [breaking-change]
2014-05-24auto merge of #14392 : alexcrichton/rust/mem-updates, r=sfacklerbors-5/+5
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-24Fixes problems on systems with opaque mutexValerii Hiora-23/+31
On some systems (iOS for example) mutex is represented by opaque data structure which doesn't play well with simple data copy. Therefore mutex should be initialized from magic static value and filled by OS only when it landed RC.
2014-05-23core: Finish stabilizing the `mem` module.Alex Crichton-5/+5
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-23auto merge of #14379 : brson/rust/simd, r=alexcrichtonbors-83/+24
Followup to https://github.com/mozilla/rust/pull/14331 and https://github.com/mozilla/rust/pull/12524
2014-05-23std: Move unstable::finally to std::finally. #1457Brian Anderson-5/+4
[breaking-change]
2014-05-23std: Move simd to core::simd and reexport. #1457Brian Anderson-63/+2
[breaking-change]
2014-05-23std: Move running_on_valgrind to rt::util. #1457Brian Anderson-15/+18
[breaking-change]
2014-05-23auto merge of #14368 : tedhorst/rust/master, r=alexcrichtonbors-1/+1
2014-05-23auto merge of #14359 : brson/rust/minordoc, r=alexcrichtonbors-2/+1
2014-05-23Minor library doc copyeditingBrian Anderson-2/+1
2014-05-23auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballardbors-74/+5
These have all been deprecated for awhile now, so it's likely time to start removing them.
2014-05-22updated hash value in reduced benchmarkTed Horst-1/+1
2014-05-22auto merge of #14357 : huonw/rust/spelling, r=pnkfelixbors-7/+7
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`. ```rust //! a //! b fn bar() {} ```
2014-05-22auto merge of #14314 : alexcrichton/rust/deriving-hash, r=brsonbors-1/+2
One of the long-term goals of the libstd facade is to move the collections library underneath the standard library. This would imply that libcollections today would invert its dependency with libstd. One of the primary blockers for doing this is the HashMap collection. Of its two major dependencies, hashing and randomness, this commit is the first step in dealing with hashing. When moving the hash module beneath libstd, it must break its primary dependence on the io::Writer trait (used as the hashing state). The proposed strategy for breaking this dependence is taking a similar path as core::fmt, which is to have the hash module define its own "writer trait". This trait would be similar to std::io::Writer, except that it would not return errors and it would have fewer convenience methods. The Hash trait today has its type parameter behind a feature gate (default type parameters), so this pending change will likely break no code which hasn't opted in to the feature gate. The SipState struct will lose its implementation of io::Writer, but it will regain similar methods for dealing with writing data. This change specifically prepares for the hash migration by modifying deriving(Hash) to use the std::hash::Writer bound instead of the std::io::Writer bound. This bound is currently wired to std::io::Writer, but after a snapshot it will have no need to be wired to the io writer trait.
2014-05-22auto merge of #14348 : alexcrichton/rust/doc.rust-lang.org, r=huonwbors-2/+2
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-137/+148
[breaking-change]
2014-05-22libstd: Remove all uses of `~str` from `libstd`Patrick Walton-203/+150
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-442/+494
2014-05-22Remove a slew of old deprecated functionsAlex Crichton-74/+5
2014-05-22Spelling/doc formatting fixes.Huon Wilson-7/+7
2014-05-22auto merge of #14322 : thestinger/rust/secret_santa_heap, r=alexcrichtonbors-3/+3
2014-05-21doc: Fix some broken linksAlex Crichton-1/+1
2014-05-21auto merge of #14307 : kballard/rust/vim_prelude_mutablecloneablevector, r=cmrbors-4/+4
Add slice::MutableCloneableVector to the prelude. It's the only slice trait that's currently missing. Update rust.vim to match the latest prelude and current set of keywords. Also teach it to handle box placement expressions specially.
2014-05-21Change static.rust-lang.org to doc.rust-lang.orgAlex Crichton-1/+1
The new documentation site has shorter urls, gzip'd content, and index.html redirecting functionality.
2014-05-21auto merge of #14301 : alexcrichton/rust/remove-unsafe-arc, r=brsonbors-343/+174
This type can be built with `Arc<Unsafe<T>>` now that liballoc exists.
2014-05-21std,green: Mark some queue types as NoShareAlex Crichton-3/+9
2014-05-21migrate from `exchange_malloc` to `allocate`Daniel Micay-3/+3
This is now only used internally by the compiler.
2014-05-21std: Change hash to reexport its own WriterAlex Crichton-1/+2
One of the long-term goals of the libstd facade is to move the collections library underneath the standard library. This would imply that libcollections today would invert its dependency with libstd. One of the primary blockers for doing this is the HashMap collection. Of its two major dependencies, hashing and randomness, this commit is the first step in dealing with hashing. When moving the hash module beneath libstd, it must break its primary dependence on the io::Writer trait (used as the hashing state). The proposed strategy for breaking this dependence is taking a similar path as core::fmt, which is to have the hash module define its own "writer trait". This trait would be similar to std::io::Writer, except that it would not return errors and it would have fewer convenience methods. The Hash trait today has its type parameter behind a feature gate (default type parameters), so this pending change will likely break no code which hasn't opted in to the feature gate. The SipState struct will lose its implementation of io::Writer, but it will regain similar methods for dealing with writing data. This change specifically prepares for the hash migration by modifying deriving(Hash) to use the std::hash::Writer bound instead of the std::io::Writer bound. This bound is currently wired to std::io::Writer, but after a snapshot it will have no need to be wired to the io writer trait.
2014-05-21auto merge of #14315 : kballard/rust/stdreader_isatty, r=alexcrichtonbors-0/+10
StdWriter has .isatty(). StdReader can trivially vend the same function, and someone asked today on IRC how to call isatty() on stdin.
2014-05-20auto merge of #14259 : alexcrichton/rust/core-mem, r=brsonbors-12/+16
Excluding the functions inherited from the cast module last week (with marked stability levels), these functions received the following treatment. * size_of - this method has become #[stable] * nonzero_size_of/nonzero_size_of_val - these methods have been removed * min_align_of - this method is now #[stable] * pref_align_of - this method has been renamed without the `pref_` prefix, and it is the "default alignment" now. This decision is in line with what clang does (see url linked in comment on function). This function is now #[stable]. * init - renamed to zeroed and marked #[stable] * uninit - marked #[stable] * move_val_init - renamed to overwrite and marked #[stable] * {from,to}_{be,le}{16,32,64} - all functions marked #[stable] * swap/replace/drop - marked #[stable] * size_of_val/min_align_of_val/align_of_val - these functions are marked #[unstable], but will continue to exist in some form. Concerns have been raised about their `_val` prefix.
2014-05-20core: Stabilize the mem moduleAlex Crichton-12/+16
Excluding the functions inherited from the cast module last week (with marked stability levels), these functions received the following treatment. * size_of - this method has become #[stable] * nonzero_size_of/nonzero_size_of_val - these methods have been removed * min_align_of - this method is now #[stable] * pref_align_of - this method has been renamed without the `pref_` prefix, and it is the "default alignment" now. This decision is in line with what clang does (see url linked in comment on function). This function is now #[stable]. * init - renamed to zeroed and marked #[stable] * uninit - marked #[stable] * move_val_init - renamed to overwrite and marked #[stable] * {from,to}_{be,le}{16,32,64} - all functions marked #[stable] * swap/replace/drop - marked #[stable] * size_of_val/min_align_of_val/align_of_val - these functions are marked #[unstable], but will continue to exist in some form. Concerns have been raised about their `_val` prefix. [breaking-change]
2014-05-20auto merge of #14293 : alexcrichton/rust/weak-lang-items, r=brsonbors-8/+72
This commit is part of the ongoing libstd facade efforts (cc #13851). The compiler now recognizes some language items as "extern { fn foo(...); }" and will automatically perform the following actions: 1. The foreign function has a pre-defined name. 2. The crate and downstream crates can only be built as rlibs until a crate defines the lang item itself. 3. The actual lang item has a pre-defined name. This is essentially nicer compiler support for the hokey core-depends-on-std-failure scheme today, but it is implemented the same way. The details are a little more hidden under the covers. In addition to failure, this commit promotes the eh_personality and rust_stack_exhausted functions to official lang items. The compiler can generate calls to these functions, causing linkage errors if they are left undefined. The checking for these items is not as precise as it could be. Crates compiling with `-Z no-landing-pads` will not need the eh_personality lang item, and crates compiling with no split stacks won't need the stack exhausted lang item. For ease, however, these items are checked for presence in all final outputs of the compiler. It is quite easy to define dummy versions of the functions necessary: #[lang = "stack_exhausted"] extern fn stack_exhausted() { /* ... */ } #[lang = "eh_personality"] extern fn eh_personality() { /* ... */ } cc #11922, rust_stack_exhausted is now a lang item cc #13851, libcollections is blocked on eh_personality becoming weak
2014-05-20Add .isatty() method to StdReaderKevin Ballard-0/+10
StdWriter has .isatty(). StdReader can trivially vend the same function, and someone asked today on IRC how to call isatty() on stdin.
2014-05-20auto merge of #14305 : tbu-/rust/pr_doc_bytes, r=huonwbors-1/+2
Only an example was needed, as the ability to write uints into the string is already mentioned. Fix #7102.
2014-05-20Add non-utf8 byte to the bytes!() exampleTobias Bucher-1/+2
Only an example was needed, as the ability to write uints into the string is already mentioned. Fix #7102.
2014-05-20Add slice::MutableCloneableVector to the preludeKevin Ballard-4/+4
Every other trait in slice is in the prelude, so it makes sense to provide MutableCloneableVector as well.
2014-05-20Address review commentsBrian Anderson-1/+1
2014-05-20std: Alphabetize crate reexports for rustdocBrian Anderson-4/+6
2014-05-20std: Fix broken linkBrian Anderson-2/+1
2014-05-19std: Remove UnsafeArcAlex Crichton-218/+23
This type has been superseded by Arc<Unsafe<T>>. The UnsafeArc type is a relic of an era that has long since past, and with the introduction of liballoc the standard library is able to use the Arc smart pointer. With little need left for UnsafeArc, it was removed. All existing code using UnsafeArc should either be reevaluated to whether it can use only Arc, or it should transition to Arc<Unsafe<T>> [breaking-change]
2014-05-19std: Move comm primitives away from UnsafeArcAlex Crichton-30/+39
They currently still use `&mut self`, this migration was aimed towards moving from UnsafeArc<T> to Arc<Unsafe<T>>
2014-05-19std: Build Exclusive on Arc<Unsafe<T>>Alex Crichton-3/+5
This removes the usage of UnsafeArc
2014-05-19std: Use Arc instead of UnsafeArc in BlockedTaskAlex Crichton-8/+9
2014-05-19std: Rebuild spsc with Unsafe/&selfAlex Crichton-25/+26
This removes the incorrect usage of `&mut self` in a concurrent setting.