| Age | Commit message (Collapse) | Author | Lines |
|
Add links to std::char::REPLACEMENT_CHARACTER from docs.
There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!
|
|
Add individual documentation for <integer>`.swap_bytes`/.`reverse_bits`
|
|
[nll] enable feature(nll) on various crates for bootstrap: part 4
#53172
r? @nikomatsakis
|
|
Remove explicit returns where unnecessary
|
|
There are a few places where we mention the replacement character in the
docs, and it could be helpful for users to utilize the constant which is
available in the standard library, so let’s link to it!
|
|
|
|
|
|
|
|
Add individual docs for rotate_{left, right}
|
|
Fix doc link (again)
Similar to #52404. The link for comparison:
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken)
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed)
- https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed)
- https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed)
This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX):
rg -l dynamically-sized-types-and-sized
and then replacing all relevant occurrences via:
find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g
find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm
(Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux
(GNU sed) as well, but not tested.)
|
|
inline some short functions
I found these were outline in binaries i link. I think they ought to be inline, considering their size.
|
|
atomic ordering docs
Discussion in https://github.com/rust-lang/rfcs/pull/2503 revealed that this could be improved. I hope this helps.
|
|
|
|
|
|
|
|
|
|
|
|
`Option<&'a T>`
|
|
|
|
Place unions, pointer casts and pointer derefs behind extra feature gates
To ensure we don't stabilize these things together with const fn stabilization (or any other stabilization)
This PR moves union field accesses inside `const fn` behind a feature gate. It was possible without a feature gate before, but since `const fn` was behind a feature gate we can do this change.
While "dereferencing raw pointers" and "casting raw pointers to usize" were hard errors before this PR, one could work around them by abusing unions:
```rust
// deref
union Foo<T> {
x: &'static T,
y: *const T,
}
const FOO: u32 = unsafe { *Foo { y: 42 as *const T }.x };
// as usize cast
union Bar<T> {
x: usize,
y: *const T,
}
const BAR: usize = unsafe { Bar { y: &1u8 }.x };
```
r? @eddyb
cc @nikomatsakis
|
|
|
|
|
|
|
|
|
|
|
|
Rename Executor trait to Spawn
Renames the `Executor` trait to `Spawn` and the method on `Context` to `spawner`.
Note: Best only merge this after we've the alpha 3 announcement post ready.
r? @cramertj
|
|
fixed broken links to char
fixes https://github.com/rust-lang/rust/issues/32129
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
provides an overview of the Pin API which the trait is for,
and show how it can be used in making self referencial structs
part of #49150
|
|
|
|
|
|
|
|
|
|
|
|
Similar to #52404. The link for comparison:
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken)
- https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed)
- https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed)
- https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed)
This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX):
rg -l dynamically-sized-types-and-sized
and then replacing all relevant occurrences via:
find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g
find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm
(Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux
(GNU sed) as well, but not tested.)
|
|
Remove redundant field names in structs
|
|
|
|
|
|
Provide `{to,from}_{ne,le,be}_bytes` functions on integers
If one doesn't view integers as containers of bytes, converting them to
bytes necessarily needs the specfication of encoding.
I think Rust is a language that wants to be explicit. The `to_bytes`
function is basically the opposite of that – it converts an integer into
the native byte representation, but there's no mention (in the function
name) of it being very much platform dependent. Therefore, I think it
would be better to replace that method by three methods, the explicit
`to_ne_bytes` ("native endian") which does the same thing and
`to_{le,be}_bytes` which return the little- resp. big-endian encoding.
|
|
The old issue has already been in FCP, a new issue was opened for the
new API.
|
|
|
|
|
|
|
|
|