511 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
45f27643db prepare moving HardwiredLints to rustc_session 2020-01-11 03:26:16 +01:00
Mazdak Farrokhzad
7dbccf5b55 buffered lint infra -> rustc_session 2020-01-11 03:21:34 +01:00
Mazdak Farrokhzad
82eeb8573a prepare for moving BuiltinLintDiagnostics to rustc_session 2020-01-11 03:19:50 +01:00
Mazdak Farrokhzad
d247ac4c0d Remove unused derives 2020-01-11 03:19:50 +01:00
Mazdak Farrokhzad
8bd3d240e3 nix syntax::errors & prefer rustc_errors over errors 2020-01-10 07:41:30 +01:00
Mazdak Farrokhzad
2c3e5d3de0 - remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
2020-01-08 04:25:33 +01:00
Mazdak Farrokhzad
b1aad76586 Normalize syntax::edition imports. 2020-01-02 19:31:38 +01:00
Mazdak Farrokhzad
4ff12ce4c1 Normalize syntax::symbol imports. 2020-01-02 13:57:04 +01:00
Mazdak Farrokhzad
75e4783f63 Normalize syntax::source_map imports. 2020-01-02 13:57:04 +01:00
Mazdak Farrokhzad
52179c56be librustc_ast_lowering: fix misc fallout. 2019-12-31 17:56:25 +01:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Mazdak Farrokhzad
56f830e292
Rollup merge of #66325 - BartMassey:master, r=joshtriplett
Change unused_labels from allow to warn

Fixes #66324, making the unused_labels lint warn instead of allow by default. I'm told @rust-lang/lang will need to review this, and perhaps will want to do a crater run.
2019-12-08 03:39:43 +01:00
Mark Rousskov
f03d8f305a Move early lint declarations to librustc_session 2019-12-03 12:19:14 -05:00
Bart Massey
34a45a5309 Changed unused_labels lint default from allow to warn
Closes #66324.
2019-11-15 16:31:30 -08:00
Mazdak Farrokhzad
574d2b83a1 patterns_in_fns_without_body -> deny 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad
a12e69d627 ill_formed_attribute_input -> deny 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad
0cbd06ae1c nested_impl_trait -> error 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad
8e27c4f312 duplicate_macro_exports -> error 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad
b54c5781b8 parenthesized_params_in_types_and_modules -> error 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad
98d2c510dd safe_extern_static -> error 2019-11-06 11:10:36 +01:00
Mazdak Farrokhzad
79b35e90f1 legacy_directory_ownership -> error 2019-11-06 11:08:23 +01:00
Mazdak Farrokhzad
c0056c04f6 legacy_ctor_visibility -> error 2019-11-06 11:08:23 +01:00
Andy Russell
ad550b8ef3
use American spelling for pluralize! 2019-11-05 15:10:24 -05:00
varkor
94c4dd9902 Emit warning for ignored #[inline] on trait method prototypes 2019-10-25 23:26:27 +01:00
Mazdak Farrokhzad
7c043e284a
Rollup merge of #65193 - Mark-Simulacrum:lockless-lintstore, r=nikomatsakis
Lockless LintStore

This removes mutability from the lint store after registration. Each commit stands alone, for the most part, though they don't make sense out of sequence.

The intent here is to move LintStore to a more parallel-friendly architecture, although also just a cleaner one from an implementation perspective. Specifically, this has the following changes:
 * We no longer implicitly register lints when registering lint passes
    * For the most part this means that registration calls now likely want to call something like:
       `lint_store.register_lints(&Pass::get_lints())` as well as `register_*_pass`.
    * In theory this is a simplification as it's much easier for folks to just register lints and then have passes that implement whichever lint however they want, rather than necessarily tying passes to lints.
 * Lint passes still have a list of associated lints, but a followup PR could plausibly change that
   * This list must be known for a given pass type, not instance, i.e., `fn get_lints()` is the signature instead of `fn get_lints(&self)` as before.
 * We do not store pass objects, instead storing constructor functions. This means we always get new passes when running lints (this happens approximately once though for a given compiler session, so no behavior change is expected).
 * Registration API is _much_ simpler: generally all functions are just taking `Fn() -> PassObject` rather than several different `bool`s.
2019-10-23 22:19:10 +02:00
Mark Rousskov
7abb1fafce Remove side table of future incompatibility info
Moves this information to a direct field of Lint, which is where it
belongs.
2019-10-17 19:41:21 -04:00
Mark Rousskov
c1abc30660 Make declare_lint take any amount of boolean fields 2019-10-17 19:41:21 -04:00
Esteban Küber
220b9b29c2 Move overlapping patterns to its own lint 2019-10-16 11:57:19 -07:00
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