diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-11-17 21:26:15 +0200 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2024-11-25 10:04:06 +0200 |
| commit | 4a230bba746bafb0c152ee08a759990e6ed6a008 (patch) | |
| tree | c2121a72704f1b6c340871525993989e75167db2 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 46e8d20301cb4abe91ab0a4bea43bb085e1d4e4a (diff) | |
| download | rust-4a230bba746bafb0c152ee08a759990e6ed6a008.tar.gz rust-4a230bba746bafb0c152ee08a759990e6ed6a008.zip | |
Support ranges in `<[T]>::get_many_mut()`
I implemented that with a separate trait and not within `SliceIndex`, because doing that via `SliceIndex` requires adding support for range types that are (almost) always overlapping e.g. `RangeFrom`, and also adding fake support code for `impl SliceIndex<str>`. An inconvenience that I ran into was that slice indexing takes the index by value, but I only have it by reference. I could change slice indexing to take by ref, but this is pretty much the hottest code ever so I'm afraid to touch it. Instead I added a requirement for `Clone` (which all index types implement anyway) and cloned. This is an internal requirement the user won't see and the clone should always be optimized away. I also implemented `Clone`, `PartialEq` and `Eq` for the error type, since I noticed it does not do that when writing the tests and other errors in std seem to implement them. I didn't implement `Copy` because maybe we will want to put something non-`Copy` there.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
