about summary refs log tree commit diff
path: root/src/tools/clippy/tests
AgeCommit message (Collapse)AuthorLines
2025-06-27Merge commit 'c5dbd1de07e0407b9687619a868384d6de06253f' into ↵Philipp Krones-135/+1638
clippy-subtree-update
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-8/+8
2025-06-19Auto merge of #140748 - m-ou-se:super-format-args3, r=jdonszelmannbors-52/+47
Allow storing `format_args!()` in variable Fixes https://github.com/rust-lang/rust/issues/92698 Tracking issue for super let: https://github.com/rust-lang/rust/issues/139076 Tracking issue for format_args: https://github.com/rust-lang/rust/issues/99012 This change allows: ```rust let name = "world"; let f = format_args!("hello {name}!"); // New: Store format_args!() for later! println!("{f}"); ``` This will need an FCP. This implementation makes use of `super let`, which is unstable and might not exist in the future in its current form. However, it is entirely reasonable to assume future Rust will always have _a_ way of expressing temporary lifetimes like this, since the (stable) `pin!()` macro needs this too. (This was also the motivation for merging https://github.com/rust-lang/rust/pull/139114.) (This is a second version of https://github.com/rust-lang/rust/pull/139135)
2025-06-18Rollup merge of #141610 - BoxyUwU:stabilize_generic_arg_infer, ↵Jakub Beránek-11/+10
r=lcnr,traviscross Stabilize `feature(generic_arg_infer)` Fixes rust-lang/rust#85077 r? lcnr cc ````@rust-lang/project-const-generics````
2025-06-18Update/bless clippy tests.Mara Bos-52/+47
2025-06-16clippy: `{Meta,Pointee,}Sized` in non-minicoreDavid Wood-2/+8
One clippy test is `no_core` and needs to have `MetaSized` and `PointeeSized` added to it.
2025-06-14Rollup merge of #141811 - mejrs:bye_locals, r=compiler-errorsMatthias Krüger-11/+5
Unimplement unsized_locals Implements https://github.com/rust-lang/compiler-team/issues/630 Tracking issue here: https://github.com/rust-lang/rust/issues/111942 Note that this just removes the feature, not the implementation, and does not touch `unsized_fn_params`. This is because it is required to support `Box<dyn FnOnce()>: FnOnce()`. There may be more that should be removed (possibly in follow up prs) - the `forget_unsized` function and `forget` intrinsic. - the `unsized_locals` test directory; I've just fixed up the tests for now - various codegen support for unsized values and allocas cc ``@JakobDegen`` ``@oli-obk`` ``@Noratrieb`` ``@programmerjake`` ``@bjorn3`` ``@rustbot`` label F-unsized_locals Fixes rust-lang/rust#79409
2025-06-13Merge commit '4ef75291b5dd6739212f1f61666d19d4e086690d' into ↵Philipp Krones-256/+2911
clippy-subtree-update
2025-06-13Unimplement unsized_localsmejrs-11/+5
2025-06-11stabilize gaiBoxy-11/+10
2025-06-05Auto merge of #138677 - shepmaster:consistent-elided-lifetime-syntax, ↵bors-45/+54
r=traviscross,jieyouxu Add a new `mismatched-lifetime-syntaxes` lint The lang-team [discussed this](https://hackmd.io/nf4ZUYd7Rp6rq-1svJZSaQ) and I attempted to [summarize](https://github.com/rust-lang/rust/pull/120808#issuecomment-2701863833) their decision. The summary-of-the-summary is: - Using two different kinds of syntax for elided lifetimes is confusing. In rare cases, it may even [lead to unsound code](https://github.com/rust-lang/rust/issues/48686)! Some examples: ```rust // Lint will warn about these fn(v: ContainsLifetime) -> ContainsLifetime<'_>; fn(&'static u8) -> &u8; ``` - Matching up references with no lifetime syntax, references with anonymous lifetime syntax, and paths with anonymous lifetime syntax is an exception to the simplest possible rule: ```rust // Lint will not warn about these fn(&u8) -> &'_ u8; fn(&'_ u8) -> &u8; fn(&u8) -> ContainsLifetime<'_>; ``` - Having a lint for consistent syntax of elided lifetimes will make the [future goal](https://github.com/rust-lang/rust/issues/91639) of warning-by-default for paths participating in elision much simpler. --- This new lint attempts to accomplish the goal of enforcing consistent syntax. In the process, it supersedes and replaces the existing `elided-named-lifetimes` lint, which means it starts out life as warn-by-default.
2025-06-04Replace `elided_named_lifetimes` with `mismatched_lifetime_syntaxes`Jake Goulding-45/+54
2025-06-03Rollup merge of #141698 - oli-obk:ctfe-err-flip, r=RalfJungMatthias Krüger-3/+3
Use the informative error as the main const eval error message r? `@RalfJung` I only did the minimal changes necessary to the const eval error machinery. I'd prefer not to mix test changes with refactorings 😆
2025-06-02Clarify why we are talking about a failed const eval at a random placeOli Scherer-1/+1
2025-06-02Use the informative error as the main const eval error messageOli Scherer-3/+3
2025-06-02Auto merge of #141814 - flip1995:clippy-subtree-update, r=Manishearthbors-202/+1274
Clippy subtree update r? `@Manishearth`
2025-06-01Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=jhprattJacob Pratt-12/+10
Stabilize feature `result_flattening` Stabilizes the `Result::flatten` method ## Implementations - [x] Implementation `Result::flatten`: https://github.com/rust-lang/rust/pull/70140 - [x] Implementation `const` `Result::flatten`: https://github.com/rust-lang/rust/pull/130692 - [x] Update stabilization attribute macros (this PR) ## Stabilization process - [x] Created this PR [suggested](https://github.com/rust-lang/rust/issues/70142#issuecomment-2885044548) by ``@RalfJung`` - [x] FCP (haven't found any, is it applicable here?) - [ ] Close issue rust-lang/rust#70142
2025-05-31Merge commit '57cbadd68ac473bc50453f6b1320a02b68115f12'Philipp Krones-202/+1274
2025-05-28Stabilise `repr128`beetrees-101/+94
2025-05-22Rollup merge of #141130 - mejrs:use_self, r=compiler-errorsMatthias Krüger-1/+1
rustc_on_unimplemented cleanups Addresses some of the fixmes from https://github.com/rust-lang/rust/pull/139091 and https://github.com/rust-lang/rust/pull/140307. - switch from `_Self` to `Self` in library - properly validate that arguments in the `on` filter and the format strings are actually valid See https://github.com/rust-lang/rustc-dev-guide/pull/2357 for the relevant documentation.
2025-05-21Merge commit 'cadf98bb7d783e2ea3572446c3f80d3592ec5f86' into ↵Philipp Krones-2621/+3023
clippy-subtree-update
2025-05-17do away with `_Self` and `TraitName` and check generic params for ↵mejrs-1/+1
rustc_on_unimplemented
2025-05-16Updated feature flag and output of `clippy/tests/ui/map_flatten*`Ryan van Polen-12/+10
2025-05-15Merge commit '0450db33a5d8587f7c1d4b6d233dac963605766b' into ↵Philipp Krones-1555/+2043
clippy-subtree-update
2025-05-06Rollup merge of #139773 - thaliaarchi:vec-into-iter-last, r=workingjubileeStuart Cook-7/+46
Implement `Iterator::last` for `vec::IntoIter` Avoid iterating everything when we have random access to the last element.
2025-05-06Auto merge of #131160 - ↵bors-30/+30
ismailarilik:handle-potential-query-instability-lint-for-rustc-middle, r=oli-obk Handle `rustc_middle` cases of `rustc::potential_query_instability` lint This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_middle/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/lib.rs#L29) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors. A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447 r? `@compiler-errors`
2025-05-05Handle rustc_middle cases of rustc::potential_query_instability lintismailarilik-30/+30
2025-05-02Implement Iterator::last for vec::IntoIterThalia Archibald-7/+46
2025-05-01Merge commit '03a5b6b976ac121f4233775c49a4bce026065b47' into ↵Philipp Krones-195/+1243
clippy-subtree-update
2025-04-26Fix error message for static references or mutable referencesyuk1ty-1/+1
2025-04-24Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etcbendn-66/+79
2025-04-22Merge commit '0621446356e20fd2ead13a6763bb936c95eb0cfa' into ↵Philipp Krones-2709/+8010
clippy-subtree-update
2025-03-30Drop `clippy::invalid_null_ptr_usage`Urgau-575/+21
2025-03-20Merge commit '1e5237f4a56ae958af7e5824343eacf737b67083' into ↵Philipp Krones-503/+3105
clippy-subtree-update
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-16/+0
For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros.
2025-03-11Implement `#[define_opaque]` attribute for functions.Oli Scherer-11/+5
2025-02-28Clippy: skip check_host_compiler check in rustc testsuitePhilipp Krones-0/+5
This test only makes sense to run in the Clippy repo In the Rust repo the name of the host_compiler is dev, not nightly
2025-02-28Merge commit '9f9a822509e5ad3e560cbbe830d1013f936fca28' into ↵Philipp Krones-14004/+31921
clippy-subtree-update
2025-02-24simplify must-use lint slightlyJana Dönszelmann-29/+40
2025-02-24Fix rustdoc and clippyJana Dönszelmann-13/+15
2025-02-21Trim suggestion part before generating highlightsMichael Goulet-24/+20
2025-02-21More sophisticated span trimmingMichael Goulet-121/+80
2025-02-17Move some `Map` methods onto `TyCtxt`.Nicholas Nethercote-4/+4
The end goal is to eliminate `Map` altogether. I added a `hir_` prefix to all of them, that seemed simplest. The exceptions are `module_items` which became `hir_module_free_items` because there was already a `hir_module_items`, and `items` which became `hir_free_items` for consistency with `hir_module_free_items`.
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-29/+18
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-1500/+2292
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-07add tests for spurious failure and fix typoJana Dönszelmann-21/+49
2025-02-07fix empty after lint on impl/trait itemsJonathan Dönszelmann-1/+40
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-02-07Update UI testsGuillaume Gomez-24/+26
2025-02-06Merge commit '3e3715c31236bff56f1c63a1de2c7bbdfcfb0923' into ↵Philipp Krones-249/+1527
clippy-subtree-update
2025-01-28Merge commit '51d49c1ae2785b24ef18a46ef233fc1d91844666' into ↵Philipp Krones-364/+4048
clippy-subtree-update