Skip to content

fix: ref match uses unified type#22285

Open
A4-Tacks wants to merge 1 commit intorust-lang:masterfrom
A4-Tacks:refmatch-could-unify
Open

fix: ref match uses unified type#22285
A4-Tacks wants to merge 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants