| Age | Commit message (Collapse) | Author | Lines |
|
Rename .cap() methods to .capacity()
As mentioned in #60316, there are a few `.cap()` methods, which seem out-of-place because such methods are called `.capacity()` in the rest of the code.
This PR renames them to `.capacity()` but leaves `RawVec::cap()` in there for backwards compatibility.
I didn't try to mark the old version as "deprecated", because I guess this would cause too much noise.
|
|
|
|
In PR #62435 ("Use const generics for array impls [part 1]") the old
macro-based implementations were not removed but still used with
`cfg(bootstrap)` since the bootstrap compiler had some problems with
const generics at the time. This does not seem to be the case anymore,
so there is no reason to keep the old code.
|
|
|
|
bump Miri
Fixes https://github.com/rust-lang/rust/issues/62919.
r? @oli-obk
|
|
Closes rust-lang/rfcs#1428
|
|
add support for hexagon-unknown-linux-musl
|
|
|
|
Fix typo in mem::uninitialized doc
|
|
state also in the intro that UnsafeCell has no effect on &mut
Just to be extra sure.
|
|
Regenerate character tables for Unicode 12.1
|
|
|
|
|
|
Rollup of 14 pull requests
Successful merges:
- #60951 (more specific errors in src/librustc/mir/interpret/error.rs)
- #62523 (Delay bug to resolve HRTB ICE)
- #62656 (explain how to search in slice without owned data)
- #62791 (Handle more cases of typos misinterpreted as type ascription)
- #62804 (rustc_typeck: improve diagnostics for _ const/static declarations)
- #62808 (Revert "Disable stack probing for gnux32.")
- #62817 (Tweak span for variant not found error)
- #62842 (Add tests for issue-58887)
- #62851 (move unescape module to rustc_lexer)
- #62859 (Place::as_place_ref is now Place::as_ref)
- #62869 (add rustc_private as a proper language feature gate)
- #62880 (normalize use of backticks in compiler messages for librustc_allocator)
- #62885 (Change "OSX" to "macOS")
- #62889 (Update stage0.txt)
Failed merges:
r? @ghost
|
|
add rustc_private as a proper language feature gate
At the moment, `rustc_private` as a (library) feature exists by
accident: `char::is_xid_start`, `char::is_xid_continue` methods in
libcore define it.
cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F
I don't know if this is at all reasonable, but at least tests seem to pass locally. That probably means that we can remove/rename to something more resonable the feature in libcore in the next release?
|
|
explain how to search in slice without owned data
Cc https://github.com/rust-lang/rust/issues/62367
|
|
update Miri
Fixes https://github.com/rust-lang/rust/issues/62802
r? @oli-obk @eddyb
|
|
|
|
use const array repeat expressions for uninit_array
With a first implementation of https://github.com/rust-lang/rust/issues/49147 having landed, we can make this macro nicer and phase it out with the next bootstrap bump.
However, to make this work, we have to mark `MaybeUninit::uninit()` as promotable. I do feel uneasy about promoting stuff involving uninitialized memory, but OTOH no *operation* on `MaybeUninit` is promotable, so maybe this is okay?
r? @oli-obk @eddyb
|
|
fakenine:normalize_use_of_backticks_compiler_messages_p9, r=Centril
normalize use of backticks in compiler messages for libcore/ptr
https://github.com/rust-lang/rust/issues/60532
|
|
At the moment, `rustc_private` as a (library) feature exists by
accident: `char::is_xid_start`, `char::is_xid_continue` methods in
libcore define it.
|
|
do not use assume_init in std::io
Cc https://github.com/rust-lang/rust/issues/62397
|
|
Stabilize <*mut _>::cast and <*const _>::cast
Fixes #60602.
FCP: https://github.com/rust-lang/rust/issues/60602#issuecomment-511146402
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
https://github.com/rust-lang/rust/issues/60532
|
|
Add missing link to Infallible in TryFrom doc
|
|
Fix repeated wording in slice documentation
Changes `of the slice of the slice` to `of the slice` in the chunk- and friends documentation of slices
|
|
|
|
|
|
|
|
discussion https://github.com/rust-lang/rust/issues/50264
|
|
|
|
|
|
The `align_offset` method returns an `usize`, so using `add` makes more sense than using `offset`, which takes an `isize`.
|
|
Optimize pointer alignment in utf8 validation
This uses (and reuses) the u8 arrays's inherent block alignment when checking whether the current index is block aligned.
I initially thought that this would just move the expensive `align_offset` call out of the while loop and replace it with a subtraction and bitwise AND. But it appears this optimizes much better, too...
before: https://rust.godbolt.org/z/WIPvWl
after: https://rust.godbolt.org/z/-jBPoW
## Benchmarks
https://github.com/jridgewell/faster-from_utf8/tree/pointer-alignment
```
test from_utf8_2_bytes_fast ... bench: 310 ns/iter (+/- 42) = 1290 MB/s
test from_utf8_2_bytes_regular ... bench: 309 ns/iter (+/- 24) = 1294 MB/s
test from_utf8_3_bytes_fast ... bench: 1,027 ns/iter (+/- 62) = 1168 MB/s
test from_utf8_3_bytes_regular ... bench: 1,513 ns/iter (+/- 611) = 793 MB/s
test from_utf8_4_bytes_fast ... bench: 1,788 ns/iter (+/- 26) = 1342 MB/s
test from_utf8_4_bytes_regular ... bench: 1,907 ns/iter (+/- 181) = 1258 MB/s
test from_utf8_all_bytes_fast ... bench: 3,463 ns/iter (+/- 97) = 1155 MB/s
test from_utf8_all_bytes_regular ... bench: 4,083 ns/iter (+/- 89) = 979 MB/s
test from_utf8_ascii_fast ... bench: 88 ns/iter (+/- 4) = 28988 MB/s
test from_utf8_ascii_regular ... bench: 88 ns/iter (+/- 8) = 28988 MB/s
test from_utf8_cyr_fast ... bench: 7,707 ns/iter (+/- 531) = 665 MB/s
test from_utf8_cyr_regular ... bench: 8,202 ns/iter (+/- 135) = 625 MB/s
test from_utf8_enwik8_fast ... bench: 1,135,756 ns/iter (+/- 84,450) = 8804 MB/s
test from_utf8_enwik8_regular ... bench: 1,145,468 ns/iter (+/- 79,601) = 8730 MB/s
test from_utf8_jawik10_fast ... bench: 12,723,844 ns/iter (+/- 473,247) = 785 MB/s
test from_utf8_jawik10_regular ... bench: 13,384,596 ns/iter (+/- 666,997) = 747 MB/s
test from_utf8_mixed_fast ... bench: 2,321 ns/iter (+/- 123) = 2081 MB/s
test from_utf8_mixed_regular ... bench: 2,702 ns/iter (+/- 408) = 1788 MB/s
test from_utf8_mostlyasc_fast ... bench: 249 ns/iter (+/- 10) = 14666 MB/s
test from_utf8_mostlyasc_regular ... bench: 276 ns/iter (+/- 5) = 13231 MB/s
```
|
|
Instead of doing two comparisons we can do only one with a bit of
cleverness.
LLVM currently can't do this optimization itself on x86-64.
|
|
Add Option::expect_none(msg) and unwrap_none()
These are `Option` analogues to `Result::expect_err` and `unwrap_err`.
|
|
|
|
|
|
|
|
|
|
|
|
FCP: https://github.com/rust-lang/rust/issues/60602#issuecomment-511146402
|