summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2016-05-26std: Stabilize APIs for the 1.10 releaseAlex Crichton-21/+13
This commit applies the FCP decisions made by the libs team for the 1.10 cycle, including both new stabilizations and deprecations. Specifically, the list of APIs is: Stabilized: * `os::windows::fs::OpenOptionsExt::access_mode` * `os::windows::fs::OpenOptionsExt::share_mode` * `os::windows::fs::OpenOptionsExt::custom_flags` * `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::unix::fs::OpenOptionsExt::custom_flags` * `sync::Weak::new` * `Default for sync::Weak` * `panic::set_hook` * `panic::take_hook` * `panic::PanicInfo` * `panic::PanicInfo::payload` * `panic::PanicInfo::location` * `panic::Location` * `panic::Location::file` * `panic::Location::line` * `ffi::CStr::from_bytes_with_nul` * `ffi::CStr::from_bytes_with_nul_unchecked` * `ffi::FromBytesWithNulError` * `fs::Metadata::modified` * `fs::Metadata::accessed` * `fs::Metadata::created` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `SocketAddr::is_unnamed` * `SocketAddr::as_pathname` * `UnixStream::connect` * `UnixStream::pair` * `UnixStream::try_clone` * `UnixStream::local_addr` * `UnixStream::peer_addr` * `UnixStream::set_read_timeout` * `UnixStream::set_write_timeout` * `UnixStream::read_timeout` * `UnixStream::write_Timeout` * `UnixStream::set_nonblocking` * `UnixStream::take_error` * `UnixStream::shutdown` * Read/Write/RawFd impls for `UnixStream` * `UnixListener::bind` * `UnixListener::accept` * `UnixListener::try_clone` * `UnixListener::local_addr` * `UnixListener::set_nonblocking` * `UnixListener::take_error` * `UnixListener::incoming` * RawFd impls for `UnixListener` * `UnixDatagram::bind` * `UnixDatagram::unbound` * `UnixDatagram::pair` * `UnixDatagram::connect` * `UnixDatagram::try_clone` * `UnixDatagram::local_addr` * `UnixDatagram::peer_addr` * `UnixDatagram::recv_from` * `UnixDatagram::recv` * `UnixDatagram::send_to` * `UnixDatagram::send` * `UnixDatagram::set_read_timeout` * `UnixDatagram::set_write_timeout` * `UnixDatagram::read_timeout` * `UnixDatagram::write_timeout` * `UnixDatagram::set_nonblocking` * `UnixDatagram::take_error` * `UnixDatagram::shutdown` * RawFd impls for `UnixDatagram` * `{BTree,Hash}Map::values_mut` * `<[_]>::binary_search_by_key` Deprecated: * `StaticCondvar` - this, and all other static synchronization primitives below, are usable today through the lazy-static crate on stable Rust today. Additionally, we'd like the non-static versions to be directly usable in a static context one day, so they're unlikely to be the final forms of the APIs in any case. * `CONDVAR_INIT` * `StaticMutex` * `MUTEX_INIT` * `StaticRwLock` * `RWLOCK_INIT` * `iter::Peekable::is_empty` Closes #27717 Closes #27720 cc #27784 (but encode methods still exist) Closes #30014 Closes #30425 Closes #30449 Closes #31190 Closes #31399 Closes #31767 Closes #32111 Closes #32281 Closes #32312 Closes #32551 Closes #33018
2016-05-20Rollup merge of #33683 - sanxiyn:paren-span, r=nikomatsakisGuillaume Gomez-1/+1
Preserve span when lowering ExprKind::Paren Fix #33681.
2016-05-20Rollup merge of #33668 - dns2utf8:catch_thread, r=steveklabnikGuillaume Gomez-3/+8
Catch thread in example Since this is an example, the code will be copied by many people and should be over correct. ?r @steveklabnik
2016-05-19Auto merge of #33103 - ranma42:escape-unicode-last, r=alexcrichtonbors-0/+12
Implement `last` for `EscapeUnicode` The implementation is quite trivial as the last character is always `'{'`. As a side-effect it also improves the implementation of `last` for `EscapeUnicode`. Part of #24214, split from #31049. Maybe this (and the other changes that I will split from #31049) should wait for a test like `ed_iterator_specializations` to be added. Would it be sufficient to do the same for each possible escape length?
2016-05-19Catch thread in exampleStefan Schindler-3/+8
- Consume result of thread join() - Add link to threading model
2016-05-18address review commentsAriel Ben-Yehuda-12/+12
2016-05-18implement fuzzy matching in on_unimplementedAriel Ben-Yehuda-5/+12
2016-05-18Remove unnecessary parens in macroSeo Sanghyeon-1/+1
2016-05-16Auto merge of #33429 - ranma42:fix-x87-parsing, r=alexcrichtonbors-10/+81
Fix fast path of float parsing on x87 The fast path of the float parser relies on the rounding to happen exactly and directly to the correct number of bits. On x87, instead, double rounding would occour as the FPU stack defaults to 80 bits of precision. This can be fixed by setting the precision of the FPU stack before performing the int to float conversion. This can be achieved by changing the value of the x87 control word. This is a somewhat common operation that is in fact performed whenever a float needs to be truncated to an integer, but it is undesirable to add its overhead for code that does not rely on x87 for computations (i.e. on non-x86 architectures, or x86 architectures which perform FPU computations on using SSE). Fixes `num::dec2flt::fast_path_correct` (on x87).
2016-05-16Fix `asm!` blocksAndrea Canciani-2/+2
The `volatile` modifier was incorrectly written outside of the `asm!` blocks.
2016-05-16Cleanup documentationAndrea Canciani-31/+10
Remove irrelevant information (and instead provide pointer to reference documentation), replace ASCII-art table with the corresponding MarkDown one, and minor fixes.
2016-05-15Rollup merge of #33534 - dns2utf8:atomic_docs, r=GuillaumeGomezManish Goregaokar-2/+2
Simplify text This way it should be clear: Any number of other threads have this guaranty not just one other thread.
2016-05-14Auto merge of #33579 - Amanieu:atomic_bool2, r=alexcrichtonbors-58/+36
Make AtomicBool the same size as bool Reopening #32365 This allows `AtomicBool` to be transmuted to a `bool`, which makes it more consistent with the other atomic types. Note that this now guarantees that the atomic type will always contain a valid `bool` value, which wasn't the case before (due to `fetch_nand`). r? @alexcrichton
2016-05-13Make AtomicBool the same size as boolAmanieu d'Antras-58/+36
2016-05-13Document the x87 control wordAndrea Canciani-5/+62
Explain the meaning of the fields of the control word and provide more details about how the relevant one (Precision Control) is updated in the fast path.
2016-05-13Fix fast path of float parsing on x87Andrea Canciani-7/+42
The fast path of the float parser relies on the rounding to happen exactly and directly to the correct number of bits. On x87, instead, double rounding would occour as the FPU stack defaults to 80 bits of precision. This can be fixed by setting the precision of the FPU stack before performing the int to float conversion. This can be achieved by changing the value of the x87 control word. This is a somewhat common operation that is in fact performed whenever a float needs to be truncated to an integer, but it is undesirable to add its overhead for code that does not rely on x87 for computations (i.e. on non-x86 architectures, or x86 architectures which perform FPU computations on using SSE). Fixes `num::dec2flt::fast_path_correct` (on x87).
2016-05-12Auto merge of #33282 - alexcrichton:rustbuild-crate-tests, r=brsonbors-0/+7
rustbuild: Add support for crate tests + doctests This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-12rustbuild: Add support for crate tests + doctestsAlex Crichton-0/+4
This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-12Auto merge of #33306 - vadixidav:master, r=alexcrichtonbors-1/+73
add implementation of Ord for Cell<T> and RefCell<T> where T: Ord Raised this in issue #33305.
2016-05-11Rollup merge of #33401 - GuillaumeGomez:index_indication, r=pnkfelixGuillaume Gomez-0/+5
Add rustc_on_unimplemented for Index implementation on slice Reopening of #31071. It also extends the possibility of `#[rustc_on_unimplemented]` by providing a small type filter in order to find the ones which corresponds the most. r? @pnkfelix
2016-05-11Rollup merge of #33129 - GuillaumeGomez:fmt_doc, r=steveklabnikSteve Klabnik-0/+26
Doc improvement on std::fmt module Part of #29355. r? @steveklabnik
2016-05-11Improve error message for Index trait on slicesGuillaume Gomez-0/+4
2016-05-11Extend rustc_on_unimplemented flag: if a message is available at an impl, ↵ggomez-0/+1
this message will be displayed instead
2016-05-10rustbuild: Tighten dependencies of build scriptsAlex Crichton-0/+3
Ensure that `rerun-if-changed` is printed for all build scripts to ensure that they've all got the right list of dependencies.
2016-05-10Doc improvement on std::fmt moduleGuillaume Gomez-0/+26
2016-05-10Simplify textStefan Schindler-2/+2
2016-05-09Add new atomic integer typesAmanieu d'Antras-602/+418
2016-05-09Add #[cfg(target_has_atomic)] to get atomic support for the current targetAmanieu d'Antras-0/+1
2016-05-08Rollup merge of #33426 - sfackler:try-from, r=aturonManish Goregaokar-11/+141
Implement RFC 1542 cc #33417 r? @aturon
2016-05-08Rollup merge of #33420 - durka:patch-20, r=alexcrichtonManish Goregaokar-0/+5
implement RFC 1521 Adds documentation to Clone, specifying that Copy types should have a trivial Clone impl. Fixes #33416. I tried to use "should" and "must" as defined [here](https://tools.ietf.org/html/rfc2119). cc @ubsan
2016-05-07Rollup merge of #33428 - fiveop:wrapping_example, r=steveklabnikSteve Klabnik-0/+11
Add an example to Wrapping's documentation. Such an example would have helped me understand `Wrapping` quicker. r? @steveklabnik
2016-05-07Rollup merge of #33409 - kindlychung:patch-2, r=steveklabnikSteve Klabnik-2/+2
errors in the doc
2016-05-07Implement RFC 1542Steven Fackler-11/+141
cc #33417
2016-05-06Auto merge of #33138 - arielb1:sized-shortcut, r=nikomatsakisbors-1/+1
Short-cut `T: Sized` trait selection for ADTs Basically avoids all nested obligations when checking whether an ADT is sized - this speeds up typeck by ~15% The refactoring fixed #32963, but I also want to make `Copy` not object-safe (will commit that soon). Fixes #33201 r? @nikomatsakis
2016-05-06Add `get_mut` methods to the `RefCell` and `Cell`Tobias Bucher-0/+24
This is safe since the borrow checker ensures that we have the only mutable reference to the struct, thus we can safely borrow its interior. Tracking issue is #33444.
2016-05-05Auto merge of #33067 - notriddle:wrapping_neg, r=alexcrichtonbors-0/+9
Implement negation for wrapping numerals. Fixes #33037
2016-05-05Add an example to Wrapping's documentation.Philipp Matthias Schaefer-0/+11
2016-05-04implement RFC 1521Alex Burka-0/+5
Adds documentation to Clone, specifying that Copy types should have a trivial Clone impl. Fixes #33416.
2016-05-04Update iterator.rsKaiyin Zhong-1/+1
2016-05-04errors in the docKaiyin Zhong-2/+2
2016-05-03require the non-last elements of a tuple to be SizedAriel Ben-Yehuda-1/+1
This requirement appears to be missing from RFC1214, but is clearly necessary for translation. The last field of a tuple/enum remains in a state of limbo, compiling but causing an ICE when it is used - we should eventually fix that somehow. this is a [breaking-change] - a soundness fix - and requires a crater run.
2016-05-03Rollup merge of #33357 - pcwalton:inline-mem-forget, r=brsonManish Goregaokar-0/+1
libcore: Inline `mem::forget()`. Was causing severe performance problems in WebRender. r? @brson
2016-05-03Rollup merge of #33335 - cramertj:master, r=alexcrichtonManish Goregaokar-5/+5
docs: Changed docs for `size_of` to describe size as a stride offset Current documentation for `std::mem::size_of` is ambiguous, and the documentation for `std::intrinsics::size_of` incorrectly defines size. This fix re-defines size as the offset in bytes between successive instances of a type, as described in LLVM's [getTypeAllocSize](http://llvm.org/docs/doxygen/html/classllvm_1_1DataLayout.html#a1d6fcc02e91ba24510aba42660c90e29). Fixes: #33266
2016-05-02libcore: Inline `mem::forget()`.Patrick Walton-0/+1
Was causing severe performance problems in WebRender.
2016-05-02Auto merge of #33289 - birkenfeld:chain-find, r=blussbors-0/+17
Implement find() on Chain iterators This results in a roughly 2x speedup compared to the default impl "inherited" from Iterator. Benchmark: https://gist.github.com/birkenfeld/aa9b92cb7d55666dd4821207527eaf5b
2016-05-01docs: Changed docs for `size_of` to describe size as a stride offsetTaylor Cramer-5/+5
Current description of `std::mem::size_of` is ambiguous, and the `std::intrinsics::size_of` description incorrectly defines size as the number of bytes necessary to exactly overwrite a value, not including the padding between elements necessary in a vector or structure.
2016-05-01change unstable to stable on traits and set version properlyGeordon Worley-4/+4
2016-05-01fix implementation of Ord for Cell<T> and RefCell<T> where T: OrdGeordon Worley-1/+73
2016-04-30Implement find() on Chain iteratorsGeorg Brandl-0/+17
This results in a roughly 2x speedup compared to the default impl "inherited" from Iterator.
2016-04-30Impl int/uint::MIN/MAX in terms of min/max_valueSimonas Kazlauskas-0/+26