summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-08-03Post merge changes to #27488Simonas Kazlauskas-8/+4
2015-08-03vastly expand on the mem::uninitialized docsAlexis Beingessner-6/+74
2015-07-31Auto merge of #27382 - brson:gate-assoc-type, r=alexcrichtonbors-0/+1
There are still problems in both the design and implementation of this, so we don't want it landing in 1.2. cc @arielb1 @nikomatsakis cc #27364 r? @alexcrichton
2015-07-31Auto merge of #27370 - alexcrichton:stabilize-easy, r=brsonbors-12/+11
The following APIs were all marked with a `#[stable]` tag: * process::Child::id * error::Error::is * error::Error::downcast * error::Error::downcast_ref * error::Error::downcast_mut * io::Error::get_ref * io::Error::get_mut * io::Error::into_inner * hash::Hash::hash_slice * hash::Hasher::write_{i,u}{8,16,32,64,size}
2015-07-30Auto merge of #27388 - alexcrichton:remove-curious-inner, r=brsonbors-17/+19
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-30Auto merge of #27385 - chris-morgan:core-panic-use-$crate, r=alexcrichtonbors-2/+2
I’ve been sitting on this one for ages now. Silly me, if only I had got on and submitted it earlier it’d be into the stable release by now…
2015-07-30Auto merge of #27052 - wthrowe:atomic_send, r=Gankrobors-1/+2
I think this was just missed when `Send` and `Sync` were redone, since it seems odd to not be able to use things like `Arc<AtomicPtr>`. If it was intentional feel free to just close this. I used another test as a template for writing mine, so I hope I got all the headers and stuff right.
2015-07-29Feature gate associated type defaultsBrian Anderson-0/+1
There are multiple issues with them as designed and implemented. cc #27364
2015-07-29std: Remove the curious inner moduleAlex Crichton-19/+21
This isn't actually necessary any more with the advent of `$crate` and changes in the compiler to expand macros to `::core::$foo` in the context of a `#![no_std]` crate. The libcore inner module was also trimmed down a bit to the bare bones.
2015-07-30Use $crate in core::panic!Chris Morgan-2/+2
2015-07-30Rollup merge of #27352 - nagisa:illegal-to-invalid-docs, r=steveklabnikManish Goregaokar-5/+5
r? @steveklabnik
2015-07-29Rollup merge of #27379 - jeehoonkang:master, r=steveklabnikSteve Klabnik-1/+1
As described in the module documentation, the memory orderings in Rust are the same with that of LLVM. However, the documentation for the memory orderings enum says the memory orderings are the same of that of C++. Note that they differ in that C++'s support the consume reads, while LLVM's does not. Hence this commit fixes the bug in the documentation for the enum.
2015-07-29Rollup merge of #27326 - steveklabnik:doc_show_use, r=GankroSteve Klabnik-21/+42
In spirit with https://internals.rust-lang.org/t/should-we-keep-including-obvious-imports-in-code-examples/2217, show the feature flags we're using in examples. (also one instance of 'use')
2015-07-29Fix a documentation bug for memory orderingsJeehoon Kang-1/+1
As described in the module documentation, the memory orderings in Rust are the same with that of LLVM. However, the documentation for the memory orderings enum says the memory orderings are the same of that of C++. Note that they differ in that C++'s support the consume reads, while LLVM's does not. Hence this commit fixes the bug in the documentation for the enum.
2015-07-29Auto merge of #27358 - bluss:split-at-mut, r=aturonbors-4/+5
Use raw pointers to avoid aliasing violation in split_at_mut Fixes #27357
2015-07-28std: Stabilize a number of small APIsAlex Crichton-12/+11
The following APIs were all marked with a `#[stable]` tag: * process::Child::id * error::Error::is * error::Error::downcast * error::Error::downcast_ref * error::Error::downcast_mut * io::Error::get_ref * io::Error::get_mut * io::Error::into_inner * hash::Hash::hash_slice * hash::Hasher::write_{i,u}{8,16,32,64,size}
2015-07-28Use raw pointers to avoid aliasing violation in split_at_mutUlrik Sverdrup-4/+5
Fixes #27357
2015-07-28Replace occurences of illegal in user facing docsSimonas Kazlauskas-5/+5
2015-07-28Auto merge of #27319 - diaphore:pr_debug_osstr_escape, r=alexcrichtonbors-2/+2
I had to modify some tests : since `wtf8buf_show` and `wtf8_show` were doing the exact same thing, I repurposed `wtf8_show` to `wtf8buf_show_str` which ensures `Wtf8Buf` `Debug`-formats the same as `str`. `write_str_escaped` might also be shared amongst other `fmt` but I just left it there within `Wtf8::fmt` for review.
2015-07-28Auto merge of #27309 - eddyb:snapshot-infdef, r=alexcrichtonbors-9/+0
FreeBSD i386 snapshot is missing, failed tests (possibly spurious). r? @alexcrichton
2015-07-28Auto merge of #27280 - bluss:siphash-perf, r=alexcrichtonbors-4/+22
Improve siphash performance for longer data Use `ptr::copy_nonoverlapping` (aka memcpy) to load an u64 from the byte stream. This is correct for any alignment, and the compiler will use the appropriate instruction to load the data. Also contains small tweaks that should benefit hashing short data too, both the commit that removes a variable and the autovectorization of the hash state initialization (in SipHash::reset). Benchmarks show that hashing longer data benefits for the improved word loading. Before (using benchmarks from the first commit in the PR): The before benchmark is a bit noisy. ``` test hash::sip::bench_bytes_4 ... bench: 41 ns/iter (+/- 0) = 97 MB/s test hash::sip::bench_bytes_7 ... bench: 49 ns/iter (+/- 2) = 142 MB/s test hash::sip::bench_bytes_8 ... bench: 42 ns/iter (+/- 4) = 190 MB/s test hash::sip::bench_bytes_a_16 ... bench: 57 ns/iter (+/- 14) = 280 MB/s test hash::sip::bench_bytes_b_32 ... bench: 85 ns/iter (+/- 74) = 376 MB/s test hash::sip::bench_bytes_c_128 ... bench: 278 ns/iter (+/- 33) = 460 MB/s test hash::sip::bench_long_str ... bench: 825 ns/iter (+/- 103) test hash::sip::bench_str_of_8_bytes ... bench: 151 ns/iter (+/- 66) test hash::sip::bench_str_over_8_bytes ... bench: 59 ns/iter (+/- 3) test hash::sip::bench_str_under_8_bytes ... bench: 47 ns/iter (+/- 56) test hash::sip::bench_u32 ... bench: 39 ns/iter (+/- 93) = 205 MB/s test hash::sip::bench_u32_keyed ... bench: 40 ns/iter (+/- 88) = 200 MB/s test hash::sip::bench_u64 ... bench: 54 ns/iter (+/- 96) = 148 MB/s ``` After: ``` test hash::sip::bench_bytes_4 ... bench: 41 ns/iter (+/- 3) = 97 MB/s test hash::sip::bench_bytes_7 ... bench: 48 ns/iter (+/- 0) = 145 MB/s test hash::sip::bench_bytes_8 ... bench: 35 ns/iter (+/- 1) = 228 MB/s test hash::sip::bench_bytes_a_16 ... bench: 45 ns/iter (+/- 1) = 355 MB/s test hash::sip::bench_bytes_b_32 ... bench: 60 ns/iter (+/- 0) = 533 MB/s test hash::sip::bench_bytes_c_128 ... bench: 161 ns/iter (+/- 5) = 795 MB/s test hash::sip::bench_long_str ... bench: 514 ns/iter (+/- 5) test hash::sip::bench_str_of_8_bytes ... bench: 44 ns/iter (+/- 0) test hash::sip::bench_str_over_8_bytes ... bench: 51 ns/iter (+/- 0) test hash::sip::bench_str_under_8_bytes ... bench: 52 ns/iter (+/- 6) test hash::sip::bench_u32 ... bench: 40 ns/iter (+/- 2) = 200 MB/s test hash::sip::bench_u32_keyed ... bench: 39 ns/iter (+/- 1) = 205 MB/s test hash::sip::bench_u64 ... bench: 36 ns/iter (+/- 1) = 222 MB/s ```
2015-07-28Auto merge of #26914 - alexcrichton:deprecate-easy, r=aturonbors-0/+20
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * box_heap * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-0/+20
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-27Fix escaping of characters in Debug for OsStrdiaphore-2/+2
Fixes #27211 Fix Debug for {char, str} in core::fmt
2015-07-27Show appropriate feature flags in docsSteve Klabnik-21/+42
2015-07-27Auto merge of #27278 - thepowersgang:result-expect-issue, r=alexcrichtonbors-1/+1
2015-07-27Register new snapshots (2015-07-26 a5c12f4).Eduard Burtescu-9/+0
2015-07-25siphash: Reorder hash state in the structUlrik Sverdrup-1/+5
If they are ordered v0, v2, v1, v3, the compiler can find just a few simd optimizations itself. The new optimization I could observe on x86-64 was using 128 bit registers for the v = key ^ constant operations in new / reset.
2015-07-25siphash: Remove one variableUlrik Sverdrup-2/+1
Without this temporary variable, codegen improves slightly and less registers are spilled to the stack in SipHash::write.
2015-07-25siphash: Use ptr::copy_nonoverlapping for efficient data loadingUlrik Sverdrup-1/+16
Use `ptr::copy_nonoverlapping` (aka memcpy) to load an u64 from the byte stream. This is correct for any alignment, and the compiler will use the appropriate instruction to load the data. Use unchecked indexing. This results in a large improvement of throughput (hashed bytes / second) for long data. Maximum improvement benches at a 70% increase in throughput for large values (> 256 bytes) but already values of 16 bytes or larger improve. Introducing unchecked indexing is motivated to reach as good throughput as possible. Using ptr::copy_nonoverlapping without unchecked indexing would land the improvement some 20-30 pct units lower. We use a debug assertion so that the test suite checks our use of unchecked indexing.
2015-07-25Reference issue #27277 on Result::expectJohn Hodge-1/+1
2015-07-25Auto merge of #27233 - tbu-:pr_wtf8, r=alexcrichtonbors-12/+16
2015-07-24Rollup merge of #27238 - steveklabnik:gh26927, r=huonwSteve Klabnik-0/+8
FIxes #26927
2015-07-24Auto merge of #27215 - pnkfelix:fsk-placer-take-5-just-in, r=nikomatsakisbors-0/+125
Macro desugaring of `in PLACE { BLOCK }` into "simpler" expressions following the in-development "Placer" protocol. Includes Placer API that one can override to integrate support for `in` into one's own type. (See [RFC 809].) [RFC 809]: https://github.com/rust-lang/rfcs/blob/master/text/0809-box-and-in-for-stdlib.md Part of #22181 Replaced PR #26180. Turns on the `in PLACE { BLOCK }` syntax, while leaving in support for the old `box (PLACE) EXPR` syntax (since we need to support that at least until we have a snapshot with support for `in PLACE { BLOCK }`. (Note that we are not 100% committed to the `in PLACE { BLOCK }` syntax. In particular I still want to play around with some other alternatives. Still, I want to get the fundamental framework for the protocol landed so we can play with implementing it for non `Box` types.) ---- Also, this PR leaves out support for desugaring-based `box EXPR`. We will hopefully land that in the future, but for the short term there are type-inference issues injected by that change that we want to resolve separately.
2015-07-24Add unstable attribute to `char::from_u32_unchecked`Tobias Bucher-0/+1
2015-07-23Link Deref{,Mut} to TRPL on coercions.Steve Klabnik-0/+8
FIxes #26927
2015-07-23Review feedback: add unstable marker to Placer API and put in bound that now ↵Felix S. Klock II-1/+6
works.
2015-07-23wtf8, char: Replace uses of `mem::transmute` with more specific functionsTobias Bucher-12/+15
2015-07-23Auto merge of #27192 - dotdash:inline_eq_slice, r=luqmanabors-12/+3
eq_slice_() used to be a common implementation for two function that both called it, but of those only eq_slice() is left, so we can as well directly inline the code.
2015-07-22placate `make tidy`.Felix S. Klock II-1/+1
2015-07-22Rollup merge of #27151 - pfalabella:patch-2, r=steveklabnikSteve Klabnik-4/+4
I'm pretty sure this was a typo
2015-07-22Change signature for `move_val_init` intrinsic to take `*mut T` for `dest`.Felix S. Klock II-0/+8
rebase update to typeck/check/mod.rs
2015-07-22prototype Placer protocol for unstable overloaded-box and placement-in.Felix S. Klock II-0/+112
2015-07-22Auto merge of #27176 - alexcrichton:fix-stock-llvm, r=brsonbors-0/+6
This commit moves the IR files in the distribution, rust_try.ll, rust_try_msvc_64.ll, and rust_try_msvc_32.ll into the compiler from the main distribution. There's a few reasons for this change: * LLVM changes its IR syntax from time to time, so it's very difficult to have these files build across many LLVM versions simultaneously. We'll likely want to retain this ability for quite some time into the future. * The implementation of these files is closely tied to the compiler and runtime itself, so it makes sense to fold it into a location which can do more platform-specific checks for various implementation details (such as MSVC 32 vs 64-bit). * This removes LLVM as a build-time dependency of the standard library. This may end up becoming very useful if we move towards building the standard library with Cargo. In the immediate future, however, this commit should restore compatibility with LLVM 3.5 and 3.6.
2015-07-21trans: Move rust_try into the compilerAlex Crichton-0/+6
This commit moves the IR files in the distribution, rust_try.ll, rust_try_msvc_64.ll, and rust_try_msvc_32.ll into the compiler from the main distribution. There's a few reasons for this change: * LLVM changes its IR syntax from time to time, so it's very difficult to have these files build across many LLVM versions simultaneously. We'll likely want to retain this ability for quite some time into the future. * The implementation of these files is closely tied to the compiler and runtime itself, so it makes sense to fold it into a location which can do more platform-specific checks for various implementation details (such as MSVC 32 vs 64-bit). * This removes LLVM as a build-time dependency of the standard library. This may end up becoming very useful if we move towards building the standard library with Cargo. In the immediate future, however, this commit should restore compatibility with LLVM 3.5 and 3.6.
2015-07-21Inline eq_slice_() into eq_slice()Björn Steinbrink-12/+3
eq_slice_() used to be a common implementation for two function that both called it, but of those only eq_slice() is left, so we can as well directly inline the code.
2015-07-21Auto merge of #27168 - brson:stdprim, r=steveklabnikbors-97/+5
This makes the primitive descriptions on the front page read properly as descriptions of types and not of the associated modules. Having the primitive and module docs derived from the same source causes problems, primarily that they can't contain hyperlinks cross-referencing each other. This crates dedicated private modules in `std` to document the primitive types, then for all primitives that have a corresponding module, puts hyperlinks in moth the primitive docs and the module docs cross-linking each other. This should help clear up confusion when readers find themselves on the wrong page. This also removes all the duplicate `#[doc(primitive)]` tags in various places (especially core), so the core docs will no longer attempt to document the primitives for now. Seems like an acceptable tradeoff to get some cleanup for std.
2015-07-21Auto merge of #27129 - arthurprs:debug_atomic, r=alexcrichtonbors-0/+21
I'm being constantly bitten by the lack of this implementation. I'm unsure if there's a reason to avoid these implementations though. Since we have a "lossy" implementation for both Mutex and RWLock (RWLock {{ locked }}) I don't think there's a big reason for not having a Debug implementation for the atomic types, even if the user can't specify the ordering.
2015-07-20Auto merge of #27056 - Eljay:doc-comments, r=nikomatsakisbors-10/+10
Fixes #23812 by stripping the decoration when desugaring macro doc comments into #[doc] attributes, and detects whether the attribute should be inner or outer style and outputs the appropriate token tree.
2015-07-20std: Create separate docs for the primitivesBrian Anderson-95/+3
Having the primitive and module docs derived from the same source causes problems, primarily that they can't contain hyperlinks cross-referencing each other. This crates dedicated private modules in `std` to document the primitive types, then for all primitives that have a corresponding module, puts hyperlinks in moth the primitive docs and the module docs cross-linking each other. This should help clear up confusion when readers find themselves on the wrong page.