about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-321/+321
Who doesn't like a massive renaming?
2013-10-22auto merge of #10009 : LeoTestard/rust/asm-feature-gated, r=huonwbors-1/+1
Suite of #9991
2013-10-22Activate checking code for ASM feature gate. Fix testsLéo Testard-1/+1
2013-10-21auto merge of #9937 : brson/rust/log_str, r=alexcrichtonbors-18/+13
2013-10-21auto merge of #9936 : madjar/rust/master, r=alexcrichtonbors-6/+0
This should close #9468. I removed the test stating that nested comments should not be implemented. I had a little chicken-and-egg problem because a comment of the std contains "/*", and adding support for nested comment creates a backward incompatibility in that case, so I had to use a dirty hack to get stage1 and stage2 to compile. This part should be revert when this commit lands in a snapshot. This is my first non-typo contribution, so I'm open to any comment.
2013-10-21auto merge of #10000 : cmr/rust/snapshot, r=alexcrichtonbors-3/+0
2013-10-21Add support for nested commentsGeorges Dubus-6/+0
Fixes #9468.
2013-10-21std: Move sys::log_str to repr::repr_to_str. Further work on #2240.Brian Anderson-18/+13
2013-10-21Register snapshotsCorey Richardson-3/+0
2013-10-21fix the new floating point intrinsicsDaniel Micay-2/+2
2013-10-21auto merge of #9986 : thestinger/rust/float, r=cmrbors-0/+20
copysign, ring, nearbyint, round
2013-10-21expose new floating point intrinsicsDaniel Micay-0/+20
copysign, ring, nearbyint, round
2013-10-20Don't allocate a string when calling printlnAlex Crichton-1/+18
Instead use format_args! to pass around a struct to pass along into std::fmt
2013-10-20auto merge of #9812 : HNO3/rust/windows-utf8, r=alexcrichtonbors-5/+96
This fixes #9418 and #9618, and potential problems related to directory walking.
2013-10-20Fix unicode errors on Windows in path_is_dir, path_exists, getcwd and ↵LEE Wondong-5/+96
rust_localtime. This make these functions use wchar_t version of APIs, instead of char version.
2013-10-19auto merge of #9952 : huonw/rust/fmt-doc, r=alexcrichtonbors-14/+14
Cf. the concern raised in https://github.com/mozilla/rust/pull/9938#issuecomment-26648696.
2013-10-19auto merge of #9834 : alexcrichton/rust/morestack, r=brsonbors-67/+412
This commit re-introduces the functionality of __morestack in a way that it was not originally anticipated. Rust does not currently have segmented stacks, rather just large stack segments. We do not detect when these stack segments are overrun currently, but this commit leverages __morestack in order to check this. This commit purges a lot of the old __morestack and stack limit C++ functionality, migrating the necessary chunks to rust. The stack limit is now entirely maintained in rust, and the "main logic bits" of __morestack are now also implemented in rust as well. I put my best effort into validating that this currently builds and runs successfully on osx and linux 32/64 bit, but I was unable to get this working on windows. We never did have unwinding through __morestack frames, and although I tried poking at it for a bit, I was unable to understand why we don't get unwinding right now. A focus of this commit is to implement as much of the logic in rust as possible. This involved some liberal usage of `no_split_stack` in various locations, along with some use of the `asm!` macro (scary). I modified a bit of C++ to stop calling `record_sp_limit` because this is no longer defined in C++, rather in rust. Another consequence of this commit is that `thread_local_storage::{get, set}` must both be flagged with `#[rust_stack]`. I've briefly looked at the implementations on osx/linux/windows to ensure that they're pretty small stacks, and I'm pretty sure that they're definitely less than 20K stacks, so we probably don't have a lot to worry about. Other things worthy of note: * The default stack size is now 4MB instead of 2MB. This is so that when we request 2MB to call a C function you don't immediately overflow because you have consumed any stack at all. * `asm!` is actually pretty cool, maybe we could actually define context switching with it? * I wanted to add links to the internet about all this jazz of storing information in TLS, but I was only able to find a link for the windows implementation. Otherwise my suggestion is just "disassemble on that arch and see what happens" * I put my best effort forward on arm/mips to tweak __morestack correctly, we have no ability to test this so an extra set of eyes would be useful on these spots. * This is all really tricky stuff, so I tried to put as many comments as I thought were necessary, but if anything is still unclear (or I completely forgot to take something into account), I'm willing to write more!
2013-10-19Use __morestack to detect stack overflowAlex Crichton-67/+412
This commit resumes management of the stack boundaries and limits when switching between tasks. This additionally leverages the __morestack function to run code on "stack overflow". The current behavior is to abort the process, but this is probably not the best behavior in the long term (for deails, see the comment I wrote up in the stack exhaustion routine).
2013-10-19std::fmt: fix markdown peculiarity, unicodify some arrows, ` some trait names.Huon Wilson-14/+14
2013-10-19auto merge of #9932 : alexcrichton/rust/better-fmt-errors, r=cmrbors-24/+27
Instead of just saying "unterminated format string" and friends, instead print information about what was expected and what was found. Closes #9931
2013-10-18Try to improve format! error messagesAlex Crichton-24/+27
Instead of just saying "unterminated format string" and friends, instead print information about what was expected and what was found. Closes #9931
2013-10-18auto merge of #9938 : alexcrichton/rust/fmtdox, r=huonwbors-3/+48
Closes #9865 Closes #9808
2013-10-18auto merge of #9919 : alexcrichton/rust/fmt-begone, r=huonwbors-704/+0
It lived a good life, but its time has come. The groundwork is set for the official transition after the next snapshot (removal of XXX2 macros)
2013-10-18Remove the fmt! syntax extensionAlex Crichton-704/+0
It lived a good life, but its time has come. The groundwork is set for the official transition after the next snapshot (removal of XXX2 macros)
2013-10-18Document traits and Default about format! betterAlex Crichton-3/+48
Closes #9865 Closes #9808
2013-10-18auto merge of #9935 : reedlepee123/rust/my_new_branch, r=bstriebors-6/+6
2013-10-19Make fields in std::comm privatechitra-6/+6
2013-10-18Fix an off-by-one in managed::refcountAlex Crichton-1/+12
This fixes a bug I accidentally introduced in #9922
2013-10-18auto merge of #9926 : Kimundi/rust/future_result_bad_sig, r=huonwbors-64/+30
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.