about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-22 12:50:08 +0000
committerbors <bors@rust-lang.org>2022-11-22 12:50:08 +0000
commit94ce4465e5746bd3ef4d60a16c5aba1e8f0a5b80 (patch)
treec71a5ff5c3e69a917578753ef305f09574decdcf /library/std/src/sys/unix/stack_overflow.rs
parentf4083c5ae72f5f80bf19e881528c4d39b38db0e7 (diff)
parentf27ca5c00a96d2dbd1e2b5dceee918d829891bc1 (diff)
downloadrust-94ce4465e5746bd3ef4d60a16c5aba1e8f0a5b80.tar.gz
rust-94ce4465e5746bd3ef4d60a16c5aba1e8f0a5b80.zip
Auto merge of #9796 - smoelius:issue-9771, r=flip1995
Fix #9771 (`unnecessary_to_owned` false positive)

Fixes #9771

In that issue's example(s), the lint tried to add a `&` to a value, which implicitly changed the type of a field to a reference. The fix is to add the reference to `receiver_ty` (the type of the receiver of the `to_owned`-like method), before passing `receiver_ty` to `can_change_type`. `can_change_type` properly rejects the modified `receiver_ty`.

cc: `@mikerite` just because I think he was the author of `can_change_type`.

changelog: fix `unnecessary_to_owned` false positive which implicitly tried to change the type of a field to a reference
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions