331 Commits

Author SHA1 Message Date
Mark Mansi
e957ed9d10 move librustc to 2018 2019-02-05 12:45:47 -06: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
Nicholas Nethercote
afbd004d69 Remove hir::StmtKind::Decl.
It's a level of indirection that hurts far more than it helps. The code
is simpler without it. (This commit cuts more than 120 lines of code.)

In particular, this commit removes some unnecessary `Span`s within
`DeclKind` that were always identical to those in the enclosing `Stmt`,
and some unnecessary allocations via `P`.
2019-01-17 12:13:22 +11:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Andy Russell
90726e1ac1
suggest similar lint names for unknown lints 2018-12-19 16:52:09 -05:00
Alexander Regueiro
ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
John Kåre Alsaker
a70babed03 Use a function to access the Hir map to be able to turn it into a query later 2018-12-06 17:24:36 +01:00
Eduard-Mihai Burtescu
7683180be5 rustc: implement and use Default on more types. 2018-11-21 08:11:50 +02:00
varkor
c148714549 Rewrite ... as ..= as a MachineApplicable 2018 idiom lint 2018-11-10 19:26:49 +00:00
Eduard-Mihai Burtescu
d00d42d079 rustc_target: pass contexts by reference, not value. 2018-11-04 20:33:57 +02:00
Oliver Scherer
3c9258e604 Prefer Default::default over FxHash*::default in struct constructors 2018-10-19 14:34:44 +02:00
Oliver Scherer
ee81739dc1 Deprecate the FxHashMap() and FxHashSet() constructor function hack 2018-10-19 14:34:44 +02:00
bors
8a7048b72b Auto merge of #54251 - varkor:silence-bad_style, r=Manishearth
Make `bad_style` a silent alias for `nonstandard_style`

Now only `nonstandard_style` is suggested in `rustc -W help`, but `bad_style` will not produce a warning. Closes #41646.

r? @Manishearth
2018-10-16 18:01:41 +00:00
Zack M. Davis
5b22d9b2ca don't elide lifetimes in paths in librustc/
This seemed like a good way to kick the tires on the
elided-lifetimes-in-paths lint (#52069)—seems to work! This was also
pretty tedious—it sure would be nice if `cargo fix` worked on this
codebase (#53896)!
2018-09-29 21:48:29 -07:00
varkor
15ecd1973a Add LintGroup and LintAlias 2018-09-15 17:33:22 +01:00
varkor
52c0f13ff1 Support deprecated lints in find_lints 2018-09-15 17:05:52 +01:00
varkor
5384f0fd3e Make bad_style a silent alias for nonstandard_style
Now only `nonstandard_style` is suggested in `rustc -W help`, but `bad_style` will not produce a warning.
2018-09-15 15:26:45 +01:00
Niko Matsakis
b1a9f9eae8 visit the paths in pre-expansion macros 2018-09-10 17:12:55 -04:00
Manish Goregaokar
daa43643b0 deprcated -> deprecated 2018-09-01 21:45:44 +05:30
flip1995
798a20740e
Fix of bug introduced by #53762 2018-09-01 17:43:14 +02:00
flip1995
9cbe518216 Fix typo and small mistake 2018-08-31 00:47:09 -07:00
flip1995
3720557361 Implement backwards compatibility for tool_lints 2018-08-31 00:46:57 -07:00
flip1995
ce173c12e6 Add deprecated_name argument to the register lint group functions 2018-08-31 00:46:55 -07:00
Alex Crichton
003cab25d7 Generalize async_idents to all new keywords
This commit generalizes the existing `async_idents` lint to easily encompass
other identifiers that will be keywords in future editions. The new lint is
called `keyword_idents` and the old `async_idents` lint is registered as renamed
to this new lint.

As a proof of concept the `try` keyword was added to this list as it looks to be
listed as a keyword in the 2018 edition only. The `await` keyword was not added
as it's not listed as a keyword yet.

Closes #53077
2018-08-29 09:34:53 -07:00
Mark Rousskov
3baec3cdd7 Add HirId to VisibilityKind::Restricted 2018-08-07 10:13:17 -06:00
flip1995
57c77426ae
Check if the lint_name is from a tool and if the tool_lint exists 2018-07-30 16:10:41 +02:00
ljedrz
acd38f656a Improve a few vectors - calculate capacity or build from iterators 2018-07-26 21:48:38 +02:00
bors
12ed235adc Auto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearth
Lint `async` identifiers in 2018 preparation mode

r? @Manishearth

fixes https://github.com/rust-lang/rust/issues/49716
2018-07-18 15:04:17 +00:00
Zack M. Davis
d351370fa1 structured suggestion for renamed-and-removed-lints 2018-07-14 22:09:27 -07:00
Oliver Schneider
15a8a66d5c Lint the use of async as an identifier 2018-07-14 20:44:19 +02:00
Oliver Schneider
22d21b1575 Remove unused macro argument 2018-07-13 15:03:05 +02:00
John Kåre Alsaker
c5ecc6fefb Combine all builtin late lints 2018-06-21 18:00:23 +02:00
Oliver Schneider
5c0d1355f2 Refactor the const eval diagnostic API 2018-06-05 20:49:46 +02:00
Irina Popa
b63d7e2b1c Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00
Irina Popa
7a5147616b rustc_target: move LayoutOf's type parameter to an associated type. 2018-04-26 16:50:28 +03:00
John Kåre Alsaker
fe63637350 Use locks for Session.lint_store and Session.buffered_lints 2018-04-16 02:23:55 +02:00
Vadim Petrochenkov
b3b5ef186c Remove more duplicated spans 2018-04-06 11:50:49 +03:00
Kurtis Nusbaum
11f14060a4 change all appropriate EPOCH to EDITION 2018-03-20 10:27:02 -07:00
Kurtis Nusbaum
3c8d555497 rename epoch to edition 2018-03-20 10:27:02 -07:00
Niko Matsakis
6d0f9319df refactor ParamEnv::empty(Reveal) into two distinct methods
- `ParamEnv::empty()` -- does not reveal all, good for typeck
- `ParamEnv::reveal_all()` -- does, good for trans
- `param_env.with_reveal_all()` -- converts an existing parameter environment
2018-03-13 11:21:30 -04:00
bors
fedce67cd2 Auto merge of #48326 - RalfJung:generic-bounds, r=petrochenkov
Warn about ignored generic bounds in `for`

This adds a new lint to fix #42181. For consistency and to avoid code duplication, I also moved the existing "bounds in type aliases are ignored" here.

Questions to the reviewer:
* Is it okay to just remove a diagnostic error code like this? Should I instead keep the warning about type aliases where it is? The old code provided a detailed explanation of what's going on when asked, that information is now lost. On the other hand, `span_warn!` seems deprecated (after this patch, it has exactly one user left!).
* Did I miss any syntactic construct that can appear as `for` in the surface syntax? I covered function types (`for<'a> fn(...)`), generic traits (`for <'a> Fn(...)`, can appear both as bounds as as trait objects) and bounds (`for<'a> F: ...`).
* For the sake of backwards compatibility, this adds a warning, not an error. @nikomatsakis suggested an error in https://github.com/rust-lang/rust/issues/42181#issuecomment-306924389, but I feel that can only happen in a new epoch -- right?

Cc @eddyb
2018-03-09 10:45:29 +00:00
Manish Goregaokar
4338bd178d Move epochs to libsyntax 2018-03-08 17:10:03 -08:00
Ralf Jung
d1ed6cce6c Lint passes: add check_where_predicate and check_poly_trait_ref 2018-02-27 13:00:30 +01:00
Manish Goregaokar
177271f914 span_bug doesn't work well at this stage, use the session directly 2018-02-23 08:24:49 -08:00
Manish Goregaokar
bd29696218 Add ability for hardwired lints to operate on the diagnostic builder 2018-02-23 08:24:49 -08:00
Manish Goregaokar
da9dc0507b Allow future-incompat lints to mention an epoch 2018-02-23 08:24:07 -08:00
kennytm
daecd15271
Rollup merge of #47959 - Manishearth:rustdoc-ice, r=Mark-Simulacrum
Fix rustdoc ICE on macros defined within functions

fixes #47639
2018-02-06 02:13:52 +08:00
Manish Goregaokar
c22d6e2fda Fix rustdoc ICE on macros defined within functions
fixes #47639
2018-02-02 12:13:12 +05:30
Eduard-Mihai Burtescu
9c3dc7e872 rustc: prefer ParamEnvAnd and LayoutCx over tuples for LayoutOf. 2018-02-01 00:01:08 +02:00