diff options
| author | bors <bors@rust-lang.org> | 2024-06-28 12:08:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-28 12:08:55 +0000 |
| commit | fde55648116f75eb44340047d48a191d0660a403 (patch) | |
| tree | 3c449d86b40895399bade423c35fce879ada3486 /tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs | |
| parent | af8575e17f9735b32485e383859beb8a9449d1de (diff) | |
| parent | 4b7fb6a3db50f06d78b26a1f1a9bb56cc307f3f1 (diff) | |
| download | rust-fde55648116f75eb44340047d48a191d0660a403.tar.gz rust-fde55648116f75eb44340047d48a191d0660a403.zip | |
Auto merge of #17505 - ShoyuVanilla:issue-17199, r=Veykril
Use proper `ImplTraits` in `insert_inference_vars_for_impl_trait`
Fixes #17199 and fixes #17403
In the previous implementation, I passed `rpits` as a function parameter and used `idx` of `ImplTraitId` for indexing `ImplTrait`.
https://github.com/rust-lang/rust-analyzer/blob/4e836c622a7bdab41be8e82733dd9fe40af128b2/crates/hir-ty/src/infer.rs#L881-L887
But that `idx` is rather a "local" one, so in the cases like mentioned issues, the async function that can be expanded roughly as
```rust
type TypeAlias = impl Something;
fn expanded_async() -> impl Future<Output = TypeAlias> { ... }
```
there are two bundles of `ImplTraits`; one for the `impl Future` and the other one for `TypeAlias`.
So using `idx` with `rpits` returns `ImplTrait` for `impl Future` even if we are asking for `TypeAlias` and this caused a stack overflow.
This PR is a fix for that implementation miss 😅
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs')
0 files changed, 0 insertions, 0 deletions
