diff options
| author | bors <bors@rust-lang.org> | 2024-09-18 20:01:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-09-18 20:01:38 +0000 |
| commit | 627ccda3e56fad5e10138d3fad9fbbe0d504e870 (patch) | |
| tree | 78d9e4611c40dd39702836e0128184ff093965be /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs | |
| parent | ee38991676679140d37bc9ecb1532683a7e9cff6 (diff) | |
| parent | 59e30080a0baccb10e5ece0e5392cb94289ddc4b (diff) | |
| download | rust-627ccda3e56fad5e10138d3fad9fbbe0d504e870.tar.gz rust-627ccda3e56fad5e10138d3fad9fbbe0d504e870.zip | |
Auto merge of #18139 - ShoyuVanilla:issue-18109, r=Veykril
fix: Extend `type_variable_table` when modifying index is larger than the table size Fixes #18109 Whenever we create an inference variable in r-a, we extend `type_variable_table` to matching size here; https://github.com/rust-lang/rust-analyzer/blob/f4aca78c92e03354327c8f6c7fefaef9f45ab166/crates/hir-ty/src/infer/unify.rs#L378-L381 But sometimes, an inference variable is [created from chalk](https://github.com/rust-lang/chalk/blob/ab710e0c9b455403b138ef72a2fb90967a58eff3/chalk-solve/src/infer/unify.rs#L743) and passed to r-a as a type of an expression or a pattern. If r-a set diverging flag to this before the table is extended to a sufficient size, it panics here; https://github.com/rust-lang/rust-analyzer/blob/f4aca78c92e03354327c8f6c7fefaef9f45ab166/crates/hir-ty/src/infer/unify.rs#L275-L277 I think that extending table when setting diverging flag is reasonable becase we are already doing such extending to a size that covers the inference vars created from chalk and this change only covers the order-dependent random cases that this might fail
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha256.rs')
0 files changed, 0 insertions, 0 deletions
