| Age | Commit message (Collapse) | Author | Lines |
|
to #49098
|
|
fix typos in various places
|
|
Fix a typo in the documentation of RangeInclusive
|
|
Add doc for impl From for Waker
As part of issue #51430 (cc @skade).
The impl is very simple, so not sure if we need to go into any details.
|
|
|
|
|
|
Sometimes it *is* initialized!
|
|
|
|
It's already stable in 2018; this finishes the stabilization.
|
|
Stabilize slice::chunks_exact(), chunks_exact_mut(), rchunks(), rchunks_mut(), rchunks_exact(), rchunks_exact_mut()
Fixes #47115, #55177
|
|
Custom E0277 diagnostic for `Path`
r? @nikomatsakis we have a way to target `Path` exclusively, we need to identify the correct text to show to consider #23286 fixed.
|
|
Fixes #55177
|
|
Fixes #47115
|
|
Add slice::rchunks(), rchunks_mut(), rchunks_exact() and rchunks_exact_mut()
These work exactly like the normal chunks iterators but start creating
chunks from the end of the slice.
----
The new iterators were motivated by a [comment](https://github.com/rust-lang/rust/issues/47115#issuecomment-424141121) by @DutchGhost.
~~~This currently includes the commits from https://github.com/rust-lang/rust/pull/54537 to not have to rename things twice or have merge conflicts. I'll force-push a new version of the branch ones those are in master.~~~
Also the stabilization tracking issue is just some number right now. I'll create the corresponding issue once this is reviewed and otherwise mergeable.
cc @DutchGhost
|
|
These work exactly like the normal chunks iterators but start creating
chunks from the end of the slice.
See #55177 for the tracking issue
|
|
Add filtering option to `rustc_on_unimplemented` and reword `Iterator` E0277 errors
- Add more targetting filters for arrays to `rustc_on_unimplemented` (Fix #53766)
- Detect one element array of `Range` type, which is potentially a typo:
`for _ in [0..10] {}` where iterating between `0` and `10` was intended.
(Fix #23141)
- Suggest `.bytes()` and `.chars()` for `String`.
- Suggest borrowing or `.iter()` on arrays (Fix #36391)
- Suggest using range literal when iterating on integers (Fix #34353)
- Do not suggest `.iter()` by default (Fix #50773, fix #46806)
- Add regression test (Fix #22872)
|
|
|
|
|
|
clarify pointer add/sub function safety concerns
Ralf Jung made the same changes to the offset functions' documentation
in commit fb089156. As add/sub just call offset, the same limitation
applies here, as well.
I did not copy the whole explanation ("In particular, the resulting pointer may *not* be used to access a different allocated object [...]") because I'd consider that as being too repetitive. The documentation of add/sub already refers to the offset function, so people interested in the details can look it up, there.
But changing 'an object' to 'the same object' is a small change which improves clarity a lot.
|
|
doc: make core::fmt::Error example more simple
|
|
During review of the previous commit, @joshtriplett noticed that
the emphasis on 'the same' is unnecessary. For consistency, remove it
on the offset() functions, as well.
|
|
Ralf Jung made the same changes to the offset functions' documentation
in commit fb089156. As add/sub just call offset, the same limitation
applies here, as well.
Removed emphasis on review request by @joshtriplett
|
|
|
|
Closes: #55044
This change could result in performance regression on non-x86 platforms. Alternative would be to update `transmute_copy` with alignment requirements.
|
|
|
|
Simplify implementation of align_offset slightly
|
|
|
|
- reword messages
- apply custom comments to all types of ranges
- fix indentation
|
|
|
|
Fixes #47311.
r? @nrc
|
|
LocalWaker and Waker cleanups
r? @aturon
|
|
|
|
- Detect one element array of `Range` type, which is potentially a typo:
`for _ in [0..10] {}` where iterating between `0` and `10` was intended.
(#23141)
- Suggest `.bytes()` and `.chars()` for `String`.
- Suggest borrowing or `.iter()` on arrays (#36391)
- Suggest using range literal when iterating on integers (#34353)
- Do not suggest `.iter()` by default (#50773, #46806)
|
|
|
|
|
|
Clarify docs for when binary_search has many matches.
Fixes https://github.com/rust-lang/rust/issues/51817.
|
|
Fixes https://github.com/rust-lang/rust/issues/51817.
|
|
|
|
|
|
|
|
I took the definition of what a total order is from the Ord trait
docs. I specifically put "elements of the slice" because if you
have a slice of f64s, but know none are NaN, then sorting by
partial ord is total in this case. I'm not sure if I should give
such an example in the docs or not.
|
|
std: Start implementing wasm32 atomics
This commit is an initial start at implementing the standard library for
wasm32-unknown-unknown with the experimental `atomics` feature enabled. None of
these changes will be visible to users of the wasm32-unknown-unknown target
because they all require recompiling the standard library. The hope with this is
that we can get this support into the standard library and start iterating on it
in-tree to enable experimentation.
Currently there's a few components in this PR:
* Atomic fences are disabled on wasm as there's no corresponding atomic op and
it's not clear yet what the convention should be, but this will change in the
future!
* Implementations of `Mutex`, `Condvar`, and `RwLock` were all added based on
the atomic intrinsics that wasm has.
* The `ReentrantMutex` and thread-local-storage implementations panic currently
as there's no great way to get a handle on the current thread's "id" yet.
Right now the wasm32 target with atomics is unfortunately pretty unusable,
requiring a lot of manual things here and there to actually get it operational.
This will likely continue to evolve as the story for atomics and wasm unfolds,
but we also need more LLVM support for some operations like custom `global`
directives for this to work best.
|
|
|
|
Use impl_header_lifetime_elision in libcore
The feature is approved for stabilization, so let's use it to remove about 300 `'a`s.
Tracking issue for the feature: https://github.com/rust-lang/rust/issues/15872
|
|
|
|
Document that slices cannot be larger than `isize::MAX` bytes
Fixes #53676.
|
|
|
|
Make core::mem::needs_drop a const fn
This fixes #51929.
|
|
|
|
|