rust/src/test/ui/single-use-lifetime
Tyler Mandry 9175247e72
Rollup merge of #65112 - jack-t:type-parens-lint, r=varkor
Add lint and tests for unnecessary parens around types

This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way.

The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` — I'm not totally sure it worked right, though — and I've tried to follow the instructions linked in the readme.

I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something.

There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
2019-11-01 11:20:07 -07:00
..
fn-types.rs Remove licenses 2018-12-25 21:08:33 -07:00
fn-types.stderr Update tests 2019-03-11 23:10:26 +03:00
one-use-in-fn-argument-in-band.fixed Remove licenses 2018-12-25 21:08:33 -07:00
one-use-in-fn-argument-in-band.rs Remove licenses 2018-12-25 21:08:33 -07:00
one-use-in-fn-argument-in-band.stderr Remove licenses 2018-12-25 21:08:33 -07:00
one-use-in-fn-argument.rs in which we suggest anonymizing single-use lifetimes in paths 2019-07-06 15:04:18 -07:00
one-use-in-fn-argument.stderr Increase spacing for suggestions in diagnostics 2019-10-24 12:26:01 -07:00
one-use-in-fn-return.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
one-use-in-inherent-impl-header.rs Remove licenses 2018-12-25 21:08:33 -07:00
one-use-in-inherent-impl-header.stderr Update tests 2019-03-11 23:10:26 +03:00
one-use-in-inherent-method-argument.rs Remove licenses 2018-12-25 21:08:33 -07:00
one-use-in-inherent-method-argument.stderr Update tests 2019-03-11 23:10:26 +03:00
one-use-in-inherent-method-return.rs Remove licenses 2018-12-25 21:08:33 -07:00
one-use-in-inherent-method-return.stderr Update tests 2019-03-11 23:10:26 +03:00
one-use-in-struct.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
one-use-in-trait-method-argument.rs Remove licenses 2018-12-25 21:08:33 -07:00
one-use-in-trait-method-argument.stderr Update tests 2019-03-11 23:10:26 +03:00
two-uses-in-fn-argument-and-return.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
two-uses-in-fn-arguments.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
two-uses-in-inherent-impl-header.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
two-uses-in-inherent-method-argument-and-return.rs Remove licenses 2018-12-25 21:08:33 -07:00
two-uses-in-inherent-method-argument-and-return.stderr Update tests 2019-03-11 23:10:26 +03:00
two-uses-in-trait-impl.rs Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
zero-uses-in-fn.fixed Add lint for unnecessary parens around types 2019-10-29 18:11:12 +00:00
zero-uses-in-fn.rs Add lint for unnecessary parens around types 2019-10-29 18:11:12 +00:00
zero-uses-in-fn.stderr Add lint for unnecessary parens around types 2019-10-29 18:11:12 +00:00
zero-uses-in-impl.rs structured suggestions for unused-lifetimes lint 2018-10-07 19:17:39 -07:00
zero-uses-in-impl.stderr Update tests 2019-03-11 23:10:26 +03:00