483 Commits

Author SHA1 Message Date
memoryruins
05db5a2698 Report lint in external macros 2019-10-11 16:36:50 -04:00
Mark Rousskov
e068cec13e Warn if include macro fails to include entire file 2019-10-07 19:47:53 -04:00
gaolei
1ab5593f95 factor out pluralisation remains after #64280 2019-09-20 00:25:27 +08:00
Vadim Petrochenkov
f7434aef26 Support "soft" feature-gating using a lint
Use it for feature-gating `#[bench]`
2019-09-07 21:37:51 +03:00
Julien Cretin
6ec4584d84 Implement checks for meta-variables in macros 2019-07-19 19:59:12 +02:00
Samy Kacimi
e5e1397adb
normalize use of backticks in compiler messages for librustc/lint
https://github.com/rust-lang/rust/issues/60532
2019-07-17 22:49:48 +02:00
Felix S. Klock II
44d27ba28d Change indirect_structural_match lint to allow-by-default.
This is a way to address the regression aspect of rust-lang/rust#62614 in the
short term without actually fixing the bug. (My thinking is that the bug that
this lint detects has gone undetected for this long, it can wait a bit longer
until I or someone else has a chance to put in a proper fix that accounts for
rust-lang/rust#62614.)
2019-07-12 15:32:12 +02:00
bors
c6a9e766f9 Auto merge of #62339 - pnkfelix:issue-61188-use-visitor-for-structural-match-check, r=nikomatsakis
use visitor for #[structural_match] check

This changes the code so that we recur down the structure of a type of a const (rather than just inspecting at a shallow one or two levels) when we are looking to see if it has an ADT that did not derive `PartialEq` and `Eq`.

Fix #61188

Fix #62307

Cc #62336
2019-07-10 12:26:44 +00:00
Felix S. Klock II
36777f157b future-compat lint for newly handled cases of #[structural_match]. 2019-07-08 11:50:52 +02:00
Vadim Petrochenkov
0817fc6c6c Support deprecation checking for macros 2019-07-07 13:04:07 +03:00
Julien Cretin
e053eede87 Remove outdated question_mark_macro_sep lint 2019-06-26 20:34:12 +02:00
memoryruins
54e10558b4 Set bare_trait_objects lint to warn 2019-05-28 14:42:14 -04:00
bors
a614cee22e Auto merge of #49799 - hdhoang:46205_deny_incoherent_fundamental_impls, r=nikomatsakis
lint: convert incoherent_fundamental_impls into hard error

*Summary for affected authors:* If your crate depends on one of the following crates, please upgrade to a newer version:
- gtk-rs: upgrade to at least 0.4
- rusqlite: upgrade to at least 0.14
- nalgebra: upgrade to at least 0.15, or the last patch version of 0.14
- spade: upgrade or refresh the Cargo.lock file to use version 1.7
- imageproc: upgrade to at least 0.16 (newer versions no longer use nalgebra)

implement #46205

r? @nikomatsakis
2019-05-17 23:06:51 +00:00
Mazdak Farrokhzad
3ca0d36538
Rollup merge of #60388 - cramertj:elided-lifetime-async, r=nikomatsakis
Disallow non-explicit elided lifetimes in async fn

Fix https://github.com/rust-lang/rust/issues/60203

r? @nikomatsakis
2019-05-03 16:24:57 +02:00
Mazdak Farrokhzad
e9509f8847
Rollup merge of #59928 - petrochenkov:denyambass, r=varkor
Make deprecation lint `ambiguous_associated_items` deny-by-default

As requested by r? @Centril

cc https://github.com/rust-lang/rust/issues/57644
2019-05-03 16:24:52 +02:00
Taylor Cramer
c6e13bc20b Disallow non-explicit elided lifetimes in async fn 2019-05-01 18:34:49 -07:00
Hoàng Đức Hiếu
9982e7d407 lint: convert incoherent_fundamental_impls into hard error
Also remove it from lint listings.
2019-04-16 08:12:14 +07:00
Vadim Petrochenkov
bee92b5327 Make deprecation lint ambiguous_associated_items deny-by-default 2019-04-12 22:32:01 +03:00
Mark Mansi
6fd3f5acaf forgot one 2019-04-10 21:32:46 -05:00
Mark Mansi
d7f5c50a33 make duplicate matcher bindings a hard error 2019-04-10 21:29:17 -05:00
Felix S. Klock II
074f239781 add mutable_borrow_reservation_conflict future-incompatibility lint.
Convert the new 2-phase reservation errors into instances of the lint
so that they will be controlled by that attribute.
2019-04-04 18:50:02 +01:00
Mazdak Farrokhzad
fba110c805 reduce repetition in librustc(_lint) wrt. impl LintPass 2019-04-03 23:37:31 +02:00
Fabian Drinck
df80eae985 Change message to present tense 2019-03-30 22:37:02 +01:00
Fabian Drinck
6e7b45e12b Replace REDUNDANT_IMPORT with UNUSED_IMPORTS 2019-03-30 22:37:02 +01:00
Fabian Drinck
8919894c51 Distinguish between imported and defined items 2019-03-30 22:37:02 +01:00
Fabian Drinck
2245d10fac Improve warning 2019-03-30 22:37:02 +01:00
Fabian Drinck
29d68edc6e Add lint for redundant imports
Co-authored-by: Stephan Schauerte <stephan.schauerte@gmail.com>
2019-03-30 22:37:02 +01:00
mark
9f14e146ed deny duplicate matcher bindings by default 2019-03-28 14:27:16 -05:00
Felix S. Klock II
98e40170be Temporarily emulate the (accidentally) omitted recursion during impl Trait check.
Note that the two previous visitors were omitting slightly different
recursive calls, so I need two flags to properly emulate them.
2019-03-08 16:36:28 +01:00
Mazdak Farrokhzad
56e19160af
Rollup merge of #58296 - estebank:hidden-suggestion, r=oli-obk
Hidden suggestion support

Add way to hide suggestion snippet window from cli output to avoid cluttered spans that don't enhance understanding.

r? @pietroalbini CC @zackmdavis
2019-02-14 02:41:21 +01:00
Taiki Endo
c360ba285c Cleanup imports 2019-02-13 00:31:51 +09:00
Taiki Endo
3216c7656a Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
Esteban Küber
87dd2e1df9 Use hidden suggestions for unused imports lint 2019-02-11 11:16:22 -08:00
bors
57d7cfc3cf Auto merge of #56645 - pietroalbini:fix-unused-imports, r=estebank
Initial implementation of rustfixable unused_imports lint

This PR adds the initial implementation of rustfixable `unused_imports` lint. The implementation works, but rustfix is not able to apply all the suggestions until https://github.com/rust-lang/rust/issues/53934 is fixed. It also needs https://github.com/rust-lang/rust/pull/58296 to hide the suggested note since it's really useless.

cc https://github.com/rust-lang/rust/issues/47888

<details><summary><code>cargo fix</code> in action on the <code>unused_imports</code> lint</summary>

![screenshot from 2018-12-09 15-49-01](https://user-images.githubusercontent.com/2299951/49698874-3a026080-fbca-11e8-9bf1-24060b6c59c8.png)

</details>
2019-02-11 10:34:09 +00:00
Mark Mansi
802b256283 Make it an incompatibility lint for now 2019-02-07 12:17:27 -06:00
Pietro Albini
5681b91fa6
unused_imports: make the lint machine-applicable 2019-02-07 16:20:22 +01:00
Mark Mansi
e957ed9d10 move librustc to 2018 2019-02-05 12:45:47 -06:00
Aaron Hill
3fa36471e8
Rename external_private_dependency to exported_private_dependencies 2019-02-01 09:43:56 -05:00
Aaron Hill
d60214cdf7
Clippy fixes, rename stuff to match RFC 2019-02-01 09:43:56 -05:00
Aaron Hill
23014b4036
Properly register lint 2019-02-01 09:43:55 -05:00
Aaron Hill
8b6f3ddf23
Initial implementation work 2019-02-01 09:43:55 -05:00
Andy Russell
0897ffc28f
remove _with_applicability from suggestion fns 2019-01-26 23:07:55 -05:00
bors
ccd428befd Auto merge of #57726 - Zoxc:combine-early-lints, r=estebank
Combine all builtin early lints

This also adds a -Z no-interleave-lints option to allow benchmarking lints.

r? @estebank
2019-01-26 12:21:03 +00:00
John Kåre Alsaker
beb0c74950 Combine all builtin early lints and use a separate walk for plugin lints. Add a -Z no-interleave-lints option to allow benchmarking lints 2019-01-19 05:01:29 +01:00
Vadim Petrochenkov
01d0ae9618 Prioritize variants as inherent associated items during name resolution 2019-01-16 23:51:41 +03:00
Vadim Petrochenkov
41c65992c5 Implement basic input validation for built-in attributes 2019-01-13 14:17:19 +03:00
varkor
afcb938116 Stabilise irrefutable if-let and while-let patterns
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495).

Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2019-01-12 03:10:59 +00:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Pietro Albini
b747425f59
Rollup merge of #56689 - QuietMisdreavus:rustdoc-lint-group, r=pnkfelix
add a lint group for lints emitted by rustdoc

As rustdoc adds more lints that it specifically manages, it would be nice to be able to lump them all together. This gives us a new group just for that.

I deliberately didn't include `missing_docs` because this is kind of a stepping stone for moving our lints into tool lints (i.e. `#![warn(rustdoc::private_doc_tests)]`), since all of these are specifically emitted by rustdoc. If we want to move `missing_docs` out of the compiler, that's also an option, but it would create a surprising change of behavior.

I also took the chance to rewrite the lint descriptions of these lints to better match the style of the other lints. `>_>`
2018-12-19 11:47:07 +01:00
bors
041254b814 Auto merge of #56481 - arielb1:dynamic-order, r=nikomatsakis
add coherence future-compat warnings for marker-only trait objects

The future-compat warnings break code that assumes that `dyn Send + Sync !=
dyn Sync + Send`, and are the first step in making them equal. cc #33140.

Note: this lint should be made to default-warn before we merge. It is deny only for the crater run.

r? @nikomatsakis / @scalexm . cc @Centril & @alexreg.
2018-12-18 06:50:11 +00:00