summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2014-01-08Robustly read remaining bytes in a characterAlex Crichton-4/+16
Closes #11372
2014-01-08auto merge of #11370 : alexcrichton/rust/issue-10465, r=pwaltonbors-128/+147
Turned out to be a 2-line fix, but the compiler fallout was huge.
2014-01-08auto merge of #11405 : huonw/rust/moredocs, r=huonwbors-6/+6
Various documentation changes, change the 'borrowed pointer' terminology to 'reference', fix a problem with 'make dist' on windows.
2014-01-07Fixup the rest of the tests in the compilerAlex Crichton-2/+1
2014-01-07extratest: Fix all leaked trait importsAlex Crichton-1/+2
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-99/+65
2014-01-07Fix remaining cases of leaking importsAlex Crichton-5/+17
2014-01-07std: Fill in all missing importsAlex Crichton-24/+65
Fallout from the previous commits
2014-01-07'borrowed pointer' -> 'reference'Brian Anderson-6/+6
2014-01-08Renamed Option::map_default and mutate_default to map_or and mutate_or_setMarvin Löbel-7/+7
2014-01-07auto merge of #11353 : alexcrichton/rust/improve-logging, r=brsonbors-156/+272
This will allow capturing of common things like logging messages, stdout prints (using stdio println), and failure messages (printed to stderr). Any new prints added to libstd should be funneled through these task handles to allow capture as well. Additionally, this commit redirects logging back through a `Logger` trait so the log level can be usefully consumed by an arbitrary logger. This commit also introduces methods to set the task-local stdout handles: * std::io::stdio::set_stdout * std::io::stdio::set_stderr * std::io::logging::set_logger These methods all return the previous logger just in case it needs to be used for inspection. I plan on using this infrastructure for extra::test soon, but we don't quite have the primitives that I'd like to use for it, so it doesn't migrate extra::test at this time. Closes #6369
2014-01-07auto merge of #11348 : alexcrichton/rust/snapshots, r=brsonbors-32/+2
2014-01-07auto merge of #11342 : huonw/rust/trie-mut, r=alexcrichtonbors-154/+283
- Add `mut_iter`, `mut_lower_bound`, `mut_upper_bound` - Remove some internal iterators - Add benchmarks - Improve performance of `{mut_,}{lower,upper}_bound` - Minor clean-up of `extra::treemap` after I realised I wasn't exploiting macros to their full DRY potential.
2014-01-08std::trie: make lower_bound and upper_bound about 15% faster.Huon Wilson-10/+10
I believe this is mainly due to code-size reduction. Before: test [...]::bench_lower_bound ... bench: 818 ns/iter (+/- 100) test [...]::bench_upper_bound ... bench: 939 ns/iter (+/- 34) After: test [...]::bench_lower_bound ... bench: 698 ns/iter (+/- 60) test [...]::bench_upper_bound ... bench: 817 ns/iter (+/- 20)
2014-01-08std::trie: Add some iteration/search benchmarks.Huon Wilson-0/+60
2014-01-08std::trie: use macros to share code between the iterator implementations.Huon Wilson-129/+126
2014-01-08std::trie: remove some obsolete internal iterators.Huon Wilson-99/+3
2014-01-08std::trie: add an mutable-values iterator.Huon Wilson-0/+168
2014-01-07auto merge of #11329 : fhahn/rust/unused-cast-lint2, r=alexcrichtonbors-17/+17
Updates as mentioned in #11135
2014-01-06auto merge of #11355 : alexcrichton/rust/read-waits-forever, r=brsonbors-0/+22
All the fun is down below.
2014-01-06Don't read forever on a file descriptorAlex Crichton-0/+22
Similarly to the recent commit to do this for networking, there's no reason that a read on a file descriptor should continue reading until the entire buffer is full. This makes sense when dealing with literal files, but when dealing with things like stdin this doesn't make sense.
2014-01-06Support arbitrary stdout/stderr/logger handlesAlex Crichton-156/+272
This will allow capturing of common things like logging messages, stdout prints (using stdio println), and failure messages (printed to stderr). Any new prints added to libstd should be funneled through these task handles to allow capture as well. Additionally, this commit redirects logging back through a `Logger` trait so the log level can be usefully consumed by an arbitrary logger. This commit also introduces methods to set the task-local stdout handles: * std::io::stdio::set_stdout * std::io::stdio::set_stderr * std::io::logging::set_logger These methods all return the previous logger just in case it needs to be used for inspection. I plan on using this infrastructure for extra::test soon, but we don't quite have the primitives that I'd like to use for it, so it doesn't migrate extra::test at this time. Closes #6369
2014-01-06auto merge of #10826 : SimonSapin/rust/str-insert, r=brsonbors-0/+42
I could not run the tests because of unrelated building issue, sorry about that.
2014-01-06Remove some unnecessary type castsFlorian Hahn-17/+17
Conflicts: src/librustc/middle/lint.rs
2014-01-06auto merge of #11334 : alexcrichton/rust/fix-native-tcp, r=pcwaltonbors-0/+21
libnative erroneously would attempt to fill the entire buffer in a call to `read` before returning, when rather it should return immediately because there's not guaranteed to be any data that will ever be received again. Close #11328
2014-01-06Register new snapshotsAlex Crichton-32/+2
2014-01-06auto merge of #11333 : cmr/rust/triage2, r=alexcrichtonbors-5/+11
2014-01-06Don't wait for a full buffer when reading TCPAlex Crichton-0/+21
libnative erroneously would attempt to fill the entire buffer in a call to `read` before returning, when rather it should return immediately because there's not guaranteed to be any data that will ever be received again. Close #11328
2014-01-05Fix some warningsCorey Richardson-3/+2
2014-01-05std: mark some modules as unstableCorey Richardson-2/+9
Obviously everything is unstable, but these particularly so, and they will likely remain that way. Closes #10239
2014-01-06Revert "std: adjust requested stack size for thread-local storage."Huon Wilson-19/+1
This reverts commit f1b5f59287106fc511d29c425255bd343608065c. Using a private function of a library is a bad idea: several people (on Linux) were meeting with linking errors because of it (different/older versions of glibc).
2014-01-04auto merge of #11316 : vadimcn/rust/arm-ehabi, r=alexcrichtonbors-6/+12
Also, more precise unwinder private data size specification.
2014-01-04auto merge of #11310 : Dretch/rust/write_char, r=alexcrichtonbors-0/+18
2014-01-04Condition EH ABI on target_arch, not target_os.Vadim Chugunov-6/+12
More precise unwinder private data size specification.
2014-01-04auto merge of #11188 : brson/rust/noderef, r=brsonbors-43/+88
This removes the feature where newtype structs can be dereferenced like pointers, and likewise where certain enums can be dereferenced (which I imagine nobody realized still existed). This ad-hoc behavior is to be replaced by a more general overloadable dereference trait in the future. I've been nursing this patch for two months and think it's about rebased up to master. @nikomatsakis this makes a bunch of your type checking code noticeably uglier.
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-43/+88
2014-01-04auto merge of #11284 : huonw/rust/issue-6233, r=alexcrichtonbors-1/+19
If there is a lot of data in thread-local storage some implementations of pthreads (e.g. glibc) fail if you don't request a stack large enough -- by adjusting for the minimum size we guarantee that our stacks are always large enough. Issue #6233.
2014-01-04auto merge of #11301 : vadimcn/rust/fix-android, r=brsonbors-46/+113
This fixes stack unwinding on targets using ARM EHABI. closes #11147
2014-01-04auto merge of #11306 : alexcrichton/rust/native-bounds, r=pcwaltonbors-0/+8
This allows inspection of the current task's bounds regardless of what the underlying task is. Closes #11293
2014-01-04auto merge of #11271 : adridu59/rust/patch-io, r=huonwbors-21/+45
2014-01-04Restore Writer.write_char, see #10861.Gareth Smith-0/+18
2014-01-04std: io: add some code examplesAdrien Tétar-21/+45
Closes #11232.
2014-01-04auto merge of #11283 : brson/rust/doublefailure, r=alexcrichtonbors-1/+7
Previously this was an `rtabort!`, indicating a runtime bug. Promote this to a more intentional abort and print a (slightly) more informative error message. Can't test this sense our test suite can't handle an abort exit. I consider this to close #910, and that we should open another issue about implementing less conservative semantics here.
2014-01-04Add a stack_bounds function to the Runtime traitAlex Crichton-0/+8
This allows inspection of the current task's bounds regardless of what the underlying task is. Closes #11293
2014-01-03Fix ARM unwinding.Vadim Chugunov-46/+113
2014-01-03auto merge of #11251 : pcwalton/rust/remove-at-mut, r=pcwaltonbors-94/+12
r? @nikomatsakis for the borrow checker changes. Write guards are now eliminated.
2014-01-03libsyntax: Fix tests.Patrick Walton-0/+1
2014-01-03auto merge of #11280 : c-a/rust/inline_byteswap, r=brsonbors-27/+27
After writing some benchmarks for ebml::reader::vuint_at() I noticed that LLVM doesn't seem to inline the from_be32 function even though it only does a call to the bswap32 intrinsic in the x86_64 case. Marking the functions with #[inline(always)] fixes that and seems to me a reasonable thing to do. I got the following measurements in my vuint_at() benchmarks: - Before test ebml::bench::vuint_at_A_aligned ... bench: 1075 ns/iter (+/- 58) test ebml::bench::vuint_at_A_unaligned ... bench: 1073 ns/iter (+/- 5) test ebml::bench::vuint_at_D_aligned ... bench: 1150 ns/iter (+/- 5) test ebml::bench::vuint_at_D_unaligned ... bench: 1151 ns/iter (+/- 6) - Inline from_be32 test ebml::bench::vuint_at_A_aligned ... bench: 769 ns/iter (+/- 9) test ebml::bench::vuint_at_A_unaligned ... bench: 795 ns/iter (+/- 6) test ebml::bench::vuint_at_D_aligned ... bench: 758 ns/iter (+/- 8) test ebml::bench::vuint_at_D_unaligned ... bench: 759 ns/iter (+/- 8) - Using vuint_at_slow() test ebml::bench::vuint_at_A_aligned ... bench: 646 ns/iter (+/- 7) test ebml::bench::vuint_at_A_unaligned ... bench: 645 ns/iter (+/- 3) test ebml::bench::vuint_at_D_aligned ... bench: 907 ns/iter (+/- 4) test ebml::bench::vuint_at_D_unaligned ... bench: 1085 ns/iter (+/- 16) As expected inlining from_be32() gave a considerable speedup. I also tried how the "slow" version fared against the optimized version and noticed that it's actually a bit faster for small A class integers (using only two bytes) but slower for big D class integers (using four bytes)
2014-01-04std: adjust requested stack size for thread-local storage.Huon Wilson-1/+19
If there is a lot of data in thread-local storage some implementations of pthreads (e.g. glibc) fail if you don't request a stack large enough -- by adjusting for the minimum size we guarantee that our stacks are always large enough. Issue #6233.
2014-01-03libstd: Remove all support code related to `@mut`Patrick Walton-88/+0