rust-clippy/tests
Philipp Krones 1e1bd519a1
Rollup merge of #5410 - dtolnay:trivially, r=flip1995
Downgrade trivially_copy_pass_by_ref to pedantic

The rationale for this lint is documented as:

> In many calling conventions instances of structs will be passed through registers if they fit into two or less general purpose registers.

I think the purported performance benefits of clippy's recommendation are overstated. This isn't worth asking people to sprinkle code with more `*`​`*`​`&`​`*`​`&` to chase the alleged performance.

This should be a pedantic lint that is disabled by default and opted in if some specific performance sensitive codebase determines that it is worthwhile.

As a reminder, a typical place that a reference to a primitive would come up is if the function is used as a filter. Triggering a performance-oriented lint on this type of code is the definition of pedantic.

```rust
fn filter(_n: &i32) -> bool {
    true
}

fn main() {
    let v = vec![1, 2, 3];
    v.iter().copied().filter(filter).for_each(drop);
}
```

```console
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
 --> src/main.rs:1:15
  |
1 | fn filter(_n: &i32) -> bool {
  |               ^^^^ help: consider passing by value instead: `i32`
```

changelog: Remove trivially_copy_pass_by_ref from default set of enabled lints
2020-04-08 15:50:17 +02:00
..
auxiliary Remove all copyright license headers 2019-01-08 21:46:39 +01:00
cargo Use current_dir instead of cargo_metadata 2020-02-10 16:42:50 +01:00
ui Rollup merge of #5410 - dtolnay:trivially, r=flip1995 2020-04-08 15:50:17 +02:00
ui-toml Downgrade trivially_copy_pass_by_ref to pedantic 2020-04-02 18:56:10 -07:00
compile-test.rs Fix error E0460 when compiled on Rustc repo 2020-02-09 19:02:27 +07:00
dogfood.rs Fix error E0460 when compiled on Rustc repo 2020-02-09 19:02:27 +07:00
fmt.rs Apply review comments 2020-02-12 09:34:28 +01:00
integration.rs Don't convert Path to lossy str 2020-03-14 22:20:16 +07:00
missing-test-files.rs cargo fmt 2019-06-21 16:47:34 +02:00
versioncheck.rs test(versioncheck): Use .no_deps() 2019-01-25 21:53:44 +01:00