| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Turns out all six of these impls are incorrect.
|
|
Remove items that are unstable and deprecated
This removes unstable items that have been deprecated for more than one cycle.
- Since 1.16.0, `#![feature(enumset)]`
- All of `mod collections::enum_set`
- Since 1.15.0, `#![feature(borrow_state)]`
- `cell::BorrowState`
- `RefCell::borrow_state()`
- Since 1.15.0, `#![feature(is_unique)]`
- `Rc::is_unique()` (made private like `Arc::is_unique()`)
- Since 1.15.0, `#![feature(rc_would_unwrap)]`
- `Rc::would_wrap()`
- Since 1.13.0, `#![feature(binary_heap_extras)]`
- `BinaryHeap::push_pop()`
- `BinaryHeap::replace()`
- Since 1.12.0, `#![feature(as_unsafe_cell)]`
- `Cell::as_unsafe_cell()`
- `RefCell::as_unsafe_cell()`
- Since 1.12.0, `#![feature(map_entry_recover_keys)]`
- `btree_map::OccupiedEntry::remove_pair()`
- `hash_map::OccupiedEntry::remove_pair()`
- Since 1.11.0, `#![feature(float_extras)]`
- `Float::nan()`
- `Float::infinity()`
- `Float::neg_infinity()`
- `Float::neg_zero()`
- `Float::zero()`
- `Float::one()`
- `Float::integer_decode()`
- `f32::integer_decode()`
- `f32::ldexp()`
- `f32::frexp()`
- `f32::next_after()`
- `f64::integer_decode()`
- `f64::ldexp()`
- `f64::frexp()`
- `f64::next_after()`
- Since 1.11.0, `#![feature(zero_one)]`
- `num::Zero`
- `num::One`
|
|
rustc: replace TypeContents with two independent properties (is_freeze / needs_drop).
`InteriorUnsafe` / `interior_unsafe` was replaced with a private lang-item `Freeze` auto trait in libcore.
`OwnsDtor` / `needs_drop` was replaced with a specialized traversal that *doesn't* avoid caching results in case of a cycle, as the only cycles left can only occur in erroneous "types with infinite sizes", references and raw pointers not having destructors. Also, `Copy` is now checked at every step of the recursion.
r? @nikomatsakis
|
|
[unstable, deprecated since 1.11.0]
|
|
[unstable, deprecated since 1.11.0]
|
|
[unstable, deprecated since 1.15.0]
|
|
[unstable, deprecated since 1.12.0]
|
|
API docs: Convert
Clean up of the convert module documentation following points in #29349
|
|
|
|
|
|
|
|
These show up in rustdoc so need to be correct.
|
|
Clarify overflow behavior of `next_power_of_two`.
Related Issue: #18604
|
|
Rename compiler_barrier to compiler_fence
This addresses concerns raised following the merge of #41092. Specifically:
> The naming of these seems surprising: the multithreaded functions (and both the single and multithreaded intrinsics themselves) are fences, but this is a barrier. It's not incorrect, but the latter is both inconsistent with the existing functions and slightly confusing with another type in std (e.g., `Barrier`).
`compiler_fence` carries the same semantic implication that this is a compiler-only operation, while being more in line with the fence/barrier concepts already in use in `std`.
|
|
|
|
code format
|
|
|
|
Improve std::hash docs
Fixes #29357.
For details on what exactly I've done, see the commit descriptions.
There are some things I'm not sure about, but would like to address before merging this so the issue can be closed; any feedback on these points would really be appriciated:
* [x] ~I didn't touch the module level docs at all. On the one hand, I think they could use a short overview over the module; on the other hand, the module really isn't that big and I don't know if I could really do anything beyond just duplicating the type's summaries...~
* [x] ~I feel like the module-level examples are quite long-winded and not to the point, but I couldn't really think of anything better. Any ideas?~
* [x] ~Should `Hasher` get an example for implementing it? There is one in the module documentation, but it only "implements" it via `unimplemented!` and I'm not sure what the value of that is.~
* [x] ~Should `Hasher`'s `write_{int}` methods get examples?~
If there's anything else you'd like to see in std::hash's docs, please let me know!
r? @rust-lang/docs
|
|
|
|
This addresses concerns raised following the merge of #41092.
Specifically:
> The naming of these seems surprising: the multithreaded functions (and
> both the single and multithreaded intrinsics themselves) are fences,
> but this is a barrier. It's not incorrect, but the latter is both
> inconsistent with the existing functions and slightly confusing with
> another type in std (e.g., `Barrier`).
`compiler_fence` carries the same semantic implication that this is a
compiler-only operation, while being more in line with the fence/barrier
concepts already in use in `std`.
|
|
Clarify Iterator::position doc
Extend the example a little bit to show behaviour better.
r? @steveklabnik
|
|
Implement Manually Drop
As the RFC has been from approx a week in FCP without any major comments, I’m taking the opportunity to submit the PR early.
|
|
Extend the example a little bit to show behaviour better.
|
|
Reduce str transmutes, add mut versions of methods.
When I was working on the various parts involved in #40380 one of the comments I got was the excess of transmutes necessary to make the changes work. This is part of a set of multiple changes I'd like to offer to fix this problem.
I think that having these methods is reasonable because they're already possible via transmutes, and it makes the code that uses them safer. I can also add `pub(crate)` to these methods for now if the libs team would rather not expose them to the public without an RFC.
|
|
Explicit help message for binop type mismatch
When trying to do `1 + Some(2)`, or some other binary operation on two
types different types without an appropriate trait implementation, provide
an explicit help message:
```rust
help: `{integer} + std::option::Option<{integer}>` has no implementation
```
Re: #39579, #38564, #37626, #39942, #34698.
|
|
When trying to do a binary operation with missing implementation, for
example `1 + Some(2)`, provide an explicit help message:
```
note: no implementation for `{integer} + std::option::Option<{integer}>`
```
Use `rustc_on_unimplemented` for the suggestions. Move cfail test to ui.
|
|
|
|
Added doc comments for fmt::Result
Added doc comments for fmt::Result in regards to item 3 in issue #29355. I'm not certain that this is all that's needed but I think it's a good starting point on this item.
|
|
|
|
|
|
|
|
less intrinsics = better life
|
|
|
|
|
|
Implement .rfind() for slice iterators Iter and IterMut
Just like the forward case find, implement rfind explicitly for slice iterators Iter and IterMut.
|
|
Add safe wrapper for atomic_compilerfence intrinsics
This PR adds a proposed safe wrapper for the `atomic_singlethreadfence_*` intrinsics introduced by [RFC #888](https://github.com/rust-lang/rfcs/pull/888). See #41091 for further discussion.
|
|
Just like the forward case find, implement rfind explicitly
|
|
|
|
|
|
|
|
Part of #29357.
* rephrased summary sentences to be less redundant
* expanded top-level docs, adding a usage example and links to relevant
methods (`finish`, `write` etc) as well as `Hash`
* added examples to the `finish` and `write` methods
|
|
Part of #29357.
* merged "Derivable" and "How can I implement `Hash`?" sections into one
"Implementing `Hash`" section to aid coherency
* added an example for `#[derive(Hash)]`
* moved part about relation between `Hash` and `Eq` into a new "`Hash` and
`Eq`" section; changed wording to be more consistent with `HashMap` and
`HashSet`'s
* explicitly mentioned `#[derive(PartialEq, Eq, Hash)]` in the new section
* changed method summaries for consistency, adding links and examples
|
|
Part of #29357.
* split summary and explanation more clearly, while expanding the
explanation to make the reason for `BuildHasher` existing more clear
* added an example illustrating that `Hasher`s created by one `BuildHasher`
should be identical
* added links
* repeated the fact that hashers produced should be identical in
`build_hasher`s method docs
|
|
Part of #29357.
* split summary and explanation more clearly
* added link to nomicon for "zero-sized"
* "does not need construction" -> say how it can be created, and that it
doesn't need to be done with `HashMap` or `HashSet`
|
|
* Since the switch to pulldown-cmark reference links need a blank line
before the URLs.
* Reference link references are not case sensitive.
* Doc comments need to be indented uniformly otherwise rustdoc gets
confused.
|
|
|
|
Move libXtest into libX/tests
This change moves:
1. `libcoretest` into `libcore/tests`
2. `libcollectionstest` into `libcollections/tests`
This is a follow-up to #39561.
r? @alexcrichton
|
|
[T]::rsplit() and rsplit_mut(), #41020
|