summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-10-18Made `std::task::TaskBuilder::future_result()` easier to useMarvin Löbel-64/+30
2013-10-18auto merge of #9924 : metajack/rust/fix-starts-with-ends-with, r=huonwbors-2/+6
d4a32386f3b6 broke these since slice_to() and slice_from() must get character boundaries, and arbitrary needle lengths don't necessarily map to character boundaries of the haystack. This also adds new tests that would have caught this bug.
2013-10-17Fix starts_with() and ends_with().Jack Moffitt-2/+6
d4a32386f3b6 broke these since slice_to() and slice_from() must get character boundaries, and arbitrary needle lengths don't necessarily map to character boundaries of the haystack. This also adds new tests that would have caught this bug.
2013-10-17Move sys::refcount to managed::refcountAlex Crichton-10/+7
More progress on #2240
2013-10-17std: Move size/align functions to std::mem. #2240Brian Anderson-202/+221
2013-10-17auto merge of #9908 : alexcrichton/rust/snapshots, r=thestingerbors-167/+0
2013-10-17Register new snapshotsAlex Crichton-167/+0
2013-10-17auto merge of #9907 : kballard/rust/vec_ends_with, r=alexcrichtonbors-21/+54
2013-10-17auto merge of #9900 : hatahet/rust/master, r=alexcrichtonbors-1/+1
Closes #9870
2013-10-17auto merge of #9863 : csainty/rust/issue-9755-once-fns-feature-directive, ↵bors-1/+2
r=alexcrichton Hello, First time rust contributor here, please let me know if I need to sort out the contribution agreement for this. I picked issue #9755 to dip my toe in the water, this pull request isn't quite complete though as I have not updated the documentation. The reason for this is that I haven't tracked down why this feature is gated so I don't feel I can write a justification of the same quality as the other features have been documented. If someone would like to explain or point me at a mail thread I am happy to update with this change. Hopefully I have understood the process of converting the old flag into a directive correctly. Also just to call out what I am sure if a known quirk when adding feature directives, you can't build this code unless you have a snapshot of the compiler which knows about the feature directive. Chicken and the egg. I split the change into two commits, the first should be able to build a snapshot that can compile the second.
2013-10-16Rewrite str.starts_with()/ends_with() to be simplerKevin Ballard-19/+6
2013-10-16Implement new methods vec.starts_with()/vec.ends_with()Kevin Ballard-0/+46
2013-10-16Rewrite vec.contains() to be simplerKevin Ballard-2/+2
2013-10-16Fixed example comment for num::cast().Ziad Hatahet-1/+1
2013-10-17Removed the -Z once_fns compiler flag and added the new feature directive of ↵Chris Sainty-1/+2
the same name to replace it. Changed the frame_address intrinsic to no longer be a once fn. This removes the dependency on once_fns from std.
2013-10-16auto merge of #9585 : vky/rust/num-docs, r=alexcrichtonbors-2/+70
Copied existing comments from other files, and added comments to functions that did not have existing comments available. cc #7511
2013-10-16Added comments to public functions in num.rs.Vijay Korapaty-2/+70
Copied existing comments from other files, and added comments to functions that did not have existing comments available.
2013-10-16auto merge of #9721 : klutzy/rust/uv-net-read-fix, r=alexcrichtonbors-8/+38
See #9605 for detailed information. This also fixes two tests of #8811.
2013-10-16auto merge of #9833 : alexcrichton/rust/fixes, r=brsonbors-19/+147
Commits have all the fun details
2013-10-16auto merge of #9634 : blake2-ppc/rust/by-ref-iter, r=thestingerbors-0/+44
std::iter: Introduce .by_ref() adaptor Creates a wrapper around a mutable reference to the iterator. This is useful to allow applying iterator adaptors while still retaining ownership of the original iterator value. Example:: let mut xs = range(0, 10); // sum the first five values let partial_sum = xs.by_ref().take(5).fold(0, |a, b| a + b); assert!(partial_sum == 10); // xs.next() is now `5` assert!(xs.next() == Some(5)); --- This adaptor requires the user to have good understanding of iterators or what a particular adaptor does. There could be some pitfalls here with the iterator protocol, it's mostly the same issues as other places regarding what happens after the iterator returns None for the first time. There could also be other ways to achieve the same thing, for example Implementing iterator on `&mut T` itself: `impl <T: Iterator<..>> Iterator for &mut T` but that would only lead to confusion I think.
2013-10-16auto merge of #9885 : thestinger/rust/vector, r=brsonbors-22/+110
The goal here is to avoid requiring a division or multiplication to compare against the length. The bounds check previously used an incorrect micro-optimization to replace the division by a multiplication, but now neither is necessary *for slices*. Unique/managed vectors will have to do a division to get the length until they are reworked/replaced.
2013-10-16auto merge of #9892 : Kimundi/rust/ResultToStr, r=alexcrichtonbors-6/+47
2013-10-16Added Result implementations for ToStr and fmt::DefaultMarvin Löbel-6/+47
2013-10-16auto merge of #9655 : kballard/rust/path-rewrite, r=alexcrichtonbors-1709/+4994
Rewrite the entire `std::path` module from scratch. `PosixPath` is now based on `~[u8]`, which fixes #7225. Unnecessary allocation has been eliminated. There are a lot of clients of `Path` that still assume utf-8 paths. This is covered in #9639.
2013-10-16path2: Update for privacy changesKevin Ballard-15/+3
Remove redundant `contains_nul` definition. Make `parse_prefix` private.
2013-10-16path2: Update for latest masterKevin Ballard-13/+22
Also fix some issues that crept into earlier commits during the conflict resoution for the rebase.
2013-10-16path2: Remove Path.into_str()Kevin Ballard-19/+0
2013-10-16path2: Remove some API functionsKevin Ballard-633/+84
Delete the following API functions: - set_dirname() - with_dirname() - set_filestem() - with_filestem() - add_extension() - file_path() Also change pop() to return a boolean instead of an owned copy of the old filename.
2013-10-16path2: Update based on more review feedbackKevin Ballard-322/+222
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15auto merge of #9857 : brson/rust/mainsched, r=alexcrichtonbors-2/+8
...al work This is causing really awful scheduler behavior where the main thread scheduler is continually waking up, stealing work, discovering it can't actually run the work, and sending it off to another scheduler. No test cases because we don't have suitable instrumentation for it.
2013-10-15Build a few extra features into format! parsingAlex Crichton-19/+135
* Allow named parameters to specify width/precision * Intepret the format string '0$' as "width is the 0th argument" instead of thinking the lone '0' was the sign-aware-zero-padding flag. To get both you'd need to put '00$' which makes more sense if you want both to happen. Closes #9669
2013-10-15Require module documentation with missing_docAlex Crichton-0/+12
Closes #9824
2013-10-15path2: Remove .with_display_str and friendsKevin Ballard-117/+122
Rewrite these methods as methods on Display and FilenameDisplay. This turns do path.with_display_str |s| { ... } into do path.display().with_str |s| { ... }
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-1090/+992
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Remove Path::normalize()Kevin Ballard-8/+5
There are no clients of this API, so just remove it. Update the module docstring to mention normalization.
2013-10-15path2: Write a few paragraphs of module documentationKevin Ballard-1/+54
2013-10-15path2: Update for loop -> continueKevin Ballard-2/+2
2013-10-15path2: Update asserts for new format!() styleKevin Ballard-31/+36
2013-10-15path2: Replace the path module outrightKevin Ballard-1975/+1189
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-15path2: Add format helpers .display() and .filename_display()Kevin Ballard-0/+83
These methods return an object that can be formatted using {} to print display strings. Path itself does not implement fmt::Default to avoid accidental usage of display strings in incorrect places (e.g. process arguments).
2013-10-15path2: Convert typedefs to `pub use`sKevin Ballard-15/+15
Turns out you can't call static methods on typedefs. Use `pub use` instead to work around this issue.
2013-10-15path2: Rename pop_opt() to pop() and add each_parent()Kevin Ballard-18/+152
2013-10-15path2: Implement stat supportKevin Ballard-0/+393
2013-10-15path2: Implement IterBytes for PathKevin Ballard-0/+16
2013-10-15path2: Implement .as_display_str() and .to_display_str()Kevin Ballard-1/+94
These functions are for working with a string representation of the path even if it's not UTF-8 encoded. They replace invalid UTF-8 sequences with the replacement char.
2013-10-15path2: Add opt variants for from_vec/from_strKevin Ballard-0/+73
2013-10-15path2: Rename Path::new() to Path::from_vec()Kevin Ballard-77/+77
2013-10-15path2: Implement WindowsPathKevin Ballard-28/+2314
2013-10-15path2: Update for changes from masterKevin Ballard-13/+13
2013-10-15path2: Add more tests to posix implKevin Ballard-3/+11