about summary refs log tree commit diff
path: root/src/librustc_lint/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-464/+0
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-11Update comment for functionTakayuki Nakata-1/+1
`rustc::lint::builtin` -> `rustc_session::lint::builtin`
2020-07-30Rename the lint againManish Goregaokar-3/+3
2020-07-30intra_doc_resolution_failures -> broken_intra_doc_linksManish Goregaokar-1/+1
2020-07-30Rename to intra_doc_resolution_failuresManish Goregaokar-3/+3
2020-07-29Register renamed lintManish Goregaokar-0/+1
2020-07-29Rename intra_doc_link_resolution_failure -> intra_doc_link_resolution_failuresManish Goregaokar-2/+2
2020-07-16apply bootstrap cfgsMark Rousskov-1/+0
2020-07-09Rollup merge of #74070 - eddyb:forall-tcx-providers, r=nikomatsakisManish Goregaokar-1/+1
Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>. In order to work around normalization-under-HRTB (for `provide!` in `rustc_metadata`), we ended up with this: ```rust struct Providers<'tcx> { type_of: fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>, // ... } ``` But what I initially wanted to do, IIRC, was this: ```rust struct Providers { type_of: for<'tcx> fn(TyCtxt<'tcx>, DefId) -> Ty<'tcx>, // ... } ``` This PR moves to the latter, for the simple reason that only the latter allows keeping a `Providers` value, or a subset of its `fn` pointer fields, around in a `static` or `thread_local!`, which can be really useful for custom drivers that override queries. (@jyn514 and I came across a concrete usecase of that in `rustdoc`) The `provide!` macro in `rustc_metadata` is fixed by making the query key/value types available as type aliases under `ty::query::query_{keys,values}`, not just associated types (this is the first commit). r? @nikomatsakis
2020-07-09Auto merge of #74131 - ollie27:rustdoc_invalid_codeblock_attributes_name, ↵bors-2/+2
r=GuillaumeGomez rustdoc: Rename invalid_codeblock_attribute lint to be plural Lint names should be plural as per the lint naming conventions: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#lints r? @GuillaumeGomez
2020-07-07rustdoc: Rename invalid_codeblock_attribute lint to be pluralOliver Middleton-2/+2
2020-07-05Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>.Eduard-Mihai Burtescu-1/+1
2020-07-02rustc_lint: avoid using TypeckTables::empty for LateContext.Eduard-Mihai Burtescu-0/+1
2020-06-28Rename the lint to clashing_extern_declarations.jumbatm-1/+1
Also, run RustFmt on the clashing_extern_fn test case and update stderrs.
2020-06-24lints: add `improper_ctypes_definitions`David Wood-1/+2
This commit adds a new lint - `improper_ctypes_definitions` - which functions identically to `improper_ctypes`, but on `extern "C" fn` definitions (as opposed to `improper_ctypes`'s `extern "C" {}` declarations). Signed-off-by: David Wood <david@davidtw.co>
2020-06-20Add ClashingExternDecl lint.jumbatm-0/+2
This lint checks that all declarations for extern fns of the same name are declared with the same types.
2020-05-28rustc_lint: Remove `unused_crate_dependencies` from the `unused` groupVadim Petrochenkov-1/+0
2020-05-25Implement warning for unused dependencies.Jeremy Fitzhardinge-0/+1
This will print a diagnostic for crates which are mentioned as `--extern` arguments on the command line, but are never referenced from the source. This diagnostic is controlled by `-Wunused-crate-dependencies` or `#![warn(unused_crate_dependencies)]` and is "allow" by default. There are cases where certain crates need to be linked in but are not directly referenced - for example if they are providing symbols for C linkage. In this case the warning can be suppressed with `use needed_crate as _;`. Thanks to @petrochenkov for simplified core. Resolves issue #57274
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-0/+1
2020-05-01doc: misc rustdoc thingsTshepang Lekhonkhobe-3/+3
2020-04-27Accept `LocalDefId` as key for `lint_mod` querymarmeladema-7/+3
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-1/+5
2020-04-23Create new rustdoc lint to check for code blocks tagsGuillaume Gomez-1/+3
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-0/+1
2020-04-01Rollup merge of #70081 - lcnr:issue68387, r=varkorDylan DPC-0/+2
add `unused_braces` lint Add the lint `unused_braces` which is warn by default. `unused_parens` is also extended and now checks anon consts. closes #68387 r? @varkor
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-4/+4
2020-03-27add `unused_braces`, lint anon_constBastian Kauschke-0/+2
2020-03-01encode `;` stmt w/o expr as `StmtKind::Empty`Mazdak Farrokhzad-2/+4
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-23Auto merge of #69084 - yaahc:delayed-doc-lint, r=petrochenkovbors-1/+2
Split non macro portion of unused_doc_comment from macro part into two passes/lints ## Motivation This change is motivated by the needs of the [spandoc library](https://github.com/yaahc/spandoc). The specific use case is that my macro is removing doc comments when an attribute is applied to a fn with doc comments, but I would like the lint to still appear when I forget to add the `#[spandoc]` attribute to a fn, so I don't want to have to silence the lint globally. ## Approach This change splits the `unused _doc_comment` lint into two lints, `unused_macro_doc_comment` and `unused_doc_comment`. The non macro portion is moved into an `early_lint_pass` rather than a pre_expansion_pass. This allows proc macros to silence `unused_doc_comment` warnings by either adding an attribute to silence it or by removing the doc comment before the early_pass runs. The `unused_macro_doc_comment` lint however will still be impossible for proc-macros to silence, but the only alternative that I can see is to remove this lint entirely, which I don't think is acceptable / is a decision I'm not comfortable making personally, so instead I opted to split the macro portion of the check into a separate lint so that it can be silenced globally with an attribute if necessary without needing to globally silence the `unused_doc_comment` lint as well, which is still desireable. fixes https://github.com/rust-lang/rust/issues/67838
2020-02-18better lint namesRalf Jung-0/+1
2020-02-15rustc_lint: Move `unused_doc_comments` from pre-expansion to early lintsVadim Petrochenkov-1/+2
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-1/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-09Make issue references consistentMatthias Prechtl-19/+38
2020-02-07Remove unused feature gate from librustc_lintbjorn3-1/+0
2020-01-12Expose `context::CheckLintNameResult`Yuki Okushi-1/+1
Clippy needs it
2020-01-11lints: move a commentMazdak Farrokhzad-5/+21
2020-01-11move rustc::lint::{context, passes} to rustc_lint.Mazdak Farrokhzad-15/+17
Also do some cleanup of the interface.
2020-01-11{rustc::lint -> rustc_lint}::internalMazdak Farrokhzad-1/+2
2020-01-11GlobalCtxt: Erase `LintStore` type.Mazdak Farrokhzad-0/+1
2020-01-11prepare moving HardwiredLints to rustc_sessionMazdak Farrokhzad-1/+2
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-01Move lint levels machanism in librustc_lint.Camille GILLOT-0/+2
2020-01-01Move late lint machanism in librustc_lint.Camille GILLOT-1/+3
2020-01-01Move early lint machanism in librustc_lint.Camille GILLOT-0/+2
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-27Stabilize the `matches!` macroSimon Sapin-1/+0
Fixes https://github.com/rust-lang/rust/issues/65721 FCP: https://github.com/rust-lang/rust/issues/65721#issuecomment-569118119
2019-12-22Format the worldMark Rousskov-200/+230
2019-12-07Fixes typoNathan Ringo-1/+1
`legacy_disrectory_ownership` vs `legacy_directory_ownership`