about summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2016-03-07Auto merge of #32081 - cmbrandenburg:spell_fix, r=apasel422bors-1/+1
2016-03-07Auto merge of #32078 - japaric:rustbuild-i686-musl, r=alexcrichtonbors-3/+9
- make sure we copy the third party objects (crt*.o) to the target stage directory. - apply the x86_64-musl logic also to the i686-musl target. --- r? @alexcrichton
2016-03-07Fix building libstd on on emscripten targets.ashleysommer-8/+232
Squashed 10 commits: 1) The main cause of the problem is that libstd/os/mod.rs treats emscripten targets as an alias of linux targets, whereas liblibc treats emscripten targets as musl-compliant, so it gets a slightly different struct stat64 defined. This commit adds conditional compilation checks to use the correct timestamp format on fs metadata functions in the case of compiling to emscripten targets. 2) Update previous commit to comply with rust formatting standards. Removed tab characters, remove trailing whitespaces. 3) Move emscripten changes into their own file under libstd/os/emscripten Put libstd/os/linux/fs back to the way it was. 4) Cannot use stat.st_ctim on emscripten to get created time. 5) Remove compile-time conditionals for target_env = musl, it looks like musl builds compile fine already. 6) Undone some formatting changes that are no longer needed, Removed some more target_env="musl" compilation checks that I missed from my previous commit. 7) upgrade to liblibc e19309c, it fixes the differences in the musl stat and stat64 definitions. 8) Undo the compile-time checks to check for emscripten (or musl targets) in the FileAttr struct. No longer needed after updating liblibc to e19309c. 9) Change the MetadataExt implementation of emscripten fs.rs module to match the changes in new liblibc. 10) remove a stray return statement, should have been removed in the previous commit.
2016-03-07Auto merge of #32051 - steveklabnik:gh9447, r=blussbors-6/+6
Fixes #9447
2016-03-06Spelling fix for "because"Craig M. Brandenburg-1/+1
2016-03-06rustbuild: fix cross compilation of libstd to i686-unknown-linux-muslJorge Aparicio-3/+9
- make sure we copy the third party objects (crt*.o) to the target stage directory. - apply the x86_64-musl logic also to the i686-musl target.
2016-03-06fix Recover::replacePiotr Czarnecki-2/+7
2016-03-06Auto merge of #32020 - alexcrichton:stabilize-into-ascii, r=brsonbors-8/+4
These were intended to land in stable 1.8 but were just waiting for the implementation PR, so now they're landing. Specifically this PR stabilizes: * `AsciiExt::into_ascii_uppercase` * `AsciiExt::into_ascii_lowercase` * `AsciiExt for Vec<u8>` * `AsciiExt for String`
2016-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-1/+1
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-03-05Add an impl for From traitAbhishek Chanda-0/+12
Converts a u8 slice to a Ipv4Addr
2016-03-05Turn 2 assertions into debug assertionsPiotr Czarnecki-2/+2
2016-03-05Add testsPiotr Czarnecki-2/+40
2016-03-05Use consistent syntaxPiotr Czarnecki-3/+3
2016-03-05Refactor fn robin_hoodPiotr Czarnecki-28/+53
2016-03-05Refactor fn Bucket::nextPiotr Czarnecki-15/+7
2016-03-05Add `InternalEntry` for use in all searches.Piotr Czarnecki-167/+119
2016-03-05Rename 'distance' -> 'displacement'Piotr Czarnecki-5/+5
2016-03-04End stdlib module summaries with a full stop.Steve Klabnik-6/+6
Fixes #9447
2016-03-04Rollup merge of #32027 - japaric:rustbuild-mips, r=alexcrichtonSteve Klabnik-1/+1
These targets don't link statically to libunwind or libc --- r? @alexcrichton
2016-03-04Formatting changes to make tidy passAbhishek Chanda-3/+3
2016-03-04Reject the reserved block as not globalAbhishek Chanda-1/+4
2016-03-04Exclude 0.0.0.0 from the list of globally routable addressesAbhishek Chanda-17/+17
2016-03-04Auto merge of #31945 - sfackler:net2, r=alexcrichtonbors-4/+733
I have these tagged as stable in 1.9, so this shouldn't merge until the 1.8 beta's cut.
2016-03-03[rustbuild] fix cross compilation of std for mips(el)-linux-muslJorge Aparicio-1/+1
These targets don't link statically to libunwind or libc
2016-03-03Fix netbsdSteven Fackler-4/+4
2016-03-03std: Stabilize `into_*` ASCII methodsAlex Crichton-8/+4
These were intended to land in stable 1.8 but were just waiting for the implementation PR, so now they're landing. Specifically this PR stabilizes: * `AsciiExt::into_ascii_uppercase` * `AsciiExt::into_ascii_lowercase` * `AsciiExt for Vec<u8>` * `AsciiExt for String`
2016-03-03Fix android buildSteven Fackler-3/+3
2016-03-02Fix comments and OSX buildSteven Fackler-5/+30
2016-03-02Rollup merge of #31985 - ashleysommer:libbackgrace_emscripten_fix, ↵Manish Goregaokar-1/+1
r=alexcrichton Was getting error: ``` running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu" ... Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized ``` This commit adds the emscripten target to the libbacktrace configure script so it is no longer unrecognized.
2016-03-02Rollup merge of #31982 - apasel422:sync, r=alexcrichtonManish Goregaokar-0/+6
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others. r? @alexcrichton
2016-03-02Fix compiling libstd with emscripten target.ashleysommer-1/+1
Was getting error: ``` running: "sh" "/home/flubba86/rust/src/libstd/../libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=asmjs-unknown-emscripten" "--build=x86_64-unknown-linux-gnu" ... Invalid configuration `asmjs-unknown-emscripten': system `emscripten' not recognized ``` Undo change to libbacktrace configure script. Modify libstd build.rs to not build libbacktrace in the case of targeting emscripten.
2016-03-01Explicitly opt out of `Sync` for `cell` and `mpsc` typesAndrew Paseltiner-0/+6
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others.
2016-03-01Auto merge of #31335 - SimonSapin:ascii-into, r=alexcrichtonbors-0/+106
The default implementations (with `where Self: Sized`) are so that methods that take `self` by value can exist in a trait that’s implemented for dynamically-sized types (`str` and `[u8]`). CC https://github.com/rust-lang/rust/issues/27809#issuecomment-177564950 CC @alexcrichton
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-30/+78
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-28Auto merge of #31897 - tshepang:ref-not-needed, r=steveklabnikbors-1/+1
Also, `path` seems better than `p`
2016-02-28Fix windowsSteven Fackler-174/+55
Also back out keepalive support for TCP since the API is perhaps not actually what we want. You can't read the interval on Windows, and we should probably separate the functionality of turning keepalive on and overriding the interval.
2016-02-28Add UDP functionality from net2Steven Fackler-4/+387
2016-02-28Add TCP functionality from net2Steven Fackler-0/+440
2016-02-28doc: "ref" not needed in the exampleTshepang Lekhonkhobe-1/+1
Also, `path` seems better than `p`
2016-02-27add indexing with RangeInclusive in libcore and libcollectionsAlex Burka-0/+1
2016-02-27core: add inclusive ranges to core::opsAlex Burka-1/+0
Since it removes the old iter::{range_inclusive, RangeInclusive} which were unstable and deprecated, this is a [breaking-change] on nightly.
2016-02-27Rollup merge of #31918 - GuillaumeGomez:patch-3, r=steveklabnikManish Goregaokar-0/+6
r? @steveklabnik Fixes #29334
2016-02-27Auto merge of #31914 - bluss:copy-from-slice-everywhere, r=alexcrichtonbors-7/+8
Use .copy_from_slice() where applicable .copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-26Auto merge of #31876 - ollie27:win_fill_bytes, r=brsonbors-7/+11
CryptGenRandom takes a DWORD (u32) for the length so it only supports writing u32::MAX bytes at a time. Casting the length from a usize caused truncation meaning the whole buffer was not always filled. cc #31841 This is the same as rust-lang-nursery/rand#99. I think it's a good idea to keep the implementations in sync. r? @alexcrichton
2016-02-26Auto merge of #31858 - alexcrichton:fix-networking-cast, r=brsonbors-5/+10
Similar to #31825 where the read/write limits were capped for files, this implements similar limits when reading/writing networking types. On Unix this shouldn't affect anything because the write size is already a `usize`, but on Windows this will cap the read/write amounts to `i32::max_value`. cc #31841
2016-02-26Use .copy_from_slice() where applicableUlrik Sverdrup-7/+8
.copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-26fixup #31878Manish Goregaokar-1/+1
2016-02-26Rollup merge of #31904 - bluss:writer-formatter-error, r=alexcrichtonManish Goregaokar-1/+8
Make sure formatter errors are emitted by the default Write::write_fmt Previously, if an error was returned from the formatter that did not originate in an underlying writer error, Write::write_fmt would return successfully even if the formatting did not complete (was interrupted by an `fmt::Error` return). Now we choose to emit an io::Error with kind Other for formatter errors. Since this may reveal error returns from `write!()` and similar that previously passed silently, it's a kind of a [breaking-change]. Fixes #31879
2016-02-26Rollup merge of #31896 - tshepang:idiom, r=steveklabnikManish Goregaokar-1/+1
2016-02-26Rollup merge of #31894 - tshepang:more-clear, r=steveklabnikManish Goregaokar-2/+1