about summary refs log tree commit diff
path: root/src/librustc/lint
AgeCommit message (Collapse)AuthorLines
2019-12-03Move Lint to rustc_sessionMark Rousskov-86/+2
This commit breaks early-lint registration, which will be fixed in the next commit. This movement will allow essentially all crates in the compiler tree to declare lints (though not lint passes).
2019-12-03Move Level to rustc_sessionMark Rousskov-41/+3
2019-12-01rustc_plugin: Remove support for adding plugins from command lineVadim Petrochenkov-2/+1
2019-11-30Rollup merge of #66895 - Centril:rustc_feature, r=oli-obkMazdak Farrokhzad-3/+3
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
2019-11-30move GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-3/+3
2019-11-29allow customising ty::TraitRef's printing behaviorMikhail Babenko-2/+7
fix clippy allow customising ty::TraitRef's printing behavior fix clippy stylistic fix
2019-11-19More HashStable.Camille GILLOT-15/+2
2019-11-15Changed unused_labels lint default from allow to warnBart Massey-1/+1
Closes #66324.
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+4
2019-11-12Remove dead code for encoding/decoding lint IDsMark Rousskov-26/+1
This helps decouple the lint system from needing the implicit TLS TyCtxt as well.
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-1/+1
2019-11-08Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obkMazdak Farrokhzad-81/+2
Transition future compat lints to {ERROR, DENY} - Take 2 Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992. - `legacy_ctor_visibility` (ERROR) -- closes #39207 - `legacy_directory_ownership` (ERROR) -- closes #37872 - `safe_extern_static` (ERROR) -- closes #36247 - `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238 - `duplicate_macro_exports` (ERROR) - `nested_impl_trait` (ERROR) -- closes #59014 - `ill_formed_attribute_input` (DENY) -- transitions #57571 - `patterns_in_fns_without_body` (DENY) -- transitions #35203 r? @varkor cc @petrochenkov
2019-11-07Rollup merge of #66044 - RalfJung:uninit-lint, r=oli-obkYuki Okushi-0/+3
Improve uninit/zeroed lint * Also warn when creating a raw pointer with a NULL vtable. * Also identify `MaybeUninit::uninit().assume_init()` and `MaybeUninit::zeroed().assume_init()` as dangerous.
2019-11-06patterns_in_fns_without_body -> denyMazdak Farrokhzad-1/+1
2019-11-06ill_formed_attribute_input -> denyMazdak Farrokhzad-1/+1
2019-11-06nested_impl_trait -> errorMazdak Farrokhzad-18/+0
2019-11-06duplicate_macro_exports -> errorMazdak Farrokhzad-16/+0
2019-11-06parenthesized_params_in_types_and_modules -> errorMazdak Farrokhzad-11/+0
2019-11-06safe_extern_static -> errorMazdak Farrokhzad-11/+0
2019-11-06legacy_directory_ownership -> errorMazdak Farrokhzad-12/+0
2019-11-06legacy_ctor_visibility -> errorMazdak Farrokhzad-11/+0
2019-11-05use American spelling for `pluralize!`Andy Russell-2/+2
2019-11-03Delete lint buffer from SessionMark Rousskov-18/+26
2019-11-03Migrate resolver over to internal lint bufferMark Rousskov-0/+21
2019-11-03Only permit taking buffered lints inside lint internalsMark Rousskov-1/+1
2019-11-03Remove unused get_any methodMark Rousskov-5/+0
2019-11-02also identiy MaybeUninit::uninit().assume_init() as dangerousRalf Jung-0/+3
2019-10-29Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasperMazdak Farrokhzad-0/+6
Lint ignored `#[inline]` on function prototypes Fixes https://github.com/rust-lang/rust/issues/51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-1/+1
This is done by moving some data definitions to syntax::expand.
2019-10-25Emit warning for ignored #[inline] on trait method prototypesvarkor-0/+6
2019-10-23Rollup merge of #65657 - nnethercote:rm-InternedString-properly, r=eddybMazdak Farrokhzad-1/+1
Remove `InternedString` This PR removes `InternedString` by converting all occurrences to `Symbol`. There are a handful of places that need to use the symbol chars instead of the symbol index, e.g. for stable sorting; local conversions `LocalInternedString` is used in those places. r? @eddyb
2019-10-23Rollup merge of #65193 - Mark-Simulacrum:lockless-lintstore, r=nikomatsakisMazdak Farrokhzad-233/+293
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-22Add some documentationMark Rousskov-8/+16
2019-10-21use unwrap_or in lint codeGuanqun Lu-5/+1
2019-10-21Convert fields within `DefPathData` from `InternedString` to `Symbol`.Nicholas Nethercote-1/+1
It's a full conversion, except in `DefKey::compute_stable_hash()` where a `Symbol` now is converted to an `InternedString` before being hashed. This was necessary to avoid test failures.
2019-10-19Rollup merge of #64007 - estebank:overlapping-patterns, r=matthewjasperMazdak Farrokhzad-0/+7
Add check for overlapping ranges to unreachable patterns lint Fix #63987.
2019-10-17Update API to be more compatible with plugin needsMark Rousskov-13/+17
Move to using Box<dyn Fn() -> ...> so that we can let plugins register state. This also adds a callback that'll get called from plugin registration so that Clippy and other tools can register lints without using the plugin API. The plugin API still works, but this new API is more compatible with drivers other than rustc.
2019-10-17Create lint store during plugin registrationMark Rousskov-10/+10
Remove lint store from Session
2019-10-17Remove all borrows of lint store from Session from librustcMark Rousskov-23/+29
Access through tcx is fine -- by that point, the lint store is frozen, but direct access through Session will go away in future commits, as lint store is still mutable in early stages of Session, and will be removed completely.
2019-10-17Access future incompatibility information directlyMark Rousskov-6/+1
Avoid querying LintStore when not necessary
2019-10-17Remove side table of future incompatibility infoMark Rousskov-72/+172
Moves this information to a direct field of Lint, which is where it belongs.
2019-10-17Make declare_lint take any amount of boolean fieldsMark Rousskov-10/+21
2019-10-17Move to storing constructor functions inside LintStoreMark Rousskov-33/+26
This stops storing the pass objects and instead stores constructor functions. The primary effect is that LintStore no longer has any interior mutability.
2019-10-17Take lint passes as constructor functionsMark Rousskov-8/+8
2019-10-17Make get_lints be a static functionMark Rousskov-30/+16
This moves from calling get_lints on instantiated pass objects to the raw object
2019-10-17No longer implicitly register lints when registering passesMark Rousskov-4/+0
This is in preparation for on-demand constructing passes
2019-10-17Split out just registration to separate functionMark Rousskov-27/+13
2019-10-17Split module and crate late pass registrationMark Rousskov-9/+9
2019-10-17Lints being from a plugin is dependent on the lint, not the registrationMark Rousskov-10/+12
2019-10-17Handle lints, not passes in push_lintsMark Rousskov-7/+5
This extracts the call to get_lints() to callers.