about summary refs log tree commit diff
path: root/tests/incremental/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-18 15:57:37 +0000
committerbors <bors@rust-lang.org>2022-08-18 15:57:37 +0000
commitc419d0a8b538de6000226cc54a2f18a03bbd31d6 (patch)
treeb7fd53474938b37734582ac023fbaad386a27d35 /tests/incremental/thinlto
parent849c1c0465426339f42e8491e861ad0473b9a062 (diff)
parent032f112745d2632fc37175fad7bab98215062586 (diff)
downloadrust-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/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions