about summary refs log tree commit diff
path: root/src/tools/clippy/tests
AgeCommit message (Collapse)AuthorLines
2023-10-21Merge commit '2b030eb03d9e5837440b1ee0b98c50b97c0c5889' into clippyupPhilipp Krones-335/+1352
2023-10-20s/generator/coroutine/Oli Scherer-3/+3
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-12/+2
2023-10-18Tweak wording of type errors involving type paramsEsteban Küber-1/+1
Fix #78206.
2023-10-13Stabilize AFIT and RPITITMichael Goulet-24/+21
2023-10-09Extend impl's def_span to include where clausesMichael Goulet-1/+1
2023-10-06Merge commit 'b105fb4c39bc1a010807a6c076193cef8d93c109' into clippyupPhilipp Krones-473/+1633
2023-10-05Add more diagnostic items for clippyJason Newcomb-4/+4
2023-10-04Point to closure return instead of output if defaultedMichael Goulet-2/+2
2023-10-04Fix clippyMichael Goulet-12/+12
2023-10-03Point to full async fn for futureMichael Goulet-19/+22
2023-10-01Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrumbors-16/+20
Partially outline code inside the panic! macro This outlines code inside the panic! macro in some cases. This is split out from https://github.com/rust-lang/rust/pull/115562 to exclude changes to rustc.
2023-09-25Merge commit '7671c283a50b5d1168841f3014b14000f01dd204' into clippyupPhilipp Krones-1417/+2587
2023-09-23Bless clippy.Camille GILLOT-166/+87
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-3/+3
2023-09-18Auto merge of #115748 - RalfJung:post-mono, r=oli-obkbors-2/+2
move required_consts check to general post-mono-check function This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants. Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) https://github.com/rust-lang/rust/issues/115709: ensuring that all locals are dynamically sized. I didn't expect this to change diagnostics, but it's just cycle errors that change. r? `@oli-obk`
2023-09-17Rollup merge of #115477 - kellerkindt:stabilized_int_impl, r=dtolnayDylan DPC-1/+1
Stabilize the `Saturating` type Closes #87920 Closes #92354 Stabilization report https://github.com/rust-lang/rust/issues/87920#issuecomment-1652346124 FCP https://github.com/rust-lang/rust/issues/87920#issuecomment-1676438885
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-2/+2
also share the code that emits the actual error
2023-09-14Ignore `#[doc(hidden)]` functions in clippy doc lintsAlex Macleod-1/+16
2023-09-12Merge commit '98363cbf6a7c3f8b571a7d92a3c645bb4376e4a6' into clippyupPhilipp Krones-1189/+2732
2023-09-12Auto merge of #115689 - Alexendoo:clippy-doc-comments, ↵bors-30/+99
r=notriddle,Manishearth,flip1995 Reuse rustdoc's doc comment handling in Clippy Moves `source_span_for_markdown_range` and `span_of_attrs` (renamed to `span_of_fragments`) to `rustc_resolve::rustdoc` so it can be used in Clippy Fixes https://github.com/rust-lang/rust-clippy/issues/10277 Fixes https://github.com/rust-lang/rust-clippy/issues/5593 Fixes https://github.com/rust-lang/rust-clippy/issues/10263 Fixes https://github.com/rust-lang/rust-clippy/issues/2581
2023-09-10Call `LateLintPass::check_attribute` from `with_lint_attrs`Alex Macleod-7/+21
2023-09-08Reuse rustdoc's doc comment handling in ClippyAlex Macleod-30/+99
2023-09-08Partially outline code inside the panic! macroJohn Kåre Alsaker-16/+20
2023-09-04Adjust clippy tests with new rustc help suggestion for lintsUrgau-0/+838
2023-09-03Stabilize the Saturating type (saturating_int_impl, gh-87920)Michael Watzko-1/+1
Also stabilizes saturating_int_assign_impl, gh-92354. And also make pub fns const where the underlying saturating_* fns became const in the meantime since the Saturating type was created.
2023-09-01[`clippy`] Use symbols intended for `arithmetic_side_effects`Caio-2/+42
2023-08-29Bump ui_testOli Scherer-16/+16
2023-08-24Merge commit '080b587854a73f2a8cbaecff1884860a78e2ff37' into clippyupPhilipp Krones-9519/+15381
2023-08-23Fix clippy lint for identical `if`/`else` contraining `?` expressionsEsteban Küber-2/+21
Follow up to #114819.
2023-08-17Auto merge of #11314 - GuillaumeGomez:needless_ref_mut_async_block, r=Centri3bors-1/+48
Correctly handle async blocks for NEEDLESS_PASS_BY_REF_MUT Fixes https://github.com/rust-lang/rust-clippy/issues/11299. The problem was that the `async block`s are popping a closure which we didn't go into, making it miss the mutable access to the variables. cc `@Centri3` changelog: none
2023-08-17Auto merge of #11070 - y21:issue11065, r=flip1995bors-10/+57
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro Fixes #11065 (which is actually two issues: an ICE and a false positive) It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616836099). It *also* makes sure that the expression is not part of a macro call (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616919639). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore) changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP) r? `@llogiq` (reviewed #10814, which introduced these issues)
2023-08-14bless clippy testEsteban Küber-21/+2
2023-08-11Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyupPhilipp Krones-132/+846
2023-08-10Revert "New lint [`filter_map_bool_then`]"Catherine Flores-122/+0
This reverts commits 978b1daf99d8326718684381704902fdaaf71b18 and 3235d9d612909bc64550eea3a0d387e1187e93dd.
2023-08-03Auto merge of #108955 - Nilstrieb:dont-use-me-pls, r=oli-obkbors-0/+1
Add `internal_features` lint Implements https://github.com/rust-lang/compiler-team/issues/596 Also requires some more test blessing for codegen tests etc `@jyn514` had the idea of just `allow`ing the lint by default in the test suite. I'm not sure whether this is a good idea, but it's definitely one worth considering. Additional input encouraged.
2023-08-03Add `internal_features` lintNilstrieb-0/+1
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-01Rename incorrect_fn_null_checks to useless_ptr_null_checks (clippy side)Urgau-5/+5
2023-07-31Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyupPhilipp Krones-634/+4092
2023-07-30Rollup merge of #112655 - WaffleLapkin:must_use_map_or, r=workingjubileeMatthias Krüger-2/+2
Mark `map_or` as `#[must_use]` I don't know what else to say. r? libs
2023-07-30Mark `map_or` as `#[must_use]`Maybe Waffle-2/+2
2023-07-29Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstriebbors-5/+5
Rename and allow `cast_ref_to_mut` lint This PR is a small subset of https://github.com/rust-lang/rust/pull/112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`). BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until https://github.com/rust-lang/rust/pull/112431 is merged. r? `@Nilstrieb`
2023-07-29Auto merge of #111916 - fee1-dead-contrib:noop-method-call-warn, ↵bors-12/+14
r=compiler-errors make `noop_method_call` warn by default r? `@compiler-errors`
2023-07-28Auto merge of #114134 - fee1-dead-contrib:rm-constness-from-param-env, r=oli-obkbors-7/+2
Remove `constness` from `ParamEnv` This should be replaced by keyword generics/effects. cc #110395 r? `@oli-obk`
2023-07-27bless clippyDeadbeef-7/+2
2023-07-26Unite bless environment variables under `RUSTC_BLESS`Trevor Gross-1/+3
Currently, Clippy, Miri, Rustfmt, and rustc all use an environment variable to indicate that output should be blessed, but they use different variable names. In order to improve consistency, this patch applies the following changes: - Emit `RUSTC_BLESS` within `prepare_cargo_test` so it is always available - Change usage of `MIRI_BLESS` in the Miri subtree to use `RUSTC_BLESS` - Change usage of `BLESS` in the Clippy subtree to `RUSTC_BLESS` - Change usage of `BLESS` in the Rustfmt subtree to `RUSTC_BLESS` - Adjust the blessable test in `rustc_errors` to use this same convention - Update documentation where applicable Any tools that uses `RUSTC_BLESS` should check that it is set to any value other than `"0"`.
2023-07-25bless moreRalf Jung-4/+4
2023-07-23fixDeadbeef-12/+14
2023-07-17Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyupPhilipp Krones-1378/+2933
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-3/+3