diff options
| author | A4-Tacks <wdsjxhno1001@163.com> | 2025-09-20 17:04:56 +0800 |
|---|---|---|
| committer | A4-Tacks <wdsjxhno1001@163.com> | 2025-09-20 17:52:01 +0800 |
| commit | 8eda71b98a8540f848cfd33b58f6d284edb64073 (patch) | |
| tree | 8527e294f89728bb9a1419a05591341fe1aeb4e9 /compiler/rustc_llvm/llvm-wrapper | |
| parent | 300aee8239168bfd07114322654da9840d0a2331 (diff) | |
| download | rust-8eda71b98a8540f848cfd33b58f6d284edb64073.tar.gz rust-8eda71b98a8540f848cfd33b58f6d284edb64073.zip | |
Fix panic `!self.data().mutable` for destructure_struct_binding
When the reference type does not require adding a dereference or parentheses, it will panic
Example
---
```rust
struct Foo { bar: i32, baz: i32 }
fn main() {
let $0foo = &Foo { bar: 1, baz: 2 };
let _ = &foo.bar;
}
```
**Before this PR**:
Panic:
```
assertion failed: !self.data().mutable
```
**After this PR**:
```rust
struct Foo { bar: i32, baz: i32 }
fn main() {
let Foo { bar, baz } = &Foo { bar: 1, baz: 2 };
let _ = bar;
}
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper')
0 files changed, 0 insertions, 0 deletions
