Skip to content

fix: ref match uses unified type#22285

Merged
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:refmatch-could-unify
May 6, 2026
Merged

fix: ref match uses unified type#22285
ChayimFriedman2 merged 1 commit intorust-lang:masterfrom
A4-Tacks:refmatch-could-unify

Conversation

@A4-Tacks
Copy link
Copy Markdown
Member

@A4-Tacks A4-Tacks commented May 4, 2026

Example

struct S<T>(T);
fn foo<T>(s: &mut S<T>) {}
fn main() {
    let mut ssss = S(2u32);
    foo($0);
}

Before this PR

st S(…) S(T) []
st &mut S(…) [type]
lc ssss S<u32> [local]

After this PR

st S(…) S(T) []
st &mut S(…) [type]
lc ssss S<u32> [local]
lc &mut ssss [type+local]

Example
---
```rust
struct S<T>(T);
fn foo<T>(s: &mut S<T>) {}
fn main() {
    let mut ssss = S(2u32);
    foo($0);
}
```

**Before this PR**

```text
st S(…) S(T) []
st &mut S(…) [type]
lc ssss S<u32> [local]
```

**After this PR**

```text
st S(…) S(T) []
st &mut S(…) [type]
lc ssss S<u32> [local]
lc &mut ssss [type+local]
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 4, 2026
@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue May 6, 2026
Merged via the queue into rust-lang:master with commit 43e333a May 6, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2026
@A4-Tacks A4-Tacks deleted the refmatch-could-unify branch May 6, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants