bors [Wed, 6 Mar 2019 06:48:26 +0000 (06:48 +0000)]
Auto merge of #3845 - euclio:unused-comments, r=phansch
move lint documentation into macro invocations
This PR moves lint documentation inside `declare_clippy_lint!` macro invocations, to avoid triggering the `unused_doc_comments` lint once it's modified in rust-lang/rust#57882. This PR is necessary to unblock that work, since the large number of warnings generated in `clippy_lints` causes Travis to hit the log length limit.
This PR also updates the documentation and website generation script.
It would be nice to get a clippy update in the Rust repo once this is merged.
bors [Thu, 28 Feb 2019 19:56:25 +0000 (19:56 +0000)]
Auto merge of #3831 - martin-t:master, r=flip1995
Use the same <title> as <h1> on gh-pages
I think this makes the page easier to find using firefox's URL bar - it (afaik) searches based on the page's URL and title so if somebody doesn't have it bookmarked but remembers that the page contained "ALL lints" or something similar it's easy to go to it directly without resorting to a search engine.
bors [Thu, 28 Feb 2019 19:20:06 +0000 (19:20 +0000)]
Auto merge of #3830 - flip1995:unknown_attribute, r=oli-obk
Error on unknown or deprecated attributes
The reason I decided to not make this a lint is, that unknown attributes are always a hard error in rustc and also in rustfmt, which cannot be turned off by an `allow`. This could have been done by introducing a category which would be forbid-by-default. But that would have introduced a new lint category+group for just one lint and also wouldn't be consistent with rustfmt and rustc.
bors [Tue, 26 Feb 2019 15:51:40 +0000 (15:51 +0000)]
Auto merge of #3817 - rust-lang:fix-bool_comparison-on-non-bool, r=oli-obk
Fix `bool_comparison` with non-`bool` expressions
Fixes #3703.
It just moves around the type check that was already there for some comparison to all of them, because if one type isn't `bool`, none of those comparison can be simplified.
bors [Tue, 26 Feb 2019 10:43:50 +0000 (10:43 +0000)]
Auto merge of #3814 - ljedrz:HirIdification_lockstep_upgrade, r=phansch
HirIdify some lints
Unblocks https://github.com/rust-lang/rust/pull/58561 (a part of [rust-lang/rust#57578](https://github.com/rust-lang/rust/pull/57578)). Can we branch it like with https://github.com/rust-lang/rust-clippy/pull/3790? I can rebase on a different commit if need be.
Haven't had time to run tests yet, so I'd wait for Travis 🙈.
bors [Mon, 25 Feb 2019 12:30:35 +0000 (12:30 +0000)]
Auto merge of #3772 - flip1995:ice-3719, r=Manishearth
Fix ICE #3719+#3718 in lint match_ref_pats
Fixes #3719
This conveniently also fixes #3718
The ICE occurs when the match expression was a macro call, where the macro was defined in another file. Since we don't have the ability to reproduce this behavior with our UI tests (AFAIK), I couldn't add a test reproducing this ICE.. However, I added a test which is related to the ICE, to show the new behavior of the lint.
I tested it with the mscheme repo locally and the ICE didn't happen anymore.
bors [Mon, 25 Feb 2019 12:08:43 +0000 (12:08 +0000)]
Auto merge of #3805 - martinsp:ice-3747, r=Manishearth
Fix ICE #3747
I'm not sure if this was the correct approach.
I don't know if I put tests/ui/crashses/ice-3747.rs in correct place because the test always passed when I ran it with `cargo test`, even without the fix applied.
If I run that test with `env CLIPPY_TESTS=true cargo run --bin clippy-driver -- -L ./target/debug tests/ui/crashes/ice-3747.rs` then the test correctly fails without the fix applied
bors [Fri, 22 Feb 2019 09:18:21 +0000 (09:18 +0000)]
Auto merge of #3796 - rust-lang:clarify-readme, r=oli-obk
Clarify lint groups in readme
I'm explicitly avoiding mention of the deprecated/restriction lint groups, those exist more for testing purposes and are not really something people should be using.
Michael Wright [Fri, 22 Feb 2019 05:49:17 +0000 (07:49 +0200)]
Add `#[rustfmt::skip]` to methods tests
Many people run rustfmt automatically on save. Format-dependent tests
should be marked with `#[rustfmt::skip]` to prevent accidental
reformatting from this. As a bonus the rest of the code can the formatted.
bors [Wed, 20 Feb 2019 16:37:32 +0000 (16:37 +0000)]
Auto merge of #3781 - uniphil:write_with_newline_false_positive, r=oli-obk
Don't check [print/write]_with_newline on raw strings
Some tests for #3778 and some maybe-not-the-greatest code that passes those tests!
I didn't run `fmt` because a) it doesn't seem to install on nightly for me, and b) on stable it wanted to apply formatting to over 90 files. Happy to make any tweaks though!
I suspect this contribution may require more than just tweaks. I'm still sort of new to rust so it may not be idiomatic, and the specific approach I took feels a little heavy-handed and brittle. I'm happy to make changes with some guidance, or equally happy if this gives a starting place for someone else to do it better :)
flip1995 [Sat, 16 Feb 2019 18:37:58 +0000 (19:37 +0100)]
Add test related to the ICE
This test doesn't reproduce the ICE since it only happens, when the macro is defined in another file.
Currently we can't add tests with multiple files AFAIK
bors [Tue, 19 Feb 2019 09:46:29 +0000 (09:46 +0000)]
Auto merge of #3776 - notriddle:drop-bounds, r=oli-obk
Add a lint to warn on `T: Drop` bounds
**What it does:** Checks for generics with `std::ops::Drop` as bounds.
**Why is this bad?** `Drop` bounds do not really accomplish anything.
A type may have compiler-generated drop glue without implementing the
`Drop` trait itself. The `Drop` trait also only has one method,
`Drop::drop`, and that function is by fiat not callable in user code.
So there is really no use case for using `Drop` in trait bounds.
phil [Mon, 18 Feb 2019 16:39:23 +0000 (11:39 -0500)]
Check {print,write}_with_newline for literal newline
Both regular strings and raw strings can contain literal newlines. This commit
extends the lint to also warn about terminating strings with these.
Behaviour handling for raw strings is also moved into `check_newlines` by
passing in the `is_raw` boolean from `check_tts` as
[suggested](https://github.com/rust-lang/rust-clippy/pull/3781#pullrequestreview-204663732)