diff options
| author | bors <bors@rust-lang.org> | 2023-06-04 17:53:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-06-04 17:53:54 +0000 |
| commit | 488693721271772cf9d551b4d54de3020b937a54 (patch) | |
| tree | 4bf22852f91b460e6a99c286a14eaaf5598422c4 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff | |
| parent | 58befc7de8652ad68c6ebbe2150b9ee619064cbd (diff) | |
| parent | b2c85b31bbe9dfd841c5d4999ac79cd431489101 (diff) | |
| download | rust-488693721271772cf9d551b4d54de3020b937a54.tar.gz rust-488693721271772cf9d551b4d54de3020b937a54.zip | |
Auto merge of #10853 - MarcusGrass:fix-from-over-into-self, r=Alexendoo
Ignore fix for `from_over_into` if the target type contains a `Self` reference Fixes https://github.com/rust-lang/rust-clippy/issues/10838. This is my first time contributing here, and the fix is kind of ugly. I've worked a bit with `quote` and was trying to figure out a way to replace the type in a better way than just a raw string-replace but couldn't quite figure out how to. The only thing really required to fix this, is to replace all `Self` references with the type stated in the `from` variable, this isn't entirely simple to do with raw strings without creating a mess though. We need to find and replace all `Self`'s in a variable with `from` but there could be an arbitrary amount, in a lot of different positions. As well as some type that contains the name self, like `SelfVarSelf` which shouldn't be replaced. The strategy is essentially, if `"Self"` is surrounded on both sides by something that isn't alphanumeric, then we're golden, then trying to make that reasonably efficient. I would not be offended if the solution is too messy to accept! changelog: [from_over_into]: Replace Self with the indicated variable in suggestion and fix.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions
