about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-03-10make `never_loop` applicability more flexiblelapla-cogito-1/+172
2025-02-20Rustup (#14262)Philipp Krones-1646/+2624
r? @ghost changelog: none
2025-02-20Rustup: fix 32bit testsPhilipp Krones-48/+72
2025-02-20Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-13445/+30256
2025-02-19add `owned_cow` lintAndre Bogus-95/+184
2025-02-19fix: `map_entry` FP on struct member (#14151)Catherine Flores-0/+46
fixes #13934 I modified the part for checking if the map is used so that it can check field and index exprs. changelog: [`map_entry`]: fix FP on struct member
2025-02-19`.last()` to `.next_back()` requires a mutable receiver (#14140)Catherine Flores-13/+208
In the case where `iter` is a `DoubleEndedIterator`, replacing a call to `iter.last()` (which consumes `iter`) by `iter.next_back()` (which requires a mutable reference to `iter`) cannot be done when `iter` is a non-mutable binding which is not a mutable reference. When possible, a local immutable binding is made into a mutable one. Also, the applicability is switched to `MaybeIncorrect` and a note is added to the output when the element types have a significant drop, because the drop order will potentially be modified because `.next_back()` does not consume the iterator nor the elements before the last one. Fix #14139 changelog: [`double_ended_iterator_last`]: do not trigger on non-reference immutable receiver, and warn about possible drop order change
2025-02-19`double_ended_iterator_last`: note when drop order is changedSamuel Tardieu-2/+75
`iter.last()` will drop all elements of `iter` in order, while `iter.next_back()` will drop the non-last elements of `iter` when `iter` goes out of scope since `.next_back()` does not consume its argument. When the transformation proposed by `double_ended_iterator_last` would concern an iterator whose element type has a significant drop, a note is added to warn about the possible drop order change, and the suggestion is switched from `MachineApplicable` to `MaybeIncorrect`.
2025-02-19fix: `map_entry` FP on struct memberyanglsh-0/+46
2025-02-18`.last()` to `.next_back()` requires a mutable receiverSamuel Tardieu-13/+135
In the case where `iter` is a `DoubleEndedIterator`, replacing a call to `iter.last()` (which consumes `iter`) by `iter.next_back()` (which requires a mutable reference to `iter`) cannot be done when `iter` Is not a mutable binding or a mutable reference. When `iter` is a local binding, it can be made mutable by fixing its definition site.
2025-02-17fix: `needless_option_as_deref` FP in trait (#14210)Alejandra González-0/+26
fixes #14148 Another case of #13077 and #8646 changelog: [`needless_option_as_deref`]: fix FP in trait
2025-02-17`manual_ok_err`: blockify the replacement of an `else if …`Samuel Tardieu-1/+39
If the part being replaced is an `if` expression following an `else`, the replacement expression must be blockified.
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-16`ui_test` annotation cleanup (#14232)Alex Macleod-355/+340
Cleans up some changes from https://github.com/rust-lang/rust-clippy/pull/11421 I searched for any `.stderr` files where the number of errors changed and reverted + manually added the annotations for them Also fixes `tests/ui/asm_syntax_not_x86.rs` r? @flip1995 changelog: none
2025-02-16`ui_test` annotation cleanupAlex Macleod-355/+340
2025-02-16add `manual_contains` lintlapla-cogito-25/+310
2025-02-15fGuillaume Gomez-2/+2
2025-02-15Better handle 32bit/64bit-specific ui testsGuillaume Gomez-143/+155
2025-02-15Fix `tests/ui/transmute_32bit.rs` annotationsGuillaume Gomez-4/+4
2025-02-15Fix 32 bits testsSamuel Tardieu-63/+81
2025-02-15Fix `tests/ui-toml/absolute_paths/absolute_paths_2015.rs` testGuillaume Gomez-2/+18
2025-02-15Add missing ui annotations to new ui testsGuillaume Gomez-2/+8
2025-02-15Disable mandatory annotations for `ui-internals` tests for now until we find ↵Guillaume Gomez-1/+1
a solution for `tests/ui-internal/custom_ice_message.rs`
2025-02-15Don't make ui test annotations madatory for `ui-cargo`Guillaume Gomez-6/+10
2025-02-15Update ui-toml testsGuillaume Gomez-413/+888
2025-02-15Make fmt (weirdly) happyGuillaume Gomez-548/+1647
2025-02-15Fix new tests updatesGuillaume Gomez-7822/+5989
2025-02-15Make `if_let_mutex` test pass on both 2021 and 2024 editionsGuillaume Gomez-8/+6
2025-02-15Add manual annotationsGuillaume Gomez-6/+9
2025-02-15Handle compilation error in `builtin_type_shadow.rs`Guillaume Gomez-2/+1
2025-02-15Allowed `clippy::tests/ui/attrs.2.fixed` in `tests/ui/attr.rs` because when ↵Guillaume Gomez-44/+2
adding annotations, it doesn't work anymore
2025-02-15Update UI testsGuillaume Gomez-15122/+28709
2025-02-15Make UI tests annotations mandatoryGuillaume Gomez-1/+1
2025-02-15Fix `used_underscore_items` lint uses of foreign functions (#14205)Jason Newcomb-0/+10
Fixed #14156 changelog: none
2025-02-15`unnecessary_map_or`: do not consume the comparison value if it does not ↵Jason Newcomb-1/+37
implement `Copy` (#14207) Fix #14201 changelog: [`unnecessary_map_or`]: do not consume the comparison value if it does not implement `Copy`
2025-02-14doc_link_code: add check for links with code spans that render weird (#14121)Catherine Flores-0/+228
This is the lint described at https://github.com/rust-lang/rust/pull/136308#issuecomment-2625485331 that recommends using HTML to nest links inside code. changelog: [`doc_link_code`]: warn when a link with code and a code span are back-to-back
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-29/+18
2025-02-13Fix `literal_string_with_formatting_args` lint emitted when it should not ↵Timo-14/+98
(#13953) Fixes #13885. Fixes https://github.com/rust-lang/rust-clippy/issues/14007. Problem was that I forgot to check whether or not the `span` was a "real" one. Because if not, then it starts pointing to pretty much only wrong content, hence the problems we saw with clippy linting on `clippy.toml`. changelog: Fix `literal_string_with_formatting_args` lint emitted when it should not r? @samueltardieu
2025-02-13`unnecessary_map_or`: do not consume the non-`Copy` comparison valueSamuel Tardieu-1/+37
2025-02-13rustc_tools_util: Change release channel default to stableSebastian Jeltsch-0/+6
Fixes the exposed release channel Bump version to 0.4.1
2025-02-13fix: `needless_option_as_deref` FP in traityanglsh-0/+26
2025-02-12New lint: `mem_replace_option_with_some` (#14197)llogiq-1/+66
`mem::replace(opt, Some(v))` can be replaced by `opt.replace(v)`. Close #14195 changelog: [`mem_replace_option_with_some`]: new lint
2025-02-12New lint: `mem_replace_option_with_some`Samuel Tardieu-1/+66
`mem::replace(opt, Some(v))` can be replaced by `opt.replace(v)`.
2025-02-13Fix `used_underscore_items` lint uses of foreign functionsWeiTheShinobi-0/+10
2025-02-12New lint: `unbuffered_bytes` (#14089)Jason Newcomb-6/+79
Checks for `Read::bytes()` on an unbuffered Read type. The default implementation calls `read` for each byte, which can be very inefficient for data that’s not in memory, such as `File`. Considerations which I'd like to have feedback on: * Currently this lint triggers when `.bytes()` is called on any type that implements `std::io::Read` but not `std::io::BufRead`. This is quite aggressive and in and may result in false positives. Alternatives: * Only trigger on concrete types, not generic types. This does mean that cases where a function is generic over a `R: Read` and calls `.bytes()` are not caught by the lint, which could be quite a nasty case of this bug. * Only trigger on an allowlist of stdlib types * Compromise: Is it possible to make this lint `pedantic` on types that are not on a allowlist? * Theoretically, a trait implementation of `Read` could override `.bytes()` with an efficient implementation. I'm not sure how to add this check to the lint, and I can't find any cases of this being done in practice. * I don't think an automatic fix for this lint is possible, but I'd love to be proven wrong * This is my first time contributing to clippy, please let me know if I did anything wrong Fixes #14087 ``` changelog: [`unbuffered_bytes`]: new lint ```
2025-02-12add index checks for the slice in `manual_slice_fill` (#14193)Jason Newcomb-2/+34
fix #14192 changelog: [`manual_slice_fill`]: resolve FP caused by missing index checks for the slice
2025-02-12New lint: `unbuffered_bytes`jonathan-6/+79
2025-02-11`{expect,unwrap}_used`: add options to lint at compilation timeSamuel Tardieu-3/+80
By default, do not lint `.unwrap()` and `.expect(…)` in always const contexts, as a failure would be detected at compile time anyway. New options `allow_expect_in_consts` and `allow_unwrap_in_consts`, defaulting to `true`, can be turned unset to still lint in always const contexts.
2025-02-11just_underscores_and_digits: fix false positive in error recovery scenario ↵Alejandra González-0/+29
(#14168) Fixes #12302 changelog: [`just_underscores_and_digits`]: fix false positive in error recovery scenario
2025-02-11just_underscores_and_digits: ignore empty identMichael Howell-0/+29
Empty idents come from error recovery, and should imply that a better error has already been emitted.