about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2015-07-17Rollup merge of #27080 - soderstroff:kristof-patch, r=GankroManish Goregaokar-1/+1
I fixed a single character typo. r? @steveklabnik
2015-07-17Rollup merge of #27069 - Eljay:fix-raw-attr-typo, r=alexcrichtonManish Goregaokar-1/+1
Pretty sure this should apply to the module. r? @alexcrichton
2015-07-16Fixed typoKristof Söderström-1/+1
2015-07-16Merge branch 'doc_io_traits_enums' of https://github.com/steveklabnik/rust ↵Steve Klabnik-58/+601
into rollup_central
2015-07-16More docs for std::io free functions.Steve Klabnik-10/+10
2015-07-16More docs for std::io::WriteSteve Klabnik-12/+114
2015-07-16More docs for std::io::SeekSteve Klabnik-6/+27
2015-07-16More docs for std::io::ReadSteve Klabnik-12/+278
2015-07-16More docs for std::io::BufReadSteve Klabnik-32/+186
2015-07-16Fix typo in stability attribute.Lee Jeffery-1/+1
2015-07-16Rollup merge of #26950 - AlisdairO:memset, r=alexcrichtonManish Goregaokar-0/+166
In general, it's undesirable to have read_to_end use a buffer with uninitialized memory, as that could lead to undefined behaviour in the event of a bad Read implementation. Since we control the implementations of Read for Stdin and File, however, it should be okay for us to specialise them to improve performance. This PR is to do that! Adds some unsafe code to deal with creating the buffers. Since the read_to_end function needed to be used from the io and fs crates, I moved it into a newly-created sys::common::io module. Alternatively we could expose the new read_to_end functions to allow people to create their own read_to_end implementations for code they trust. Benchmarks: Read a 2.5MB file: sys_common::io::tests::bench_init_file ... bench: 27,473,317 ns/iter (+/- 2,490,767) sys_common::io::tests::bench_uninit_file ... bench: 25,611,793 ns/iter (+/- 2,137,387) Read a buffer full of constant values sys_common::io::tests::bench_uninitialized ... bench: 12,877,645 ns/iter (+/- 931,025) sys_common::io::tests::bench_zeroed ... bench: 18,581,082 ns/iter (+/- 1,541,108) So, approx a 7% speedup for file reading, which I think is worthwhile.
2015-07-16Rollup merge of #26977 - brson:stddoc, r=GankroManish Goregaokar-35/+224
Yet another attempt to make the prose on the std crate page clearer and more informative. This does a lot of things: tightens up the opening, adds useful links (including a link to the search bar), offers guidance on how to use the docs, and expands the prelude docs as a useful newbie entrypoint. r? @steveklabnik cc @aturon
2015-07-15Add specializations of read_to_end for Stdin, TcpStream and File,Alisdair Owens-0/+166
allowing them to read into a buffer containing uninitialized data, rather than pay the cost of zeroing.
2015-07-14Address more feedbackBrian Anderson-3/+3
2015-07-14Address more feedbackBrian Anderson-4/+5
2015-07-14Auto merge of #27024 - bluss:io-drain, r=alexcrichtonbors-8/+2
Use Vec::drain in BufWriter I happened past a comment that asked for functionality that we now have.
2015-07-14Use Vec::drain in BufWriterUlrik Sverdrup-8/+2
I happened past a comment that asked for functionality that we now have.
2015-07-13Address feedbackBrian Anderson-33/+37
2015-07-13Fix local pathBrian Anderson-1/+1
2015-07-13std: Refining crate docsBrian Anderson-33/+217
Yet another attempt to make the prose on the std crate page clearer and more informative. This does a lot of things: tightens up the opening, adds useful links (including a link to the search bar), offers guidance on how to use the docs, and expands the prelude docs as a useful newbie entrypoint.
2015-07-13Auto merge of #26241 - SimonSapin:derefmut-for-string, r=alexcrichtonbors-8/+60
See https://github.com/rust-lang/rfcs/issues/1157
2015-07-13Implement IndexMut for String and str.Simon Sapin-0/+4
... matching the existing Index impls. There is no reason not to if String implement DerefMut. The code removed in `src/librustc/middle/effect.rs` was added in #9750 to prevent things like `s[0] = 0x80` where `s: String`, but I belive became unnecessary when the Index(Mut) traits were introduced.
2015-07-13Add more tests for AsciiExt::is_asciiSimon Sapin-8/+11
2015-07-13Add tests for AsciiExt::make_ascii_*case, including on String.Simon Sapin-0/+45
2015-07-12Auto merge of #26958 - alexcrichton:down-with-thread-dtors, r=brsonbors-2/+19
TLS tests have been deadlocking on the OSX bots for quite some time now and this commit is the result of the investigation into what's going on. It turns out that a value in TLS which is being destroyed (e.g. the destructor is run) can be reset back to the initial state **while the destructor is running** if TLS is re-accessed. To fix this we stop calling drop_in_place on OSX and instead move the data to a temporary location on the stack.
2015-07-12std: Fix a TLS destructor bug on OSXAlex Crichton-2/+19
TLS tests have been deadlocking on the OSX bots for quite some time now and this commit is the result of the investigation into what's going on. It turns out that a value in TLS which is being destroyed (e.g. the destructor is run) can be reset back to the initial state **while the destructor is running** if TLS is re-accessed. To fix this we stop calling drop_in_place on OSX and instead move the data to a temporary location on the stack.
2015-07-12Auto merge of #26957 - wesleywiser:rename_connect_to_join, r=alexcrichtonbors-1/+1
Fixes #26900
2015-07-12Auto merge of #26965 - bluss:cstring-debug, r=alexcrichtonbors-4/+16
Use escaped byte string representation for CString Debug Faithfully represent the contents of the CString and CStr in their Debug impl, by treating them as byte strings with our default escaping to ascii representation. Add impl Debug for CStr. Fixes #26964.
2015-07-12Rollup merge of #26979 - tshepang:trim, r=GankroManish Goregaokar-4/+0
- It is clear that what follows are re-exports - There aren't so many re-exports that examples should be given
2015-07-12Auto merge of #26972 - jethrogb:patch-1, r=alexcrichtonbors-2/+6
The File object needs to be writable for the set_len to succeed.
2015-07-12Auto merge of #26959 - dhuseby:i686-unknown-freebsd, r=alexcrichtonbors-7/+9
this adds support for i686-unknown-freebsd target.
2015-07-12doc: remove redundant infoTshepang Lekhonkhobe-4/+0
- It is clear that what follows are re-exports - There aren't so many re-exports that examples should be given
2015-07-11Change std::fs::File.set_len example and documentationjethrogb-2/+6
The File object needs to be writable for the truncate to succeed.
2015-07-11Use escaped byte string representation for CString DebugUlrik Sverdrup-4/+16
Faithfully represent the contents of the CString and CStr in their Debug impl, by treating them as byte strings with our default escaping to ascii representation. Add impl Debug for Cstr. Fixes #26964.
2015-07-11fixing trailing whitespaceDave Huseby-1/+1
2015-07-11Rollup merge of #26936 - bluss:doc-array, r=steveklabnikManish Goregaokar-4/+4
Small tweaks for the documentation of the primitive type array Follow up to PR #26923, fix a few small details.
2015-07-11adding support for i686-unknown-freebsd targetDave Huseby-7/+9
2015-07-11Auto merge of #26903 - steveklabnik:io_function_docs, r=alexcricthonbors-19/+158
This round: io::Result and the free functions.
2015-07-11Auto merge of #26945 - steveklabnik:doc_io_bufreader, r=alexcrichtonbors-4/+77
Mostly just adding basic examples, what's there seems mostly good. r? @alexcrichton
2015-07-11Auto merge of #26929 - alexcrichton:windows-dir-junction, r=brsonbors-35/+225
Previously on Windows a directory junction would return false from `is_dir`, causing various odd behavior, specifically calls to `create_dir_all` might fail when they would otherwise continue to succeed. Closes #26716
2015-07-11Auto merge of #26941 - fhartwig:osx-file-debug, r=alexcrichtonbors-3/+15
This makes `Debug` for `File` show the file path and access mode of the file on OS X, just like on Linux. I'd be happy about any feedback how to make this code better. In particular, I'm not sure how to handle the buffer passed to `fnctl`. This way works, but it feels a bit cumbersome. `fcntl` unfortunately doesn't return the length of the path.
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-1/+1
2015-07-10More docs for std::io::BufReaderSteve Klabnik-4/+77
2015-07-10Auto merge of #26896 - tbu-:pr_getcwd, r=alexcrichtonbors-20/+26
(On Windows, it works already.)
2015-07-10std: Consider directory junctions as directoriesAlex Crichton-35/+225
Previously on Windows a directory junction would return false from `is_dir`, causing various odd behavior, specifically calls to `create_dir_all` might fail when they would otherwise continue to succeed. Closes #26716
2015-07-10Auto merge of #26928 - reem:cstr-is-a-cow, r=Gankrobors-2/+40
This allows CString and CStr to be used with the Cow type, which is extremely useful when interfacing with C libraries that make extensive use of C-style strings.
2015-07-10Add more std::io documentation.Steve Klabnik-19/+158
This round: io::Result and the free functions.
2015-07-10Show file name and access mode in Debug instance for File on OS XFlorian Hartwig-3/+15
2015-07-10Small tweaks for the documentation of the primitive type arrayUlrik Sverdrup-4/+4
2015-07-10Auto merge of #26751 - retep998:copy-that-floppy, r=alexcrichtonbors-16/+93
Using the OS mechanism for copying files allows the OS to optimize the transfer using stuff such as [Offloaded Data Transfers (ODX)](https://msdn.microsoft.com/en-us/library/windows/desktop/hh848056%28v=vs.85%29.aspx). Also preserves a lot more information, including NTFS [File Streams](https://msdn.microsoft.com/en-us/library/windows/desktop/aa364404%28v=vs.85%29.aspx), which the manual implementation threw away. In addition, it is an atomic operation, unlike the manual implementation which has extra calls for copying over permissions. r? @alexcrichton