rust/compiler/rustc_lint/src
Mara e6a6df5daa
Rollup merge of #80723 - rylev:noop-lint-pass, r=estebank
Implement NOOP_METHOD_CALL lint

Implements the beginnings of https://github.com/rust-lang/lang-team/issues/67 - a lint for detecting noop method calls (e.g, calling `<&T as Clone>::clone()` when `T: !Clone`).

This PR does not fully realize the vision and has a few limitations that need to be addressed either before merging or in subsequent PRs:
* [ ] No UFCS support
* [ ] The warning message is pretty plain
* [ ] Doesn't work for `ToOwned`

The implementation uses [`Instance::resolve`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/instance/struct.Instance.html#method.resolve) which is normally later in the compiler. It seems that there are some invariants that this function relies on that we try our best to respect. For instance, it expects substitutions to have happened, which haven't yet performed, but we check first for `needs_subst` to ensure we're dealing with a monomorphic type.

Thank you to ```@davidtwco,``` ```@Aaron1011,``` and ```@wesleywiser``` for helping me at various points through out this PR ❤️.
2021-03-05 10:57:14 +01:00
..
nonstandard_style
array_into_iter.rs
builtin.rs Combine HasAttrs and HasTokens into AstLike 2021-02-27 00:14:13 -05:00
context.rs Rename rustdoc lints to be a tool lint instead of built-in. 2021-03-01 19:29:15 -05:00
early.rs Combine HasAttrs and HasTokens into AstLike 2021-02-27 00:14:13 -05:00
internal.rs Box the biggest ast::ItemKind variants 2021-02-01 09:23:39 +01:00
late.rs Index Modules using their LocalDefId. 2021-02-15 19:32:30 +01:00
levels.rs Apply lint restrictions from renamed lints 2021-02-28 01:04:34 -05:00
lib.rs Rollup merge of #80723 - rylev:noop-lint-pass, r=estebank 2021-03-05 10:57:14 +01:00
methods.rs
non_ascii_idents.rs
non_fmt_panic.rs Rollup merge of #82456 - klensy:or-else, r=estebank 2021-02-26 15:52:31 +01:00
nonstandard_style.rs review comments 2021-01-30 22:06:10 -08:00
noop_method_call.rs Warn in doc test 2021-03-03 11:23:33 +01:00
passes.rs ast: Stop using Mod in Crate 2021-02-18 13:07:49 +03:00
redundant_semicolon.rs Lint on redundant trailing semicolon after item 2020-12-29 16:30:02 -05:00
traits.rs Only store a LocalDefId in hir::Item. 2021-02-15 19:32:10 +01:00
types.rs Rollup merge of #79981 - camelid:overflowing_literals-inference-error, r=lcnr 2021-02-17 20:37:48 +01:00
unused.rs Fix an old FIXME in redundant paren lint 2021-01-30 22:39:56 +03:00