Fix typo in inherent_to_string documentation
A simple typo fix in `inherent_to_string` and `inherent_to_string_shadow_display` documentation
changelog: none
account for doc visibility
This fixes#4608.
Also I noticed that the lint failed to look at trait and impl items. There's a small bit of fallout in the code, too, but not enough to warrant its own commit.
changelog: check docs of trait items and impl items, also make `missing_safety_doc` account for visibility
Add check for assert_eq macros to unit_cmp lint
changelog: Add check for unit comparisons through `assert_eq!`, `debug_assert_eq!`, `assert_ne!` and `debug_assert_ne!` macros to unit_cmp lint.
fixes#4481
Use windows-sdk-10.1 to avoid installation failure
This fixes installation failure on Windows on Travis but we need to fix rustfmt issue first to pass the CI completely.
changelog: none
Rollup of 2 pull requests
Successful merges:
- #4509 (Fix false-positive of redundant_clone and move to clippy::perf)
- #4614 (Allow casts from the result of `abs` to unsigned)
Failed merges:
changelog: none
r? @ghost
Fix false-positive of redundant_clone and move to clippy::perf
This PR introduces dataflow analysis to `redundant_clone` lint to filter out borrowed variables, which had been incorrectly detected.
Depends on https://github.com/rust-lang/rust/pull/64207.
changelog: Moved `redundant_clone` lint to `perf` group
# What this lint catches
## `clone`/`to_owned`
```rust
let s = String::new();
let t = s.clone();
```
```rust
// MIR
_1 = String::new();
_2 = &_1;
_3 = clone(_2); // (*)
```
We can turn this `clone` call into a move if
1. `_2` is the sole borrow of `_1` at the statement `(*)`
2. `_1` is not used hereafter
## `Deref` + type-specific `to_owned` method
```rust
let s = std::path::PathBuf::new();
let t = s.to_path_buf();
```
```rust
// MIR
_1 = PathBuf::new();
_2 = &1;
_3 = call deref(_2);
_4 = _3; // Copies borrow
StorageDead(_2);
_5 = Path::to_path_buf(_4); // (*)
```
We can turn this `to_path_buf` call into a move if
1. `_3` `_4` are the sole borrow of `_1` at `(*)`
2. `_1` is not used hereafter
# What this PR introduces
1. `MaybeStorageLive` that determines whether a local lives at a particular location
2. `PossibleBorrowerVisitor` that constructs [`TransitiveRelation`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/transitive_relation/struct.TransitiveRelation.html) of possible borrows, e.g. visiting `_2 = &1; _3 = &_2:` will result in `_3 -> _2 -> _1` relation. Then `_3` and `_2` will be counted as possible borrowers of `_1` in the sole-borrow analysis above.