summary refs log tree commit diff
path: root/compiler/rustc_lint_defs/src
AgeCommit message (Collapse)AuthorLines
2023-09-28Remove `rustc_lint_defs::lint_array`DaniPopes-11/+2
2023-09-26Auto merge of #115893 - RalfJung:match-require-partial-eq, r=oli-obkbors-0/+52
lint towards rejecting consts in patterns that do not implement PartialEq I think we definitely don't want to allow such consts, so even while the general plan around structural matching is up in the air, we can start the process of getting non-PartialEq matches out of the ecosystem.
2023-09-25rename lint; add tracking issueRalf Jung-5/+5
2023-09-24work towards rejecting consts in patterns that do not implement PartialEqRalf Jung-0/+52
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-0/+1
2023-09-22make the reason: field mandatory for @future_incompatible lintsRalf Jung-15/+45
2023-09-22give FutureIncompatibilityReason variants more explicit namesRalf Jung-15/+21
2023-09-17Auto merge of #114452 - weiznich:feature/diagnostic_on_unimplemented, ↵bors-4/+7
r=compiler-errors `#[diagnostic::on_unimplemented]` without filters This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message The relevant behavior is specified in [RFC-3366](https://rust-lang.github.io/rfcs/3366-diagnostic-attribute-namespace.html)
2023-09-14Auto merge of #112038 - Nemo157:edition-2024-unsafe_op_in_unsafe_fn, r=RalfJungbors-18/+7
Change `unsafe_op_in_unsafe_fn` to be `warn`-by-default from edition 2024 This was previously FCPed: https://github.com/rust-lang/rust/issues/71668#issuecomment-1189396886 There were two blocking requirements: * Fix the `unused_unsafe` lint, done in https://github.com/rust-lang/rust/pull/100081 * Have `cargo fix` able to fix the lint, done in https://github.com/rust-lang/rust/pull/112017
2023-09-12`#[diagnostic::on_unimplemented]` without filtersGeorg Semmler-4/+7
This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Co-authored-by: Michael Goulet <michael@errs.io>
2023-09-07Don't emit refining_impl_trait for private itemsMichael Goulet-1/+1
2023-09-07Implement refinement lint for RPITITMichael Goulet-1/+45
2023-09-06Rollup merge of #115578 - ouz-a:rustc_clarify, r=oli-obkMatthias Krüger-1/+1
Clarify cryptic comments Clarifies some unclear comments that lurked in the compiler. r? ``@oli-obk``
2023-09-06make comments less crypticouz-a-1/+1
2023-09-06Change unsafe_op_in_unsafe_fn to be warn-by-default from edition 2024Wim Looman-18/+7
2023-09-01Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkovbors-47/+2
Replace old private-in-public diagnostic with type privacy lints Next part of RFC https://github.com/rust-lang/rust/issues/48054. r? `@petrochenkov`
2023-08-22Auto merge of #115104 - compiler-errors:rollup-8235xz5, r=compiler-errorsbors-0/+46
Rollup of 6 pull requests Successful merges: - #114959 (fix #113702 emit a proper diagnostic message for unstable lints passed from CLI) - #115011 (Warn on elided lifetimes in associated constants (`ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT`)) - #115077 (Do not emit invalid suggestion in E0191 when spans overlap) - #115087 (Add disclaimer on size assertion macro) - #115090 (Always use `os-release` rather than `/lib` to detect `NixOS` (bootstrap)) - #115101 (triagebot: add dependency licensing pings) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-21Redefine the pluralize macro's armallaboutevemirolive-1/+2
2023-08-20Warn on elided lifetimes in associated constantsMichael Goulet-0/+46
2023-08-15more nitsMichael Goulet-29/+12
2023-08-15Reuse the selection context, compute failing obligations first in ambig modeMichael Goulet-0/+2
2023-08-15nitsMichael Goulet-1/+4
Co-authored-by: lcnr <rust@lcnr.de>
2023-08-15Implement lint against coinductive impl overlapMichael Goulet-0/+51
2023-08-04Auto merge of #114414 - cjgillot:early-unnameable-test, r=petrochenkovbors-0/+40
Make test harness lint about unnnameable tests. Implementation of https://github.com/rust-lang/rust/pull/113734#discussion_r1283073418 About the options suggested in https://github.com/rust-lang/rust/issues/36629#issuecomment-404753945: adding this case to unused_attribute was just more complicated. I'll try to understand a bit more what you had in mind in https://github.com/rust-lang/rfcs/pull/2471#issuecomment-397241123 This was just simpler to do in a standalone PR. I'll remove the corresponding changes from https://github.com/rust-lang/rust/pull/113734 later. r? `@petrochenkov`
2023-08-03Make test harness lint about unnnameable tests.Camille GILLOT-0/+40
2023-08-03Add `internal_features` lintNilstrieb-1/+0
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-08-02Replace old private-in-public diagnostic with type privacy lintsBryanskiy-47/+2
2023-07-29fix(resolve): update the ambiguity glob binding as warning recursivelybohan-0/+62
2023-07-28Auto merge of #111780 - weiznich:diagnostic_namespace, r=petrochenkovbors-0/+25
Diagnostic namespace This PR implements the basic infrastructure for accepting the `#[diagnostic]` attribute tool namespace as specified in https://github.com/rust-lang/rfcs/pull/3368. Note: This RFC is not merged yet, but it seems like it will be accepted soon. I open this PR early on to get feedback on the actual implementation as soon as possible. This hopefully enables getting at least the diagnostic namespace to stable rust "soon", so that crates do not need to bump their MSRV if we stabilize actual attributes in this namespace. This PR only adds infrastructure accept attributes from this namespace, it does not add any specific attribute. Therefore the compiler will emit a lint warning for each attribute that's actually used. This namespace is added behind a feature flag, so it will be only available on a nightly compiler for now. cc `@estebank` as they've supported me in planing, specifying and implementing this feature.
2023-07-28Introduce the `#[diagnostic]` attribute namespaceGeorg Semmler-0/+25
Co-authored-by: est31 <est31@users.noreply.github.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com> Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2023-07-28Auto merge of #113312 - Ddystopia:auto-trait-fun, r=lcnrbors-3/+3
discard default auto trait impls if explicit ones exist (rebase of #85048) Rebase of #85048
2023-07-28Change the description of `SUSPICIOUS_AUTO_TRAIT_IMPLS`Oleksandr Babak-3/+3
2023-07-18Fix removal span calculation of unused_qualifications suggestion许杰友 Jieyou Xu (Joe)-4/+2
2023-07-13Add machine-applicable suggestion for `unused_qualifications` lint许杰友 Jieyou Xu (Joe)-0/+6
2023-07-11Lint against misplaced where-clauses on assoc tys in traitsLeón Orell Valerian Liehr-1/+1
2023-07-05Make `unused_associated_type_bounds`'s lint level changeableOli Scherer-0/+1
2023-07-05Lint now-unnecessary associated type boundsOli Scherer-0/+26
2023-06-29Rollup merge of #112670 - petrochenkov:typriv, r=eholkMatthias Krüger-2/+8
privacy: Type privacy lints fixes and cleanups See individual commits. Follow up to https://github.com/rust-lang/rust/pull/111801.
2023-06-22Stop hiding const eval limit in external macrosOli Scherer-1/+2
2023-06-15privacy: Feature gate new type privacy lintsVadim Petrochenkov-2/+8
2023-06-12Private-in-public lints implementationBryanskiy-0/+95
2023-05-31Remove const eval limit and implement an exponential backoff lint insteadOli Scherer-0/+38
2023-05-27Add warn-by-default lint for local binding shadowing exported glob re-export ↵许杰友 Jieyou Xu (Joe)-0/+48
item
2023-05-08Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, ↵bors-0/+3
r=Mark-Simulacrum enable `rust_2018_idioms` lint group for doctests With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests. Resolves #106086 Resolves #99144 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-07enable `rust_2018_idioms` for doctestsozkanonur-0/+3
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-05Improve check-cfg diagnostics (part 2)Urgau-1/+2
2023-04-29Partial stabilisation of `c_unwind`Gary Guo-3/+1
2023-04-27Add a few more missing lintsMichael Goulet-0/+2
2023-04-27Sort hardwired lintsMichael Goulet-89/+91
2023-04-27Add invalid_macro_export_arguments to built-in macro listMichael Goulet-0/+1