about summary refs log tree commit diff
path: root/tests/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-17 08:43:13 +0000
committerbors <bors@rust-lang.org>2024-01-17 08:43:13 +0000
commitf4fec4ff65c946f26046a2b6be42ffafbffc0dd5 (patch)
tree87dff2a1186af371c0677b8e649797921dba0ae5 /tests/debuginfo/enum-thinlto.rs
parent03336460fcb25a86675aaff9694998f5910ff747 (diff)
parent920e99aacb917ad0608b0520661baae785aa0ae6 (diff)
downloadrust-f4fec4ff65c946f26046a2b6be42ffafbffc0dd5.tar.gz
rust-f4fec4ff65c946f26046a2b6be42ffafbffc0dd5.zip
Auto merge of #16378 - roife:fix/issue-15470, r=Veykril
fix: better handling of SelfParam in assist 'inline_call'

fix #15470.

The current `inline_call` directly translates `&self` into `let ref this = ...;` and `&mut self` into `let ref mut this = ...;`. However, it does not handle some complex scenarios.

This PR addresses the following transformations (assuming the receiving object is `obj`):

- `self`: `let this = obj`
- `mut self`: `let mut this = obj`
- `&self`: `let this = &obj`
- `&mut self`
  + If `obj` is `let mut obj = ...`, use a mutable reference: `let this = &mut obj`
  + If `obj` is `let obj = &mut ...;`, perform a reborrow: `let this = &mut *obj`
Diffstat (limited to 'tests/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions