Skip to content

ptr_arg wrongly suggested for &String when using clone_from #8361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SUPERCILEX opened this issue Jan 27, 2022 · 2 comments
Closed

ptr_arg wrongly suggested for &String when using clone_from #8361

SUPERCILEX opened this issue Jan 27, 2022 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@SUPERCILEX
Copy link

SUPERCILEX commented Jan 27, 2022

Lint Name

ptr_arg

Reproducer

fn foo(bar: &String) {
    let mut s = "blah blah".to_string();
    s.clone_from(bar);
}

Version

rustc 1.60.0-nightly (1bd4fdc94 2022-01-12)
binary: rustc
commit-hash: 1bd4fdc943513e1004f498bbf289279c9784fc6f
commit-date: 2022-01-12
host: x86_64-unknown-linux-gnu
release: 1.60.0-nightly
LLVM version: 13.0.0
@SUPERCILEX SUPERCILEX added C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have labels Jan 27, 2022
@Jarcho
Copy link
Contributor

Jarcho commented Jan 28, 2022

Fixed in #8271

@SUPERCILEX
Copy link
Author

Sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

No branches or pull requests

2 participants