about summary refs log tree commit diff
path: root/tests/ui-toml
AgeCommit message (Collapse)AuthorLines
2025-02-20Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-397/+1050
2025-02-15Fix `tests/ui-toml/absolute_paths/absolute_paths_2015.rs` testGuillaume Gomez-2/+18
2025-02-15Update ui-toml testsGuillaume Gomez-413/+888
2025-02-11`{expect,unwrap}_used`: add options to lint at compilation timeSamuel Tardieu-3/+69
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-10Show diff suggestion format on verbose replacementEsteban Küber-56/+85
``` 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-08Two improvements to `disallowed_*` (#13669)Catherine Flores-16/+112
The improvements are as follows: - Remove an [unnecessary `compile-flags` directive](https://github.com/rust-lang/rust-clippy/blob/f712eb5cdccd121d0569af12f20e6a0fabe4364d/tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs#L1) in `tests/ui-toml/toml_disallowed_methods/conf_disallowed_methods.rs` - Support replacements as suggested by @mitsuhiko in https://github.com/rust-lang/rust-clippy/issues/7609#issuecomment-908632622 --- changelog: support replacements in `disallowed_methods`
2025-01-09Merge commit '19e305bb57a7595f2a8d81f521c0dd8bf854e739' into ↵Philipp Krones-0/+239
clippy-subtree-update
2025-01-09Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-0/+239
2025-01-03turn rustc_box into an intrinsicRalf Jung-9/+8
2024-12-27Make `inconsistent_struct_constructor` "all fields are shorthand" ↵Timo-0/+239
requirement configurable (#13737) Fixes #11846. This PR has three commits: - The first commit adds an `initializer-suggestions` configuration to control suggestion applicability when initializers are present. The following are the options: - "none": do not suggest - "maybe-incorrect": suggest, but do not apply suggestions with `--fix` - "machine-applicable": suggest and apply suggestions with `--fix` - The second commit fixes suggestions to handle field attributes (problem [noticed by @samueltardieu](https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1859261645)). - The third commit adds `initializer-suggestions = "machine-applicable"` to Clippy's `clippy.toml` and applies the suggestions. (Nothing seems to break.) --- changelog: make `inconsistent_struct_constructor` "all fields are shorthand" requirement configurable
2024-12-26Make "all fields are shorthand" requirement configurableSamuel Moelius-0/+239
Handle field attributes in suggestions Fix adjacent code Address review comments https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1861352124 Address all review comments but one This comment is not yet addressed: https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1874544907 `initializer_suggestions` -> `lint_inconsistent_struct_field_initializers`
2024-12-26Merge commit '609cd310be44677ae31d452a17b0f8207e1abfe1' into ↵Philipp Krones-12/+70
clippy-subtree-update
2024-12-19Add allow-indexing-slicing-in-tests option (#13854)llogiq-0/+35
Close #13842 changelog: [`indexing_slicing`]: add allow-indexing-slicing-in-tests option to be able ignore at test
2024-12-20Add allow-indexing-slicing-in-tests optionAlexey Semenyuk-0/+35
2024-12-15Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-12/+35
2024-12-12Filter empty lines, comments and delimiters from previous to last multiline ↵Esteban Küber-4/+0
span rendering
2024-12-12Tweak multispan renderingEsteban Küber-2/+1
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-03index_refutable_slice: use multipart suggestionsScott Gerring-9/+31
2024-11-22Rename `literal_string_with_formatting_arg` into ↵Guillaume Gomez-1/+1
`literal_string_with_formatting_args`
2024-11-22Update new failing testsGuillaume Gomez-3/+4
2024-11-15Add const parameter `REPLACEMENT_ALLOWED` to `DisallowedPath`Samuel Moelius-0/+15
2024-11-15Properly handle `disallowed_types`Samuel Moelius-0/+46
2024-11-15Support replacements in `disallowed_methods`Samuel Moelius-0/+37
2024-11-15Remove unncesssary `compile-flags` directiveSamuel Moelius-16/+14
2024-11-14Merge commit '786fbd6d683933cd0e567fdcd25d449a69b4320c' into ↵Philipp Krones-1/+5
clippy-subtree-update
2024-11-09Fix `large_include_file` lint being triggered all the time by doc commentsGuillaume Gomez-1/+5
2024-11-07Merge commit 'f712eb5cdccd121d0569af12f20e6a0fabe4364d' into ↵Philipp Krones-35/+1403
clippy-subtree-update
2024-11-07Merge pull request #13657 from jdonszelmann/disallowed-macros-to-earlyPhilipp Krones-31/+31
collect attribute spans early for disallowed macros
2024-11-05collect attribute spans early for disallowed macrosJonathan Dönszelmann-31/+31
2024-11-02Auto merge of #13376 - decryphe:source-ordering, r=llogiqbors-0/+1351
new lint: `source_item_ordering` changelog: [`source_item_ordering`]: Introduced a new restriction lint that checks the ordering of items in Modules, Enums, Structs, Impls and Traits. From the written documentation: > Why restrict this? > Keeping a consistent ordering throughout the codebase helps with working as a team, and possibly improves maintainability of the codebase. The idea is that by defining a consistent and enforceable rule for how source files are structured, less time will be wasted during reviews on a topic that is (under most circumstances) not relevant to the logic implemented in the code. Sometimes this will be referred to as "bike-shedding". > > Keep in mind, that ordering source code alphabetically can lead to reduced performance in cases where the most commonly used enum variant isn't the first entry anymore, and similar optimizations that can reduce branch misses, cache locality and such. Either don't use this lint if that's relevant, or disable the lint in modules or items specifically where it matters. Other solutions can be to use profile guided optimization (PGO), or other advanced optimization methods. I tried to build it as configurable as possible, as such a highly opinionated lint should be adjustable to personal opinions. I'm open to any input and will be available both here and on the zulip for communication. In the meantime I'll be testing this lint against my own code-bases, which I've (manually) kept ordered with the default config, to see how well it works in practice. And lastly, a big thanks to the community for making clippy the best linter there is!
2024-10-30Extend `large_include_file` lint to also work on attributesGuillaume Gomez-4/+15
2024-10-30new lint: `source_item_ordering`decryphe-0/+1351
2024-10-27Add test case for missing_errors_doc at tests with option ↵Alexey Semenyuk-0/+6
check-private-items = true
2024-10-18Merge commit 'a109190d7060236e655fc75533373fa274ec5343' into ↵Philipp Krones-13/+5
clippy-subtree-update
2024-10-18Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-13/+5
2024-10-12Auto merge of #13444 - kpreid:fix-8524-private-rep, r=blyxyasbors-2/+2
`module_name_repetitions`: don't warn if the item is in a private module. Fixes <https://github.com/rust-lang/rust-clippy/issues/8524>. There is still a warning (as there should be) if the item is reexported by name, but not by glob; that would require further work to examine the names in the glob, and I haven't looked into that. Credit to `@Centri3` for suggesting approximately this simple fix in <https://github.com/rust-lang/rust-clippy/issues/8524#issuecomment-1729036149>. However, per later comment <https://github.com/rust-lang/rust-clippy/issues/8524#issuecomment-2035836495>, I am not making it configuration-dependent, but *always* checking public items in public modules only. changelog: [`module_name_repetitions`]: don't warn if the item is in a private module.
2024-10-05Bless clippy.Camille GILLOT-1/+3
2024-10-04Fix large_stack_arrays triggering for static/constantsGnomedDev-11/+3
2024-10-03Merge commit 'aa0d551351a9c15d8a95fdb3e2946b505893dda8' into ↵Philipp Krones-7/+8
clippy-subtree-update
2024-09-25Fix non-lifetime testsSamuel Moelius-7/+8
2024-09-24Merge commit '7901289135257ca0fbed3a5522526f95b0f5edba' into ↵Philipp Krones-9/+20
clippy-subtree-update
2024-09-23`module_name_repetitions`: don't warn if the item is in a private module.Kevin Reid-2/+2
Fixes <https://github.com/rust-lang/rust-clippy/issues/8524>. There is still a warning (as there should be) if the item is reexported by name, but not by glob; that would require further work to examine the names in the glob, and I haven't looked into that. Credit to @Centri3 for suggesting approximately this simple fix in <https://github.com/rust-lang/rust-clippy/issues/8524#issuecomment-1729036149>. However, per later comment <https://github.com/rust-lang/rust-clippy/issues/8524#issuecomment-2035836495>, I am not making it configuration-dependent, but *always* checking public items in public modules only.
2024-09-22FormattingPhilipp Krones-5/+5
2024-08-26Auto merge of #13300 - kyoto7250:issue_13292, r=llogiqbors-2/+13
check std::panic::panic_any in panic lint close #13292 This PR detects `std::panic::panic_any` in panic lint. changelog: check std::panic::panic_any in panic lint
2024-08-24Merge commit '0f8eabd6231366bfc1bb1464601297c2d48f8f68' into clippyupJason Newcomb-180/+384
2024-08-24Rewrite empty_line_after_doc_comments and empty_line_after_outer_attrAlex Macleod-2/+2
2024-08-25check std::panic::panic_any in panic lintkyoto7250-2/+13
2024-08-10Auto merge of #13220 - y21:issue13219, r=dswijbors-4/+27
[`macro_metavars_in_unsafe`]: recognize metavariables in tail expressions Fixes #13219 `macro_metavars_in_unsafe` keeps track of the current "expansion depth" (incremented/decremented when entering/leaving a macro span) to tell if an expression from the root context is contained within a macro (see the doc comment I added for a hopefully better explanation) Before this PR, we didn't increment said `expn_depth` for `unsafe` blocks within macros, because we already do that in `visit_stmt` anyway, so it would work fine for statements, but that's not enough for tail expressions of an unsafe block. So we now also increment it for macro unsafe blocks. Also updated the comment for `expn_depth` while I'm at it because "This is not necessary for correctness" isn't correct now that I think about it ------ changelog: none
2024-08-09Refactor `absolute_paths`:Jason Newcomb-176/+357
* Check the path length first * Use `is_from_proc_macro` * Use symbols instead of strings when checking crate names
2024-08-08Merge commit 'cb806113e0f83a8f9b47d35b453b676543bcc40e' into ↵Philipp Krones-75/+153
clippy-subtree-update