rust/compiler/rustc_codegen_ssa/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
..
back Fix tests 2021-03-03 11:22:44 +01:00
coverageinfo remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
debuginfo Stop adding '*' at the end of type names for Ref and Slice when computing debug info for MSVC debuggers 2020-11-30 14:31:34 -08:00
mir Rollup merge of #82091 - henryboisdequin:use-place-ref-more, r=RalfJung 2021-02-23 02:51:50 +01:00
traits cg_ssa: introduce TargetMachineFactoryFn alias 2020-12-16 10:33:43 +00:00
base.rs Use a QueryContext for try_mark_green. 2021-02-19 17:51:56 +01:00
common.rs Support LLVM 12 in rustc 2021-02-28 10:19:44 +01:00
glue.rs Change ty.kind to a method 2020-09-04 17:47:51 +02:00
lib.rs Don't provide backend_optimization_level query for extern crates 2021-01-23 11:11:51 +01:00
meth.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
mono_item.rs Use an ItemId inside mir::GlobalAsm. 2021-02-15 19:24:58 +01:00
target_features.rs Rollup merge of #78361 - DevJPM:master, r=workingjubilee 2020-11-18 15:46:19 +01:00