-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Clippy #101609
Update Clippy #101609
Conversation
For consistency, and because it makes HIR measurement simpler and more accurate.
For consistency, and because it makes HIR measurement simpler and more accurate.
This reverts commit 3266460. This is the revert against master, the beta revert was already done in rust-lang#100538.
…fJung Strengthen invalid_value lint to forbid uninit primitives, adjust docs to say that's UB For context: rust-lang#66151 (comment) This does not make it a FCW, but it does explicitly state in the docs that uninit integers are UB. This also doesn't affect any runtime behavior, uninit u32's will still successfully be created through mem::uninitialized.
match_wild_err_arm: Fix typo in note text changelog: [`match_wild_err_arm`]: fix typo in note text
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#100787 (Pretty printing give proper error message without panic) - rust-lang#100838 (Suggest moving redundant generic args of an assoc fn to its trait) - rust-lang#100844 (migrate rustc_query_system to use SessionDiagnostic) - rust-lang#101140 (Update Clippy) - rust-lang#101161 (Fix uintended diagnostic caused by `drain(..)`) - rust-lang#101165 (Use more `into_iter` rather than `drain(..)`) - rust-lang#101229 (Link “? operator” to relevant chapter in The Book) - rust-lang#101230 (lint: avoid linting diag functions with diag lints) - rust-lang#101236 (Avoid needless buffer zeroing in `std::sys::windows::fs`) - rust-lang#101240 (Fix a typo on `wasm64-unknown-unknown` doc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Correctly handle unescape warnings fixes rust-lang#9405 changelog: Fix ICE when format literals raise compiler warnings
Fix `suboptimal_float` not linting on `{const}.powf({const})` There used to be an early return if the receiver was an effective const but the method was not linted, not taking into account later cases where the receiver and the arguments are both effective consts for different methods. Removed the early return. Fixes rust-lang#9402 Fixes rust-lang#9201 changelog: Fix `suboptimal_flops`, `imprecise_flops` not linting on `{const}.powf({const})` et al
…ednet New lint `bool_to_int_with_if` This is a rebased version of rust-lang/rust-clippy#9086 I could sadly not push directly push to the PR branch as it's protected. The lint implementation comes from `@jst-r.` Thank you for the work you put into this :) --- Closes: rust-lang/rust-clippy#8131 Closes: rust-lang/rust-clippy#9086 changelog: Add lint [`bool_to_int_with_if`] r? `@ghost`
… late-bound lifetimes.
Don't use `hir_ty_to_ty` in `result_large_err` fixes rust-lang#9414 This occurs starting with 2022-09-01. I checked that this does fix the ICE on rust-lang/rust@9353538. Not sure which pr caused the late-bound region to leak through `hir_ty_to_ty`. changelog: None
Fix `mut_mutex_lock` when Mutex is behind immutable deref I *think* the problem here is the `if let ty::Ref(_, _, Mutability::Mut) = cx.typeck_results().expr_ty(recv).kind()` line tries to check if the `Mutex` can be mutably borrowed (there already is a test for `Arc<Mutex<_>>`), but gets bamboozled by the `&mut Arc` indirection. And I *think* checking the deref-adjustment to filter immutable-adjust (the deref through the `Arc`, starting from `&mut Arc`) is the correct fix. Fixes rust-lang#9415 changelog: Fix `mut_mutex_lock` when Mutex is behind immutable deref
add `--explain` subcommand This closes rust-lang#8291. --- changelog: add `cargo clippy -- --explain <lintname>` subcommand
Use `approx_ty_size` for `large_enum_variant` This builds upon rust-lang#9373 to use the approximate size of each variant for `large_enum_variant`. This allows us to lint in situations where an `enum` contains generics but is still guaranteed to have a large variant on an at-least basis, e.g. with `(T, [u8; 512])`. * I've changed the wording from "is ... bytes" to "contains at least" because * the size is now an approximate lower bound (e.g. `512` in the example above). The actual size is larger due to `T`, including due to `T`'s memory layout. * the discriminant is not taken into account in the message. This comes up with variants like `A(T)`, which are "is at least 0 bytes" otherwise, which may be misleading. * If the second-largest variant has no fields, there is a special case "carries no data" instead of "is at least 0 bytes". * A variant like `A(T)` is "at least 0 bytes", which is technically true, yet we don't distinguish between "indeterminate" and truly "ZST". * The generics-tests that were there before now lint while they didn't lint before. AFAICS this is correct. I guess the above is correct-ish. However, I use the `SubstsRef` that I got via `cx.tcx.type_of(item.def_id)` to solve for generics in the variants. Is this even applicable, since we start from an - [ ] `ItemKind`? changelog: none
Fixes rust-lang#9351. Note that this commit reworks that fix for rust-lang#9317. The change is to check that the type implements `AsRef<str>` before regarding `to_string` as an equivalent of `to_owned`. This was suggested by Jarcho in the rust-lang#9317 issue comments. The benefit of this is that it moves some complexity out of `check_other_call_arg` and simplifies the module as a whole.
Fix `unnecessary_to_owned` false positive Fixes rust-lang#9351. Note that this commit reworks that fix for rust-lang#9317. The change is to check that the type implements `AsRef<str>` before regarding `to_string` as an equivalent of `to_owned`. This was suggested by Jarcho in the rust-lang#9317 issue comments. The benefit of this is that it moves some complexity out of `check_other_call_arg` and simplifies the module as a whole. changelog: FP: [`unnecessary_to_owned`]: No longer lints, if type change would cause errors in the caller function
Fixes rust-lang#9431. The current `range_plus_one` and `range_minus_one` suggestions are completely incorrect when macros are involved. This commit resolves this by disabling the lints for any range expression that is expanded from a macro. The reasons for this are that it is very difficult to create a correct suggestion in this case and that false negatives are less important for pedantic lints.
Rustup r? `@ghost` changelog: none
Fix `range_{plus,minus}_one` bad suggestions Fixes rust-lang#9431. The current `range_plus_one` and `range_minus_one` suggestions are completely incorrect when macros are involved. This commit resolves this by disabling the lints for any range expression that is expanded from a macro. The reasons for this are that it is very difficult to create a correct suggestion in this case and that false negatives are less important for pedantic lints. changelog: Fix `range_{plus,minus}_one` bad suggestions
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@bors r+ p=1 |
⌛ Testing commit ce03f15 with merge 0687bc2c8b2ba329fb7e5db12fe6a69634ec2f98... |
💥 Test timed out |
@bors retry arm timeout |
@bors retry 🦾 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (87eb3e2): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
r? @Manishearth