summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-09-04stop treating char as an integer typeDaniel Micay-94/+83
Closes #7609
2013-09-04Revise path.rs API to not allocate ~str so much.Felix S. Klock II-25/+25
Note that I left dirname as returning ~str, because both of its implementations work by calling dir_path, which produces a new path, and thus we cannot borrow the result from &'a self passed to dirname (because the new path returned by dir_path will not live long enough to satisfy the lifetime 'a).
2013-09-04auto merge of #8960 : Kimundi/rust/master, r=alexcrichtonbors-1/+27
Changed ToStr impl for Ascii Added ToStr impl for char
2013-09-04Added explicit pub to several conditions. Enables completion of #6009.Felix S. Klock II-9/+7
2013-09-03Raise errors on format strings with unmatched `}`Alex Crichton-0/+11
Otherwise extra stuff after a lone '}' character is simply ignored, which is very bad. Closes #8938
2013-09-03auto merge of #8943 : alexcrichton/rust/issue-8904, r=brsonbors-2/+8
We already do this for libstd tests automatically, and compiletest runs into the same problems where when forking lots of processes lots of file descriptors are created. On OSX we can use specific syscalls to raise the limits, in this situation, though. Closes #8904
2013-09-03auto merge of #8942 : novalis/rust/fmt, r=alexcrichtonbors-0/+7
2013-09-03Test and document escaping on format!()novalis-0/+7
2013-09-03auto merge of #8963 : jmgrosen/rust/issue-8881, r=alexcrichtonbors-0/+6
2013-09-04Added ToStr impl for charMarvin Löbel-1/+27
Changed ToStr impl for Ascii
2013-09-03Fixes #8881. condition! imports parent's pub identifiersjmgrosen-0/+6
2013-09-03auto merge of #8954 : anasazi/rust/tcp-acceptor, r=catamorphismbors-160/+234
The Listener trait takes two type parameters, the type of connection and the type of Acceptor, and specifies only one method, listen, which consumes the listener and produces an Acceptor. The Acceptor trait takes one type parameter, the type of connection, and defines two methods. The accept() method waits for an incoming connection attempt and returns the result. The incoming() method creates an iterator over incoming connections and is a default method. Example: ```rust let listener = TcpListener.bind(addr); // Bind to a socket let acceptor = listener.listen(); // Start the listener for stream in acceptor.incoming() { // Process incoming connections forever (a failure will kill the task). } ``` Closes #8689
2013-09-03rt::io: Rename Bytes to ByteIterator and add note about iterationblake2-ppc-8/+14
2013-09-03auto merge of #8934 : sfackler/rust/bufreader, r=brsonbors-3/+39
2013-09-03auto merge of #8947 : thestinger/rust/name, r=huonwbors-5/+20
Storing the type name in the `tydesc` aims to avoid the need to pass a type name in almost every single visitor method. It would likely be much saner for `repr` to simply be passed the `TyDesc` corresponding to the function or just the type name, but this is good enough for now.
2013-09-03auto merge of #8884 : blake2-ppc/rust/exact-size-hint, r=huonwbors-62/+150
The message of the first commit explains (edited for changed trait name): The trait `ExactSize` is introduced to solve a few small niggles: * We can't reverse (`.invert()`) an enumeration iterator * for a vector, we have `v.iter().position(f)` but `v.rposition(f)`. * We can't reverse `Zip` even if both iterators are from vectors `ExactSize` is an empty trait that is intended to indicate that an iterator, for example `VecIterator`, knows its exact finite size and reports it correctly using `.size_hint()`. Only adaptors that preserve this at all times, can expose this trait further. (Where here we say finite for fitting in uint). --- It may seem complicated just to solve these small "niggles", (It's really the reversible enumerate case that's the most interesting) but only a few core iterators need to implement this trait. While we gain more capabilities generically for some iterators, it becomes a tad more complicated to figure out if a type has the right trait impls for it.
2013-09-03repr: add very basic support for functionsDaniel Micay-5/+17
Closes #8917
2013-09-03add type name to the tydescDaniel Micay-0/+3
Closes #8926
2013-09-02Raise the file descriptor limits when running compiletestAlex Crichton-2/+8
We already do this for libstd tests automatically, and compiletest runs into the same problems where when forking lots of processes lots of file descriptors are created. On OSX we can use specific syscalls to raise the limits, in this situation, though. Closes #8904
2013-09-02Fix the std::fmt doc-block to show up in pandocAlex Crichton-1/+1
2013-09-02Implement BufReaderSteven Fackler-3/+39
2013-09-02auto merge of #8927 : thestinger/rust/repr, r=huonwbors-23/+52
2013-09-02repr: handle tuple structs sanelyDaniel Micay-18/+33
Closes #8919
2013-09-02repr: add support for trait objectsDaniel Micay-4/+9
Closes #8916
2013-09-02repr: print functions as `fn()`Daniel Micay-1/+10
2013-09-01Fix #8898novalis-2/+3
2013-09-02rt::io: Add Bytes iterator for Readerblake2-ppc-1/+83
An iterator that simply calls `.read_bytes()` each iteration. I think choosing to own the Reader value and implementing Decorator to allow extracting it is the most generically useful. The Reader type variable can of course be some kind of reference type that implements Reader.
2013-09-01std/extra: Add ExactSize for Bitv, DList, RingBuf, Option iteratorsblake2-ppc-1/+3
2013-09-01std::iterator: Use ExactSize, inheriting DoubleEndedIteratorblake2-ppc-52/+43
Address discussion with acrichto; inherit DoubleEndedIterator so that `.rposition()` can be a default method, and that the nische of the trait is clear. Use assertions when using `.size_hint()` in reverse enumerate and `.rposition()`
2013-09-01std::iterator: Add back .rposition() testblake2-ppc-10/+25
2013-09-01auto merge of #8276 : kballard/rust/iterator-protocol, r=cmrbors-6/+122
r? @thestinger
2013-08-31auto merge of #8899 : thestinger/rust/repr, r=huonwbors-21/+31
2013-08-31repr: remove trailing {} from unit-like structsDaniel Micay-7/+11
2013-08-31repr: print the name of structsDaniel Micay-19/+25
2013-08-30auto merge of #8896 : lightcatcher/rust/default_eq_fix, r=thestingerbors-18/+2
Summary: -removed "ne" methods in libstd and librustpkg -made default "ne" be inlined -made one of the "eq" methods in librustpkg follow more standard parameter naming convention
2013-08-30Now inline default 'ne' methodsEric Martin-0/+2
2013-08-30remove several 'ne' methodsEric Martin-18/+0
2013-08-30auto merge of #8889 : erickt/rust/cleanup, r=catamorphismbors-1/+3
This fixes a couple minor things I've been sitting on. It cleans up some warnings, CapCases some types in librustc's rscope module, and adds a fixme.
2013-08-30std: Add a file-renaming function to std::osTim Chevalier-0/+12
2013-08-30std: Add a fixme for when we add Trait::<for T>::static_method()Erick Tryzelaar-0/+2
2013-08-30fix various warningsErick Tryzelaar-1/+1
2013-08-30std::select: Use correct indices from the frontblake2-ppc-2/+2
Caught a bug where .enumerate() was used on a reverse iterator. The indices should be counted from the front here (bblum confirms).
2013-08-30std::str: Use reverse enumerate and .rpositionblake2-ppc-15/+6
Simplify code by using the reversibility of enumerate and use .rposition().
2013-08-30std: Implement .rposition() on double-ended iterators with known sizeblake2-ppc-36/+37
This is a generalization of the vector .rposition() method, to all double-ended iterators that have the ExactSizeHint trait. This resolves the slight asymmetry around `position` and `rposition` * position from front is `vec.iter().position()` * position from the back was, `vec.rposition()` is now `vec.iter().rposition()` Additionally, other indexed sequences (only `extra::ringbuf` I think), will have the same method available once it implements ExactSizeHint.
2013-08-30std::iterator: Add tests for .next_back() on Zip and Enumerateblake2-ppc-0/+27
2013-08-30std::iterator: Implement .next_back() for Zipblake2-ppc-0/+23
Let Zip be double-ended when both its children have the ExactSizeHint trait.
2013-08-30std::iterator: Introduce trait ExactSizeHintblake2-ppc-0/+38
The trait `ExactSizeHint` is introduced to solve a few small niggles: * We can't reverse (`.invert()`) an enumeration iterator * for a vector, we have `v.iter().position(f)` but `v.rposition(f)`. * We can't reverse `Zip` even if both iterators are from vectors `ExactSizeHint` is an empty trait that is intended to indicate that an iterator, for example `VecIterator`, knows its exact finite size and reports it correctly using `.size_hint()`. Only adaptors that preserve this at all times, can expose this trait further. (Where here we say finite for fitting in uint).
2013-08-30auto merge of #8858 : blake2-ppc/rust/small-bugs, r=alexcrichtonbors-16/+21
Fix a bug in `s.slice_chars(a, b)` that did not accept `a == s.len()`. Fix a bug in `!=` defined for DList. Also simplify NormalizationIterator to use the CharIterator directly instead of mimicing the iteration itself.
2013-08-30auto merge of #8877 : bouk/rust/master, r=sanxiynbors-1/+1
Ran into a missing space in the stdlib source
2013-08-30auto merge of #8867 : thestinger/rust/smaller-arc, r=alexcrichtonbors-1/+9