summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-03-18auto merge of #12954 : brson/rust/atomicdocs, r=alexcrichtonbors-68/+393
This adds lots of docs to the atomics module. Two of the examples are using the future atomics API (relying on `Share`) and are ignored temporarily. I discovered a bug in the way AtomicBool's fetch_nand method is implemented and fixed it by using the correct value for `true`. I also fixed the implementation of AcqRel fences (it was only doing a release barrier), and made a "relaxed" fence a failure.
2014-03-18std: Improve option docsBrian Anderson-20/+170
2014-03-18Test fixes from the rollupAlex Crichton-0/+4
2014-03-18Made the `clone_from` implementation for `~T` reuse the `T` itself ifMarvin Löbel-1/+2
possible by also calling `clone_from` on it. In general, `Clone` implementors that overwrite `clone_from` should try to to use it recursivly for substructures.
2014-03-18rustdoc: Implement cross-crate searchingAlex Crichton-1/+1
A major discoverability issue with rustdoc is that all crates have their documentation built in isolation, so it's difficult when looking at the documentation for libstd to learn that there's a libcollections crate with a HashMap in it. This commit moves rustdoc a little closer to improving the multiple crate experience. This unifies all search indexes for all crates into one file so all pages share the same search index. This allows searching to work across crates in the same documentation directory (as the standard distribution is currently built). This strategy involves updating a shared file amongst many rustdoc processes, so I implemented a simple file locking API for handling synchronization for updates to the shared files. cc #12554
2014-03-18Docsprint: Document ops module, primarily Deref.Matthew McPherrin-3/+77
2014-03-18Relaxed the memory ordering on the implementation of UnsafeArcJonathan S-7/+29
2014-03-18Documentation and formatting changes for option.rs.Ziad Hatahet-10/+10
2014-03-18Add impl IntoStr for ::std::vec_ng::Vec<Ascii>Eunchong Yu-0/+26
2014-03-18remove duplicate methods in implsCorey Richardson-3/+0
2014-03-18Make method Vec::remove() publicJorge Aparicio-1/+1
2014-03-17std: Improve docs for atomics. Fix two bugsBrian Anderson-68/+393
This adds lots of docs to the atomics module. Two of the examples are using the future atomics API and are ignored temporarily. I discovered a bug in the way AtomicBool's fetch_nand method is implemented and fixed it by using the correct value for `true`. I also fixed the implementation of AcqRel fences (it was only doing a release barrier), and made a "relaxed" fence a failure.
2014-03-17auto merge of #12957 : lkuper/rust/docsprint, r=alexcrichtonbors-2/+1
2014-03-17auto merge of #12951 : cadencemarseille/rust/issue-12943-remove-AtomicFlag, ↵bors-41/+6
r=alexcrichton fixes #12943
2014-03-17auto merge of #12945 : cadencemarseille/rust/vec_ng-as_mut_ptr, r=alexcrichtonbors-4/+7
2014-03-16auto merge of #12944 : mcpherrinm/rust/master, r=alexcrichtonbors-0/+95
2014-03-16`strdup_uniq` doesn't have to be `pub`.Lindsey Kuper-2/+1
2014-03-16Doc-sprint: Document endian conversion functionsMatthew McPherrin-0/+95
2014-03-16Remove AtomicFlagCadence Marseille-41/+6
fixes #12943
2014-03-16Add method Vec<T>::as_mut_ptr()Cadence Marseille-4/+7
2014-03-16auto merge of #12931 : aochagavia/rust/option-take_unwrap, r=cmrbors-3/+3
Using pattern matching instead of is_some + unwrap
2014-03-16Refactored take_unwrap (libstd/option.rs)aochagavia-3/+3
Using pattern matching instead of is_some + unwrap
2014-03-16auto merge of #12929 : sfackler/rust/automatically-derived, r=cmrbors-20/+0
This will enable rustdoc to treat them specially. I also got rid of `std::cmp::cmp2`, which is isomorphic to the `TotalOrd` impl for 2-tuples and never used.
2014-03-15Test fixes and rebase conflictsAlex Crichton-10/+25
This commit switches over the backtrace infrastructure from piggy-backing off the RUST_LOG environment variable to using the RUST_BACKTRACE environment variable (logging is now disabled in libstd).
2014-03-15rustc: Remove compiler support for __log_level()Alex Crichton-84/+15
This commit removes all internal support for the previously used __log_level() expression. The logging subsystem was previously modified to not rely on this magical expression. This also removes the only other function to use the module_data map in trans, decl_gc_metadata. It appears that this is an ancient function from a GC only used long ago. This does not remove the crate map entirely, as libgreen still uses it to hook in to the event loop provided by libgreen.
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-638/+23
This commit moves all logging out of the standard library into an external crate. This crate is the new crate which is responsible for all logging macros and logging implementation. A few reasons for this change are: * The crate map has always been a bit of a code smell among rust programs. It has difficulty being loaded on almost all platforms, and it's used almost exclusively for logging and only logging. Removing the crate map is one of the end goals of this movement. * The compiler has a fair bit of special support for logging. It has the __log_level() expression as well as generating a global word per module specifying the log level. This is unfairly favoring the built-in logging system, and is much better done purely in libraries instead of the compiler itself. * Initialization of logging is much easier to do if there is no reliance on a magical crate map being available to set module log levels. * If the logging library can be written outside of the standard library, there's no reason that it shouldn't be. It's likely that we're not going to build the highest quality logging library of all time, so third-party libraries should be able to provide just as high-quality logging systems as the default one provided in the rust distribution. With a migration such as this, the change does not come for free. There are some subtle changes in the behavior of liblog vs the previous logging macros: * The core change of this migration is that there is no longer a physical log-level per module. This concept is still emulated (it is quite useful), but there is now only a global log level, not a local one. This global log level is a reflection of the maximum of all log levels specified. The previously generated logging code looked like: if specified_level <= __module_log_level() { println!(...) } The newly generated code looks like: if specified_level <= ::log::LOG_LEVEL { if ::log::module_enabled(module_path!()) { println!(...) } } Notably, the first layer of checking is still intended to be "super fast" in that it's just a load of a global word and a compare. The second layer of checking is executed to determine if the current module does indeed have logging turned on. This means that if any module has a debug log level turned on, all modules with debug log levels get a little bit slower (they all do more expensive dynamic checks to determine if they're turned on or not). Semantically, this migration brings no change in this respect, but runtime-wise, this will have a perf impact on some code. * A `RUST_LOG=::help` directive will no longer print out a list of all modules that can be logged. This is because the crate map will no longer specify the log levels of all modules, so the list of modules is not known. Additionally, warnings can no longer be provided if a malformed logging directive was supplied. The new "hello world" for logging looks like: #[phase(syntax, link)] extern crate log; fn main() { debug!("Hello, world!"); }
2014-03-15Remove std::cmp::cmp2.Steven Fackler-20/+0
It isn't used anywhere and `cmp2(a, b, c, d)` is identical to `(a, b).cmp(&(c, d))`.
2014-03-15libstd: Fix a typo. s/target_os/target_arch/Luqman Aden-4/+4
2014-03-14auto merge of #12896 : alexcrichton/rust/goodbye-extra, r=brsonbors-22/+321
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-14auto merge of #12893 : alexcrichton/rust/cfg-not, r=luqmanabors-2/+13
The two commits have the details of the two fixes
2014-03-14auto merge of #12888 : aochagavia/rust/Fix-comment, r=alexcrichtonbors-9/+3
The old comment of as_mut_slice() did not describe the function correctly. The new one does. Also refactored option::iter() and option::mut_iter() to use as_ref() and as_mut() instead of match.
2014-03-14auto merge of #12878 : crabtw/rust/mips, r=alexcrichtonbors-13/+23
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure. By the way, the patched LLVM doesn't have MIPS split stack anymore. Should I file an issue about that?
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-22/+321
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-14auto merge of #12869 : thestinger/rust/cmp, r=brsonbors-6/+6
The `Float` trait provides correct `min` and `max` methods on floating point types, providing a consistent result regardless of the order the parameters are passed. These generic functions do not take the necessary performance hit to correctly support a partial order, so the true requirement should be given as a type bound. Closes #12712
2014-03-14cmp: switch `min` and `max` to `TotalOrd`Daniel Micay-6/+6
The `Float` trait provides correct `min` and `max` methods on floating point types, providing a consistent result regardless of the order the parameters are passed. These generic functions do not take the necessary performance hit to correctly support a partial order, so the true requirement should be given as a type bound. Closes #12712
2014-03-14std: Fix backtraces on arm linuxAlex Crichton-2/+13
On android, libgcc is missing the _Unwind_GetIP symbol because it's defined as a macro. This is the same case for arm linux, so this commit adds the necessary cfgs in place to use the "expanded macro" in rust for arm linux.
2014-03-14Refactored iter and mut_iteraochagavia-8/+2
Replaced match by self.as_ref() and self.as_mut()
2014-03-14Fixed comment of as_mut_slice (libstd/option.rs)aochagavia-1/+1
The old comment did not describe the function correctly
2014-03-14auto merge of #12875 : alexcrichton/rust/demangle-more-things, r=brsonbors-7/+54
Add some more infrastructure support for demangling `$`-sequences, as well as fixing demangling of closure symbol names if there's more than one closure in a function.
2014-03-14auto merge of #12871 : aochagavia/rust/Optimize-while_some, r=alexcrichtonbors-3/+6
The old 'while' needed to match 2 times for each iteration. With the new 'loop' there is just one match needed. I have also replaced 'blk' by 'f' to be more consistent with parameter names in other functions that are implemented for Option<T>
2014-03-13auto merge of #12861 : huonw/rust/lint-owned-vecs, r=thestingerbors-2/+5
lint: add lint for use of a `~[T]`. This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-13auto merge of #12855 : alexcrichton/rust/shutdown, r=brsonbors-0/+37
This is something that is plausibly useful, and is provided by libuv. This is not currently surfaced as part of the `TcpStream` type, but it may possibly appear in the future. For now only the raw functionality is provided through the Rtio objects.
2014-03-14fix MIPS targetJyun-Yan You-13/+23
I ignored AtomicU64 methods on MIPS target because libgcc doesn't implement MIPS32 64-bit atomic operations. Otherwise it would cause link failure.
2014-03-14std: render the vec_ng docs.Huon Wilson-2/+4
These are wildly incomplete, but having something there is better than nothing, e.g. so that people know it exists, and many of the functions behaviour can be guessed from the name or by checking the source: it's knowing they exist at all that's the hard part.
2014-03-14lint: add lint for use of a `~[T]`.Huon Wilson-0/+1
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-13std: Demangle more escapes in backtracesAlex Crichton-7/+54
The rust compiler not only outputs symbols in the form that C++ does, but it also mangle symbols like '&' and '~' to special compiler-defined escape sequences. For convenience, these symbols are demangled when printing backtraces.
2014-03-13io: Bind to shutdown() for TCP streamsAlex Crichton-0/+37
This is something that is plausibly useful, and is provided by libuv. This is not currently surfaced as part of the `TcpStream` type, but it may possibly appear in the future. For now only the raw functionality is provided through the Rtio objects.
2014-03-13auto merge of #12815 : alexcrichton/rust/chan-rename, r=brsonbors-909/+865
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765
2014-03-13Refactored while_some (libstd/option.rs)aochagavia-3/+6
The old 'while' needed to match 2 times for each iteration. With the new 'loop' there is just one match needed. I have also replaced 'blk' by 'f' to be more consistent with parameter names in other functions that are implemented for Option
2014-03-13std: Rename Chan/Port types and constructorAlex Crichton-909/+865
* Chan<T> => Sender<T> * Port<T> => Receiver<T> * Chan::new() => channel() * constructor returns (Sender, Receiver) instead of (Receiver, Sender) * local variables named `port` renamed to `rx` * local variables named `chan` renamed to `tx` Closes #11765