about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-26 12:03:40 -0500
committerGitHub <noreply@github.com>2024-11-26 12:03:40 -0500
commit42459a7971be2d35f2b08c473ffb909cdc6427d2 (patch)
tree514fb2e27868eabc90548f3b86e4a12e812a9fef /compiler/rustc_codegen_llvm/src/errors.rs
parent9d6a11a435b5bcafc9225c2578ffbab1afcba198 (diff)
parent4a230bba746bafb0c152ee08a759990e6ed6a008 (diff)
downloadrust-42459a7971be2d35f2b08c473ffb909cdc6427d2.tar.gz
rust-42459a7971be2d35f2b08c473ffb909cdc6427d2.zip
Rollup merge of #133136 - ChayimFriedman2:get-many-mut, r=Amanieu
Support ranges in `<[T]>::get_many_mut()`

As per T-libs-api decision in #104642.

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_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions