diff options
| author | bors <bors@rust-lang.org> | 2024-06-25 00:33:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-25 00:33:49 +0000 |
| commit | 5b270e1198e911247244b035a6f06ce3af0a4420 (patch) | |
| tree | 6da7ddb4ae9c38d180f69bb3f275cc4be5207bd2 /tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs | |
| parent | 6b0f4b5ec3aa707ecaa78230722117324a4ce23c (diff) | |
| parent | d521e2148e534a98f2dd2136f4ebb3d36e691056 (diff) | |
| download | rust-5b270e1198e911247244b035a6f06ce3af0a4420.tar.gz rust-5b270e1198e911247244b035a6f06ce3af0a4420.zip | |
Auto merge of #126813 - compiler-errors:SliceLike, r=lcnr
Add `SliceLike` to `rustc_type_ir`, use it in the generic solver code (+ some other changes) First, we split out `TraitRef::new_from_args` which takes *just* `ty::GenericArgsRef` from `TraitRef::new` which takes `impl IntoIterator<Item: Into<GenericArg>>`. I will explain in a minute why. Second, we introduce `SliceLike`, which allows us to be generic over `List<T>` and `[T]`. This trait has an `as_slice()` and `into_iter()` method, and some other convenience functions. However, importantly, since types like `I::GenericArgs` now implement `SliceLike` rather than `IntoIter<Item = I::GenericArg>`, we can't use `TraitRef::new` on this directly. That's where `new_from_args` comes in. Finally, we adjust all the code to use these slice operators. Some things get simpler, some things get a bit more annoying since we need to use `as_slice()` in a few places. 🤷 r? lcnr
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs')
0 files changed, 0 insertions, 0 deletions
