about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorMara <m-ou.se@m-ou.se>2021-03-05 10:57:14 +0100
committerGitHub <noreply@github.com>2021-03-05 10:57:14 +0100
commite6a6df5daad01472e93f19802b0ce25f7a9b020c (patch)
treef2dac9a65dfa7eb1586bfc799dfba67c931a3776 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parenta0d66b54fb3acc2125972b88ff543a2c04d14af5 (diff)
parent25637b228d68e9bdf2d3ce1ba421cbd115fcb81e (diff)
downloadrust-e6a6df5daad01472e93f19802b0ce25f7a9b020c.tar.gz
rust-e6a6df5daad01472e93f19802b0ce25f7a9b020c.zip
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 ❤️.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions