diff options
| author | bors <bors@rust-lang.org> | 2022-08-18 15:57:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-18 15:57:37 +0000 |
| commit | c419d0a8b538de6000226cc54a2f18a03bbd31d6 (patch) | |
| tree | b7fd53474938b37734582ac023fbaad386a27d35 /tests/debuginfo/enum-thinlto.rs | |
| parent | 849c1c0465426339f42e8491e861ad0473b9a062 (diff) | |
| parent | 032f112745d2632fc37175fad7bab98215062586 (diff) | |
| download | rust-c419d0a8b538de6000226cc54a2f18a03bbd31d6.tar.gz rust-c419d0a8b538de6000226cc54a2f18a03bbd31d6.zip | |
Auto merge of #9136 - smoelius:enhance-needless-borrow, r=Jarcho
Enhance `needless_borrow` to consider trait implementations
The proposed enhancement causes `needless_borrow` to suggest removing `&` from `&e` when `&e` is an argument position requiring trait implementations, and `e` implements the required traits. Example:
```
error: the borrowed expression implements the required traits
--> $DIR/needless_borrow.rs:131:51
|
LL | let _ = std::process::Command::new("ls").args(&["-a", "-l"]).status().unwrap();
| ^^^^^^^^^^^^^ help: change this to: `["-a", "-l"]`
```
r? `@Jarcho`
changelog: Enhance `needless_borrow` to consider trait implementations
Diffstat (limited to 'tests/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions
