summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-10-31DSTify ToCStrJorge Aparicio-24/+0
2014-10-31DSTify HashJorge Aparicio-14/+17
- The signature of the `*_equiv` methods of `HashMap` and similar structures have changed, and now require one less level of indirection. Change your code from: ``` hashmap.find_equiv(&"Hello"); hashmap.find_equiv(&&[0u8, 1, 2]); ``` to: ``` hashmap.find_equiv("Hello"); hashmap.find_equiv(&[0u8, 1, 2]); ``` - The generic parameter `T` of the `Hasher::hash<T>` method have become `Sized?`. Downstream code must add `Sized?` to that method in their implementations. For example: ``` impl Hasher<FnvState> for FnvHasher { fn hash<T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ } } ``` must be changed to: ``` impl Hasher<FnvState> for FnvHasher { fn hash<Sized? T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ } // ^^^^^^ } ``` [breaking-change]
2014-10-30Test fixes and rebase conflictsAlex Crichton-1/+2
2014-10-30rollup merge of #18445 : alexcrichton/index-mutAlex Crichton-25/+21
Conflicts: src/libcollections/vec.rs
2014-10-30rollup merge of #18398 : aturon/lint-conventions-2Alex Crichton-40/+40
Conflicts: src/libcollections/slice.rs src/libcore/failure.rs src/libsyntax/parse/token.rs src/test/debuginfo/basic-types-mut-globals.rs src/test/debuginfo/simple-struct.rs src/test/debuginfo/trait-pointers.rs
2014-10-30rollup merge of #18443 : alexcrichton/deref-vec-and-stringAlex Crichton-1/+2
2014-10-30Add a `repeat` function to the preludeJakub Bukaj-1/+1
Implements a part of RFC 235. [breaking-change]
2014-10-30rollup merge of #18397 : aochagavia/asciiAlex Crichton-2/+1
2014-10-30rollup merge of #18393 : aochagavia/preludeAlex Crichton-1/+1
2014-10-30collections: Enable IndexMut for some collectionsAlex Crichton-25/+21
This commit enables implementations of IndexMut for a number of collections, including Vec, RingBuf, SmallIntMap, TrieMap, TreeMap, and HashMap. At the same time this deprecates the `get_mut` methods on vectors in favor of using the indexing notation. cc #18424
2014-10-30auto merge of #18374 : steveklabnik/rust/gh18197, r=sfacklerbors-4/+3
Fixes #18197
2014-10-30Change extensions traits to blanket implsNick Cameron-17/+18
2014-10-30changes to testsNick Cameron-2/+5
2014-10-30changes to libsNick Cameron-14/+32
2014-10-29collections: impl Deref for Vec/StringAlex Crichton-1/+2
This commit adds the following impls: impl<T> Deref<[T]> for Vec<T> impl<T> DerefMut<[T]> for Vec<T> impl Deref<str> for String This commit also removes all duplicated inherent methods from vectors and strings as implementations will now silently call through to the slice implementation. Some breakage occurred at std and beneath due to inherent methods removed in favor of those in the slice traits and std doesn't use its own prelude, cc #18424
2014-10-30auto merge of #18359 : 1-more/rust/feature, r=alexcrichtonbors-13/+18
2014-10-29Rename fail! to panic!Steve Klabnik-239/+239
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-10-28Fix example for BufferedReaderSteve Klabnik-4/+3
Fixes #18197
2014-10-28Update code with new lint namesAaron Turon-40/+40
2014-10-28Remove unnecessary clone in ascii.rsAdolfo Ochagavía-2/+1
2014-10-28Add ptr::RawMutPtr to preludeAdolfo Ochagavía-1/+1
Closes https://github.com/rust-lang/rust/issues/18196
2014-10-28Fix the output of negative durationVladimir Smola-13/+18
Technically speaking, negative duration is not valid ISO 8601, but we need to print it anyway. If `d` is a positive duration with the output `xxxxxxx`, then the expected output of negative `-d` value is `-xxxxxxx`. I.e. the idea is to print negative durations as positive with a leading minus sign. Closes #18181.
2014-10-27DSTify [T]/str extension traitsJorge Aparicio-10/+11
This PR changes the signature of several methods from `foo(self, ...)` to `foo(&self, ...)`/`foo(&mut self, ...)`, but there is no breakage of the usage of these methods due to the autoref nature of `method.call()`s. This PR also removes the lifetime parameter from some traits (`Trait<'a>` -> `Trait`). These changes break any use of the extension traits for generic programming, but those traits are not meant to be used for generic programming in the first place. In the whole rust distribution there was only one misuse of a extension trait as a bound, which got corrected (the bound was unnecessary and got removed) as part of this PR. [breaking-change]
2014-10-27Test fixes and rebase conflicts from rollupAlex Crichton-6/+6
2014-10-27rollup merge of #18366 : aochagavia/asciiAlex Crichton-4/+19
2014-10-27rollup merge of #18332 : jbcrail/fix-commentsAlex Crichton-1/+1
2014-10-27rollup merge of #18329 : sfackler/memwriter-clearAlex Crichton-2/+7
2014-10-27Fix undefined behavior in std::asciiAdolfo Ochagavía-4/+19
Closes https://github.com/rust-lang/rust/issues/18314
2014-10-27auto merge of #18130 : mahkoh/rust/udp, r=alexcrichtonbors-13/+32
Closes #18111 Note that the non-empty part doesn't matter right now because of #18129.
2014-10-25Fix spelling mistakes in comments.Joseph Crail-1/+1
2014-10-25Add MemWriter::from_vecSteven Fackler-2/+7
2014-10-25get rid of libc_heap::{malloc_raw, realloc_raw}Daniel Micay-3/+3
The C standard library functions should be used directly. The quirky NULL / zero-size allocation workaround is no longer necessary and was adding an extra branch to the allocator code path in a build without jemalloc. This is a small step towards liballoc being compatible with handling OOM errors instead of aborting (#18292). [breaking-change]
2014-10-25Deprecate UdpStreamJulian Orth-0/+12
2014-10-25Make UdpStream block until the next non-empty msg.Julian Orth-13/+20
2014-10-20auto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturonbors-601/+29
This is a large spring-cleaning commit now that the 0.12.0 release has passed removing an amount of deprecated functionality. This removes a number of deprecated crates (all still available as cargo packages in the rust-lang organization) as well as a slew of deprecated functions. All `#[crate_id]` support has also been removed. I tried to avoid anything that was recently deprecated, but I may have missed something! The major pain points of this commit is the fact that rustc/syntax have `#[allow(deprecated)]`, but I've removed that annotation so moving forward they should be cleaned up as we go.
2014-10-20auto merge of #18174 : huonw/rust/fix-sqrt, r=alexcrichtonbors-0/+22
Closes #9987.
2014-10-20Handle negative numbers in `sqrt` properly.Huon Wilson-0/+22
Closes #9987.
2014-10-20auto merge of #18108 : mahkoh/rust/buffered_reader, r=alexcrichtonbors-2/+11
This optimizes `read` for the case in which the number of bytes requested is larger than the internal buffer. Note that the first comparison occurs again right afterwards and should thus be free. The second comparison occurs only in the cold branch.
2014-10-20Optimize BufferedReader::read for large buffers.Julian Orth-2/+11
This optimizes `read` for the case in which the number of bytes requested is larger than the internal buffer. Note that the first comparison occurs again right afterwards and should thus be free. The second comparison occurs only in the cold branch.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-601/+29
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-18auto merge of #18103 : pcwalton/rust/bitflags-inline, r=thestingerbors-0/+11
Servo really wants this. r? @nick29581
2014-10-17auto merge of #18093 : steveklabnik/rust/remove_gc_reference, r=alexcrichtonbors-7/+5
2014-10-17auto merge of #17998 : rapha/rust/master, r=alexcrichtonbors-15/+60
2014-10-16libstd: Inline more methods on bitflags.Patrick Walton-0/+11
Servo really wants this.
2014-10-16auto merge of #17947 : lukemetz/rust/master, r=aturonbors-14/+34
AsciiStr::to_lower is now AsciiStr::to_lowercase and AsciiStr::to_upper is AsciiStr::to_uppercase to match Ascii trait. Part of issue #17790. This is my first pull request so let me know if anything is incorrect. Thanks! [breaking-changes]
2014-10-16don't refer to the nonexistant gcSteve Klabnik-7/+5
2014-10-16libstd: Remove all uses of {:?}.Luqman Aden-26/+26
2014-10-16Remove libdebug and update tests.Luqman Aden-10/+2
2014-10-16impl Buffer for ChanReaderRaphael Speyer-15/+60
2014-10-15Renamed AsciiStr::to_lower and AsciiStr::to_upper=-22/+42
Now AsciiStr::to_lowercase and AsciiStr::to_uppercase to match Ascii trait. [breaking-change]