about summary refs log tree commit diff
path: root/compiler/rustc_lint_defs/src
AgeCommit message (Collapse)AuthorLines
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-3/+1
2024-04-15Rename feature gateJules Bertholet-1/+1
2024-04-15Fix typoJules Bertholet-1/+1
Co-authored-by: Guillaume Boisseau <Nadrieril@users.noreply.github.com>
2024-04-15Temporarily remove future compatibility label from migration lintJules Bertholet-2/+3
The lint is unstable, and the lint group `rust_2024_compatibility` must keep working on stable
2024-04-15Migration lintJules Bertholet-0/+36
Rustfix remains TODO
2024-04-09Split back out unused_lifetimes -> redundant_lifetimesMichael Goulet-2/+24
2024-04-09Add commentsMichael Goulet-0/+6
2024-04-08Rollup merge of #120144 - petrochenkov:unty, r=davidtwcoMatthias Krüger-2/+5
privacy: Stabilize lint `unnameable_types` This is the last piece of ["RFC #2145: Type privacy and private-in-public lints"](https://github.com/rust-lang/rust/issues/48054). Having unstable lints is not very useful because you cannot even dogfood them in the compiler/stdlib in this case (https://github.com/rust-lang/rust/pull/113284). The worst thing that may happen when a lint is removed are some `removed_lints` warnings, but I haven't heard anyone suggesting removing this specific lint. This lint is allow-by-default and is supposed to be enabled explicitly. Some false positives are expected, because sometimes unnameable types are a legitimate pattern. This lint also have some unnecessary false positives, that can be fixed - see https://github.com/rust-lang/rust/issues/120146 and https://github.com/rust-lang/rust/issues/120149. Closes https://github.com/rust-lang/rust/issues/48054.
2024-04-03rename `expose_addr` to `expose_provenance`joboet-3/+3
2024-03-23rename ptr::from_exposed_addr -> ptr::with_exposed_provenanceRalf Jung-3/+3
2024-03-16Rollup merge of #121720 - tmandry:split-refining, r=compiler-errorsLeón Orell Valerian Liehr-10/+80
Split refining_impl_trait lint into _reachable, _internal variants As discussed in https://github.com/rust-lang/rust/issues/119535#issuecomment-1909352040: > We discussed this today in triage and developed a consensus to: > > * Add a separate lint against impls that refine a return type defined with RPITIT even when the trait is not crate public. > * Place that in a lint group along with the analogous crate public lint. > * Create an issue to solicit feedback on these lints (or perhaps two separate ones). > * Have the warnings displayed with each lint reference this issue in a similar manner to how we do that today with the required `Self: '0'` bound on GATs. > * Make a note to review this feedback on 2-3 release cycles. This points users to https://github.com/rust-lang/rust/issues/121718 to leave feedback.
2024-03-16Add `wasm_c_abi` `future-incompat` lintdaxpedda-0/+39
2024-03-14Rollup merge of #122373 - surechen:fix_121331, r=petrochenkovMatthias Krüger-0/+1
Fix the conflict problem between the diagnostics fixes of lint `unnecessary_qualification` and `unused_imports` fixes #121331 For an `item` that triggers lint unnecessary_qualification, if the `use item` which imports this item is also trigger unused import, fixing the two lints at the same time may lead to the problem that the `item` cannot be found. This PR will avoid reporting lint unnecessary_qualification when conflict occurs. r? ``@petrochenkov``
2024-03-14Rollup merge of #122482 - weiznich:fix/122446, r=compiler-errorsMatthias Krüger-1/+0
Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint This was missed during stablisation of the `#[diagnostic]` attribute namespace. Fixes #122446
2024-03-14Rollup merge of #121899 - shepmaster:dead-code-docs, r=wesleywiserMatthias Krüger-0/+14
Document how removing a type's field can be bad and what to do instead Related to #119645
2024-03-14Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lintGeorg Semmler-1/+0
This was missed during stablisation of the `#[diagnostic]` attribute namespace. Fixes #122446
2024-03-14fixes #121331surechen-0/+1
2024-03-13privacy: Stabilize lint `unnameable_types`Vadim Petrochenkov-2/+5
2024-03-13Add produces as tidy requiresWesley Wiser-0/+2
2024-03-13Added an "Explanation" header and expanded that section for the newly added ↵Felix S. Klock II-0/+8
lint.
2024-03-13downgrade mutable-ptr-in-final-value from hard-error to future-incompat lint ↵Felix S. Klock II-0/+36
to address issue 121610.
2024-03-09Declare new lintNadrieril-0/+31
2024-03-06Document how removing a type's field can be bad and what to do insteadJake Goulding-0/+14
Related to #119645
2024-03-05Split refining_impl_trait lint into _reachable, _internal variantsTyler Mandry-10/+80
2024-03-05Rename `BuiltinLintDiagnostics` as `BuiltinLintDiag`.Nicholas Nethercote-5/+5
Not the dropping of the trailing `s` -- this type describes a single diagnostic and its name should be singular.
2024-03-05Rename `DiagnosticMessage` as `DiagMessage`.Nicholas Nethercote-5/+5
2024-03-01Rollup merge of #111505 - GuillaumeGomez:turn-invalid-doc-attr-into-err, ↵Matthias Krüger-10/+1
r=rustdoc Made `INVALID_DOC_ATTRIBUTES` lint deny by default Fixes https://github.com/rust-lang/rust/issues/82730. # Explanations The `INVALID_DOC_ATTRIBUTES` lint was marked as "will become a hard error into the future" for quite some time so making it `deny` by default. <del>Waiting on https://github.com/rust-lang/backtrace-rs/pull/524 for now.</del>
2024-02-29Detect empty leading where-clauses on type aliasesLeón Orell Valerian Liehr-1/+1
2024-02-29Make `invalid_doc_attributes` deny by defaultGuillaume Gomez-10/+1
2024-02-28Rename `DiagnosticBuilder` as `Diag`.Nicholas Nethercote-1/+1
Much better! Note that this involves renaming (and updating the value of) `DIAGNOSTIC_BUILDER` in clippy.
2024-02-28Rename `Diagnostic` as `DiagInner`.Nicholas Nethercote-1/+1
I started by changing it to `DiagData`, but that didn't feel right. `DiagInner` felt much better.
2024-02-25make non-PartialEq-typed consts as patterns a hard errorRalf Jung-52/+0
2024-02-20Stabilize `LazyCell` and `LazyLock` (`lazy_cell`)Peter Jaszkowiak-7/+3
2024-05-25Auto merge of #124187 - compiler-errors:self-ctor, r=petrochenkovbors-0/+42
Warn (or error) when `Self` ctor from outer item is referenced in inner nested item This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned https://github.com/rust-lang/rust/pull/117246#discussion_r1374648388. This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do. This also reverts part of https://github.com/rust-lang/rust/pull/117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
2024-05-18Warn/error on self ctor from outer item in inner itemMichael Goulet-0/+42
2024-02-20Rollup merge of #120716 - spastorino:change-some-lint-msgs, r=lcnrNilstrieb-36/+1
Change leak check and suspicious auto trait lint warning messages The leak check lint message "this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!" is misleading as some cases may not be phased out and could end being accepted. This is under discussion still. The suspicious auto trait lint the change in behavior already happened, so the new message is probably more accurate. r? `@lcnr` Closes #93367
2024-02-19Remove suspicious auto trait lintSantiago Pastorino-35/+0
2024-02-19Rollup merge of #121230 - GuillaumeGomez:extend-level-api, r=NadrierilMatthias Krüger-13/+17
Extend Level API I need this API for https://github.com/rust-lang/rust-clippy/pull/12303: I have a nested `cfg` attribute (so a `MetaItem`) and I'd like to still be able to match against all possible kind of `Level`s.
2024-02-18Change leak check lint message to behavior is likely to change in the futureSantiago Pastorino-1/+1
2024-02-18Improve wording of static_mut_refObei Sideg-4/+4
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-18Extend Level APIGuillaume Gomez-13/+17
2024-02-13Bump `indexmap`clubby789-1/+2
`swap` has been deprecated in favour of `swap_remove` - the behaviour is the same though.
2024-02-10Remove unnecessary `#![feature(min_specialization)]`Zalathar-2/+0
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-2/+0
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-02-05update the tracking issue for structural match violationsRalf Jung-2/+2
and bless a test I missed
2024-02-05show indirect_structural_match and pointer_structural_match in future compat ↵Ralf Jung-2/+2
reports
2024-02-05get rid of nontrivial_structural_match lint and custom_eq const qualifRalf Jung-40/+3
2024-01-26remove illegal_floating_point_literal_pattern lintRalf Jung-50/+0
2024-01-22Rollup merge of #119948 - asquared31415:unsafe_op_in_unsafe_fn_fix, r=TaKO8KiMatthias Krüger-0/+5
Make `unsafe_op_in_unsafe_fn` migrated in edition 2024 fixes rust-lang/rust#119823