about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-04 00:43:00 +0000
committerbors <bors@rust-lang.org>2020-12-04 00:43:00 +0000
commit7f22b1c58a0b2d5051c45283a88ea101d66e75ef (patch)
treee2728ea2ddb8c10755e8b868f9b4bc50a80bb25b /compiler/rustc_mir/src/transform/coverage/mod.rs
parent249b6fee9120efb6d6bb8f559524c478b2ab4b74 (diff)
parentc1a5329475d041dbeb077ecda6ae71f690b4bcc1 (diff)
downloadrust-7f22b1c58a0b2d5051c45283a88ea101d66e75ef.tar.gz
rust-7f22b1c58a0b2d5051c45283a88ea101d66e75ef.zip
Auto merge of #6394 - nico-abram:unsafe_sizeof_count_copies, r=ebroto
Add lint size_of_in_element_count

Fixes #6381
changelog: Add lint to check for using size_of::<T> or size_of_val::<T> in the count parameter to ptr::copy or ptr::copy_nonoverlapping, which take a count of Ts (And not a count of bytes)

- \[X] Followed [lint naming conventions][lint_naming]
- \[X] Added passing UI tests (including committed `.stderr` file)
- \[ ] `cargo test` passes locally
- \[X] Executed `cargo dev update_lints`
- \[X] Added lint documentation
- \[X] Run `cargo dev fmt`

[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints

Running `cargo test` locally fails with this error:

```
running 1 test
test fmt ... FAILED

failures:

---- fmt stdout ----
status: exit code: 1
stdout:
stderr: error: unable to unlink old fallback exe
error: caused by: Access is denied. (os error 5)

thread 'fmt' panicked at 'Formatting check failed. Run `cargo dev fmt` to update formatting.', tests\fmt.rs:32:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    fmt

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
```

But I did run `cargo dev fmt`
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions