about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-28 12:08:55 +0000
committerbors <bors@rust-lang.org>2024-06-28 12:08:55 +0000
commitfde55648116f75eb44340047d48a191d0660a403 (patch)
tree3c449d86b40895399bade423c35fce879ada3486 /tests/codegen/patchable-function-entry/patchable-function-entry-both-flags.rs
parentaf8575e17f9735b32485e383859beb8a9449d1de (diff)
parent4b7fb6a3db50f06d78b26a1f1a9bb56cc307f3f1 (diff)
downloadrust-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