about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-09-26auto merge of #9261 : alexcrichton/rust/logging, r=huonwbors-58/+72
This lifts various restrictions on the runtime, for example the character limit when logging a message. Right now the old debug!-style macros still involve allocating (because they use fmt! syntax), but the new debug2! macros don't involve allocating at all (unless the formatter for a type requires allocation.
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-24/+24
2013-09-26Document std::ops.Steve Klabnik-2/+410
Added an overview with a 'real' example, as well as toy implementations of all of the traits. Closes #9356.
2013-09-26auto merge of #9507 : brson/rust/sched, r=alexcrichtonbors-32/+141
This also includes a fix for yielding from single-threaded schedulers where the scheduler would stop working before its work queue was empty. Fixes the deadlocks that this patch had previously.
2013-09-26auto merge of #9506 : sfackler/rust/visibility, r=alexcrichtonbors-2/+2
2013-09-26auto merge of #9497 : pnkfelix/rust/fsk-7752-use-fcnptr-for-glob-errfunc, r=cmrbors-2/+2
Fix #7752. ~~(The glob API is a little funky; I tried to make a small test for it, which I'll add to the end of this description, and its not clear whether globfree is supposed to free solely the structure allocated by glob itself, or if it is going to try to free more than that.)~~ (The previous note was a user-error: I was misusing the CString API.) Anyway, this seems to work in terms of calling errfunc where expected.) ```rust #[allow(unused_imports)]; use std::libc::types::os::arch::c95::{c_char, c_int, size_t}; use std::libc::funcs::posix01::glob; use std::libc::types::os::common::posix01::glob_t; use std::libc::consts::os::posix01::{GLOB_APPEND, GLOB_DOOFFS, GLOB_ERR, GLOB_MARK, GLOB_NOCHECK, GLOB_NOSORT, GLOB_NOESCAPE, GLOB_NOSPACE, GLOB_ABORTED, GLOB_NOMATCH}; use std::ptr; use std::c_str; #[fixed_stack_segment] fn main() { let mut g = glob_t { gl_pathc: 0, // size_t, __unused1: 0, // c_int, gl_offs: 2, // size_t, __unused2: 0, // c_int, gl_pathv: ptr::null(), // **c_char, __unused3: ptr::null(), // *c_void, __unused4: ptr::null(), // *c_void, __unused5: ptr::null(), // *c_void, __unused6: ptr::null(), // *c_void, __unused7: ptr::null(), // *c_void, __unused8: ptr::null(), // *c_void, }; extern "C" fn errfunc(_epath: *c_char, _errno: int) -> int { println!("errfunc called"); return 0; } struct Reduced { pathc: size_t, offs: size_t, pathv: **c_char, } impl Reduced { fn from(g: &glob_t) -> Reduced { Reduced {pathc: g.gl_pathc, offs: g.gl_offs, pathv: g.gl_pathv} } } do ("*.rs/*").with_c_str |pat| { println!("calling glob"); unsafe { glob::glob(pat, GLOB_DOOFFS, errfunc, &mut g); } println!("After glob call"); println!("g: {:?}", Reduced::from(&g)); for i in range(0, g.gl_pathc as int) { unsafe { let p : **c_char = ptr::offset(g.gl_pathv, g.gl_offs as int + i); let x = c_str::CString::new(*p, false); match x.as_str() { Some(s) => { println!("gl_pathc[{:d}]: {:?}", i, s); } None => { println!("gl_pathc[{:d}]: unvalid", i); } } } } } println!("calling globfree on g: {:?}", g); unsafe { glob::globfree(&mut g); } println!("after globfree call"); } ```
2013-09-26auto merge of #9490 : alexcrichton/rust/issue-9487, r=cmrbors-6/+10
If there's no TLS key just yet, then there's nothing to unsafely borrow, so continue returning None. This prevents causing the runtime to abort itself when logging before the runtime is fully initialized. Closes #9487 r? @brson
2013-09-25auto merge of #9404 : blake2-ppc/rust/result-map-opt, r=cmrbors-13/+0
std::result: Remove function `map_opt`. This function has never had any users in the tree, so this is my initiative to remove this function.
2013-09-25std::rt: Implement task yielding. Fix a starvation problemBrian Anderson-32/+141
2013-09-26Moved StrSlice doc comments from impl to trait.Marvin Löbel-336/+410
Moved OwnedStr doc comments from impl to trait. Added a few #[inline] hints. The doc comment changes make the source a bit harder to read, as documentation and implementation no longer live right next to each other. But this way they at least appear in the docs.
2013-09-25Some struct visibility fixesSteven Fackler-2/+2
2013-09-25Refactor the logging system for fewer allocationsAlex Crichton-58/+72
This lifts various restrictions on the runtime, for example the character limit when logging a message. Right now the old debug!-style macros still involve allocating (because they use fmt! syntax), but the new debug2! macros don't involve allocating at all (unless the formatter for a type requires allocation.
2013-09-25errfunc ptr is nullable, so use Option as part of interface to glob (#7752).Felix S. Klock II-1/+2
2013-09-25rustdoc: Strip hidden docs by default.Alex Crichton-2/+1
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-299/+299
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-25auto merge of #9498 : catamorphism/rust/rust-path-hack-fix, r=cmr,metajackbors-0/+54
r? @metajack
2013-09-25Don't die in try_unsafe_borrow if tls isn't readyAlex Crichton-6/+10
If there's no TLS key just yet, then there's nothing to unsafely borrow, so continue returning None. This prevents causing the runtime to abort itself when logging before the runtime is fully initialized. Closes #9487
2013-09-25auto merge of #9493 : huonw/rust/move-tuples, r=thestingerbors-102/+104
The old behaviour of `foo.n0()` is replaced by `foo.n0_ref().clone()`.
2013-09-25rustpkg: Search for packages correctly when using the rust_path_hackTim Chevalier-22/+31
Previously, any package would match any other package ID when searching using the rust_path_hack, so long as the directory had one or more crate files in it. Now, rustpkg checks that the parent directory matches the package ID. Closes #9273
2013-09-25std: Add an is_parent_of method to PathTim Chevalier-0/+45
2013-09-25#7752: use fcnptr for glob errfunc.Felix S. Klock II-2/+1
2013-09-25auto merge of #9455 : jesseray/rust/master, r=pnkfelixbors-0/+24
In "/src/libstd/char.rs", there are function and method definitions for `is_lowercase()`, `is_uppercase()`, `is_whitespace()`, etc. However, there was no function or method for control characters, so I added the `is_control()` function and method definitions along with documentation and tests. Running `./configure && make check` shows that all tests for `is_control()` pass.
2013-09-25std: Replace CloneableTuple with Tuple, which takes self by-val.Huon Wilson-102/+104
The old behaviour of `foo.n0()` is replaced by `foo.n0_ref().clone()`.
2013-09-24auto merge of #9470 : luqmana/rust/bba, r=brsonbors-17/+14
#8431 ~~@brson: do we need to bump up the cratemap version for this change?~~ Tis a no.
2013-09-24Remove the annihilate function from the crate map. Fixes #8431Luqman Aden-17/+14
2013-09-24auto merge of #9336 : alexcrichton/rust/issue-7981, r=catamorphismbors-2/+2
Progress on #7981 This doesn't completely close the issue because `struct A;` is still allowed, and it's a much larger change to disallow that. I'm also not entirely sure that we want to disallow that. Regardless, punting that discussion to the issue instead.
2013-09-24Stop accepting 'impl ...;', require {} insteadAlex Crichton-2/+2
Progress on #7981
2013-09-24Do not imply that str is sometimes null-terminated.Simon Sapin-2/+2
2013-09-24auto merge of #9457 : klutzy/rust/doc-fix, r=alexcrichtonbors-2/+2
2013-09-23auto merge of #9449 : dckc/rust/patch-1, r=alexcrichtonbors-1/+1
2013-09-24std::local_data: Fix document codeklutzy-2/+2
2013-09-23auto merge of #9454 : alexcrichton/rust/snapshot, r=thestingerbors-65/+4
2013-09-23Register new snapshotsAlex Crichton-65/+4
2013-09-23remove apostrophe where it's is not used as a contractionDan Connolly-1/+1
2013-09-23test: Fix rustdoc and tests.Patrick Walton-11/+0
2013-09-23librustc: Remove `@fn` managed closures from the language.Patrick Walton-12/+29
2013-09-23libsyntax: Introduce routines and remove all `@fn`s from libsyntax save the ↵Patrick Walton-9/+43
old visitor
2013-09-23auto merge of #9301 : luqmana/rust/ncm, r=brsonbors-4/+103
Get rid of the crate_map arg! r? @brson
2013-09-23Find the cratemap at runtime on windows.Luqman Aden-4/+23
2013-09-23Added is_control function, method, and tests.Jesse Ray-0/+24
2013-09-22disable starvation test completely for nowDaniel Micay-13/+10
this is still broken on the bsd builder, perhaps because it has 1 core
2013-09-22disable scheduler starvation test on valgrindDaniel Micay-9/+13
2013-09-23Remove the C(++) ISAAC Rng from the old rt.Huon Wilson-43/+2
This has to leave rust_gen_seed and rng_gen_seed around since they're used to initialise the std::rand RNGs.
2013-09-23std: merge rand::{Rng,RngUtil} with default methods.Huon Wilson-357/+280
Also, documentation & general clean-up: - remove `gen_char_from`: better served by `sample` or `choose`. - `gen_bytes` generalised to `gen_vec`. - `gen_int_range`/`gen_uint_range` merged into `gen_integer_range` and made to be properly uniformly distributed. Fixes #8644. Minor adjustments to other functions.
2013-09-22std: move rand.rs to rand/mod.rs.Huon Wilson-1/+0
2013-09-22std::result: Remove function `map_opt`blake2-ppc-13/+0
This function has never had any users in the tree
2013-09-22auto merge of #9395 : brson/rust/0.8, r=alexcrichtonbors-2/+2
2013-09-21auto merge of #9353 : brson/rust/sched, r=alexcrichton,cmrbors-10/+27
This guarantees that if there is work to do it will be found
2013-09-21Update version numbers to 0.8Brian Anderson-2/+2
2013-09-21std: add file::io::test module and ensure correct buildJeff Olson-243/+251