rust/tests
Ryan Cumming 58459abd0c Allow pass by reference if we return a reference
Currently this code will trigger `trivally_copy_pass_by_ref`:

```
struct OuterStruct {
    field: [u8; 8],
}

fn return_inner(outer: &OuterStruct) -> &[u8] {
    &outer.field
}
```

If we change the `outer` to be pass-by-value it will not live long
enough for us to return the reference. The above example is trivial but
I've hit this in real code that either returns a reference to either the
argument or in to `self`.

This suppresses the `trivally_copy_pass_by_ref` lint if we return a
reference and it has the same lifetime as the argument. This will likely
miss complex cases with multiple lifetimes bounded by each other but it
should cover the majority of cases with little effort.
2018-07-23 18:44:40 +10:00
..
auxiliary Remove all mention and testing of #[plugin(clippy)] and warn if used 2018-05-11 13:20:39 +02:00
run-pass Use utils::opt_def_id() instead of def_id() to prevent ICE 2018-06-25 22:25:15 +02:00
ui Allow pass by reference if we return a reference 2018-07-23 18:44:40 +10:00
ui-toml Allow configuring the trivial copy size limit 2018-06-15 16:53:34 +02:00
camel_case.rs fallout 2016-08-17 18:35:25 +02:00
compile-test.rs Formatting 2018-06-07 22:01:46 +02:00
dogfood.rs Re-enable dogfood test on Windows 2018-04-03 06:22:42 +02:00
matches.rs Format code 2018-03-16 10:54:49 +01:00
needless_continue_helpers.rs Format code 2018-03-16 10:54:49 +01:00
trim_multiline.rs run rustfmt 2016-12-20 10:20:41 +01:00
versioncheck.rs Format code 2018-05-22 10:21:42 +02:00
without_block_comments.rs Format code 2018-05-22 10:21:42 +02:00