| Age | Commit message (Collapse) | Author | Lines |
|
instead of dup
|
|
Part of #29368.
* added missing links
* updated method summaries to use 3rd person style
* added missing periods in `Component`'s variant summaries
* use standard iterator boilerplate in `Components`' and `Iter`'s docs
* added example to `Iter::as_path`, adapted from `Components::as_path`'s
example
* consolidated examples for `Path::file_name`
* some other small fixes
|
|
Update magenta error codes
Update magenta error codes to match recent changes here: https://github.com/fuchsia-mirror/magenta/blob/master/system/public/magenta/errors.h
|
|
Various improvements in std::collections docs
The meat of this PR are:
* changes to (almost all?) iterator struct docs in std::collections such that they use the standard iterator boilerplate and state where they are created
* a bunch of added links (at least as much as possible given std::collections mostly being a facade and whatnot :sweat_smile:)
* an example for `Bound`
* changed phrasing for some summary sentences to be less redundant as well as more consistant with others in the module
There also are various other fixes, e.g. removing parens from method names in the module docs, changing some imperatives to 3rd person, etc.
r? @steveklabnik
|
|
|
|
Improve module description for std::f32 and std::f64
Fixes #29353, see discussion there.
|
|
* Changed btree_map's and hash_map's Entry (etc.) docs to be consistent
* Changed VecDeque's type and module summary sentences to be consistent
with each other as well as with other summary sentences in the module
* Changed HashMap's and HashSet's summary sentences to be less redundantly
phrased and also more consistant with the other summary sentences in the
module
* Also, added an example to Bound
|
|
* Added links where possible (limited because of facading)
* Changed references to methods from `foo()` to `foo` in module docs
* Changed references to methods from `HashMap::foo` to just `foo` in
top-level docs for `HashMap` and the `default` doc for `DefaultHasher`
* Various small other fixes
|
|
This greatly improves consistency.
|
|
Derive Hash for ThreadId + better example
Derive `Hash` for `ThreadId` (see comments in #21507). Useful for making maps based on thread, e.g. `HashMap<ThreadId, ?>`. Also update example code for thread IDs to be more useful.
|
|
Minor nits in primitive str
Some minor updates to linking, added some links, doc format, etc.
r? @GuillaumeGomez
|
|
Add contribution instructions to stdlib docs
Generally programming language docs have instructions on how to contribute changes.
I couldn't find any in the rust docs, so I figured I'd add an instructions section, let me know if this belongs somewhere else!
|
|
|
|
Fixes incorrect formatting in array's documentation.
Changes
- [`Clone`][clone] (only if `T: [Copy][copy]`)
to
- [`Clone`][clone] (only if `T: `[`Copy`](copy))
r? @steveklabnik
|
|
Fixes #29353
|
|
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.
|
|
|
|
Channel error docs
r? @steveklabnik
I'm going to need some help on this one, a few ambiguities.
|
|
Presumably `N` was supposed to be used in both places.
|
|
|
|
Update ChildStderr docs to be clearer
Before the docs only had a line about where it was found and that it was
a handle to stderr. This commit changes it so that the summary second line is
removed and that it's a bit clearer about what can be done with it. Part of
#29370
|
|
Add as_c_str
Again, tying up some consistencies with `CString`.
|
|
documentation to channel() and sync_channel(); adding more links #29377
|
|
|
|
|
|
Remove some CStr transmutes.
Because dedicated methods exist for these, we don't have to add other transmutes.
|
|
|
|
Fix Markdown issues in the docs
* Since the switch to pulldown-cmark reference links need a blank line
before the URLs. (#40912)
* Reference link references are not case sensitive.
* Doc comments need to be indented uniformly otherwise rustdoc gets
confused.
|
|
Add example to std::process::abort
This is a second step in order to complete this issue: https://github.com/rust-lang/rust/issues/29370
I submitted this PR with the help of @steveklabnik again. Thanks to him! More info here: https://github.com/rust-lang/rust/issues/29370#issuecomment-290653877
|
|
* 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.
|
|
std: Use `poll` instead of `select`
This gives us the benefit of supporting file descriptors over the limit that
select supports, which...
Closes #40894
|
|
|
|
Replace magic number with readable sig constant
SIG_ERR is defined as 'pub const SIG_ERR: sighandler_t = !0 as sighandler_t;'
|
|
Simplify HashMap Bucket interface
> Simplify HashMap Bucket interface
>
> * Store capacity_mask instead of capacity
> * Move bucket index into RawBucket
> * Valid bucket index is now always within [0..table_capacity)
> * Simplify iterators by moving logic into RawBuckets
> * Clone RawTable using RawBucket
> * Make retain aware of the number of elements
The idea was to put idx in RawBucket instead of the other Bucket types and simplify next() and prev() as much as possible. The rest was a side-effect of that change, except maybe the last 2.
This change makes iteration and other next/prev() heavy operations noticeably faster. Clone is way faster.
```
➜ hashmap2 git:(adapt) ✗ cargo benchcmp pre:: adp:: bench.txt
name pre:: ns/iter adp:: ns/iter diff ns/iter diff %
clone_10_000 74,364 39,736 -34,628 -46.57%
grow_100_000 8,343,553 8,233,785 -109,768 -1.32%
grow_10_000 817,825 723,958 -93,867 -11.48%
grow_big_value_100_000 18,418,979 17,906,186 -512,793 -2.78%
grow_big_value_10_000 1,219,242 1,103,334 -115,908 -9.51%
insert_1000 74,546 58,343 -16,203 -21.74%
insert_100_000 6,743,770 6,238,017 -505,753 -7.50%
insert_10_000 798,079 719,123 -78,956 -9.89%
insert_1_000_000 275,215,605 266,975,875 -8,239,730 -2.99%
insert_int_bigvalue_10_000 1,517,387 1,419,838 -97,549 -6.43%
insert_str_10_000 316,179 278,896 -37,283 -11.79%
insert_string_10_000 770,927 747,449 -23,478 -3.05%
iter_keys_100_000 386,099 333,104 -52,995 -13.73%
iterate_100_000 387,320 355,707 -31,613 -8.16%
lookup_100_000 206,757 193,063 -13,694 -6.62%
lookup_100_000_unif 219,366 193,180 -26,186 -11.94%
lookup_1_000_000 206,456 205,716 -740 -0.36%
lookup_1_000_000_unif 659,934 629,659 -30,275 -4.59%
lru_sim 20,194,334 18,442,149 -1,752,185 -8.68%
merge_shuffle 1,168,044 1,063,055 -104,989 -8.99%
```
Note 2: I may have messed up porting the diff, let's see what CI says.
|
|
This is a second (2/3?) step in order to complete this issue: https://github.com/rust-lang/rust/issues/29370
I submitted this PR with the help of @steveklabnik again. Thanks to him! More info here: https://github.com/rust-lang/rust/issues/29370#issuecomment-290653877
|
|
Revert "Implement AsRawFd/IntoRawFd for RawFd"
This reverts commit 2cf686f2cdd6446a3cd47df0305ead40fabe85df (#40842)
RawFd is a type alias for c_int, which is itself a type alias for i32.
As a result, adding AsRawFd and IntoRawFd impls for RawFd actually adds
them for i32.
As a result, the reverted commit makes this valid:
```
use std::os::unix::io::AsRawFd;
fn arf<T: AsRawFd>(_: T) {}
fn main() {
arf(32i32)
}
```
Implimenting AsRawFd and IntoRawFd for i32 breaks the promises of both
those traits that their methods return a valid RawFd.
r? @aturon
cc @Mic92 @kamalmarhubi
|
|
std::thread docs: fix link to current()
|
|
Improve documentation for `std::fs::DirBuilder`
|
|
API Docs: ascii
Add/update docs for the `ascii` module per #29341.
r? @steveklabnik
|
|
Add links and some examples to std::sync::mpsc docs
Addresses part of #29377
r? @steveklabnik
I took a stab at adding links to the `std::sync::mpsc` docs, and I also wrote a few examples.
Edit: Whoops, typed in `?r` instead of `r?`.
|
|
Updating the description for BarrierWaitResult #29377
Referencing `Barrier`, removing reference to `is_leader`.
|
|
Fix mutex's docs inconsistency
Fixes #40176.
r? @steveklabnik
cc @rust-lang/docs
|
|
* Store capacity_mask instead of capacity
* Move bucket index into RawBucket
* Bucket index is now always within [0..table_capacity)
* Clone RawTable using RawBucket
* Simplify iterators by moving logic into RawBuckets
* Make retain aware of the number of elements
|
|
|
|
This gives us the benefit of supporting file descriptors over the limit that
select supports, which...
Closes #40894
|
|
|
|
SIG_ERR is defined as 'pub const SIG_ERR: sighandler_t = !0 as sighandler_t;'
|
|
|
|
|
|
This reverts commit 2cf686f2cdd6446a3cd47df0305ead40fabe85df (#40842)
RawFd is a type alias for c_int, which is itself a type alias for i32.
As a result, adding AsRawFd and IntoRawFd impls for RawFd actually adds
them for i32.
As a result, the reverted commit makes this valid:
```
use std::os::unix::io::AsRawFd;
fn arf<T: AsRawFd>(_: T) {}
fn main() {
arf(32i32)
}
```
Implimenting AsRawFd and IntoRawFd for i32 breaks the promises of both
those traits that their methods return a valid RawFd.
r? @aturon
cc @Mic92 @kamalmarhubi
|