-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Clippy subtree update #126398
Clippy subtree update #126398
Conversation
Almost all callers want this anyway, and now we can use it to also return fed bodies
Note that semantics of repeat expr in array are the same
Make `body_owned_by` return the `Body` instead of just the `BodyId` fixes rust-lang#125677 Almost all `body_owned_by` callers immediately called `body`, too, so just return `Body` directly. This makes the inline-const query feeding more robust, as all calls to `body_owned_by` will now yield a body for inline consts, too. I have not yet figured out a good way to make `tcx.hir().body()` return an inline-const body, but that can be done as a follow-up
Make `body_owned_by` return the `Body` instead of just the `BodyId` fixes rust-lang#125677 Almost all `body_owned_by` callers immediately called `body`, too, so just return `Body` directly. This makes the inline-const query feeding more robust, as all calls to `body_owned_by` will now yield a body for inline consts, too. I have not yet figured out a good way to make `tcx.hir().body()` return an inline-const body, but that can be done as a follow-up
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#125342 (Document platform-specifics for `Read` and `Write` of `File`) - rust-lang#125711 (Make `body_owned_by` return the `Body` instead of just the `BodyId`) - rust-lang#125739 (drop_in_place: weaken the claim of equivalence with drop(ptr.read())) - rust-lang#125745 (Bump the stage0 compiler to beta.7 (2024-05-26)) - rust-lang#125746 (Fix copy-paste error in `Duration::from_weeks` panic message.) - rust-lang#125753 (compiletest: Unify `cmd2procres` with `run_command_to_procres`) - rust-lang#125754 (coverage: Rename MC/DC `conditions_num` to `num_conditions`) r? `@ghost` `@rustbot` modify labels: rollup
ignore array from `deref_addrof` lint Split from rust-lang/rust-clippy#12854 changelog: ignore array from `deref_addrof` lint r? y21
Signed-off-by: VitalikButerinEth <[email protected]>
fix: let non_canonical_impls skip proc marco Fixed rust-lang#12788 Although the issue only mentions `NON_CANONICAL_CLONE_IMPL`, this fix will also affect `NON_CANONICAL_PARTIAL_ORD_IMPL` because I saw > Because of these unforeseeable or unstable behaviors, macro expansion should often not be regarded as a part of the stable API. on Clippy Documentation and these two lints are similar, so I think it might be good, not sure if it's right or not. --- changelog: `NON_CANONICAL_CLONE_IMPL`, `NON_CANONICAL_PARTIAL_ORD_IMPL` will skip proc marco now
…nishearth Clippy subtree update r? `@Manishearth`
…r=oli-obk ScalarInt: size mismatches are a bug, do not delay the panic Cc [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Why.20are.20ScalarInt.20to.20iN.2FuN.20methods.20fallible.3F) r? ``@oli-obk``
Normalize type aliases when checking significant drops. fixes rust-lang#10750 No test as I'm not sure exactly how the type alias caused a stack overflow here. Also removes an unnecessary `HashSet`. changelog: none
Filter from first typed symbol on gh-pages Cosmetic fix Don't see the reason that now filter on gh-pages is starting work after 3 symbols typing so remove this condition Before: https://github.com/rust-lang/rust-clippy/assets/5480441/fa3b780e-30dc-4fdb-bf2d-5a99337eca4e After: https://github.com/rust-lang/rust-clippy/assets/5480441/977e15af-8be5-462c-a703-f10c05e6109c changelog: gh-pages
… r=xFrednet Handle single chars with `to_string()` for `single_char_add_str` Add support for single chars / literals with `to_string()` call for `push_str()` and `insert_str()`. changelog: [`single_char_add_str`]: handle single chars with `to_string()` call Closes rust-lang#12775
Don't lint indexing_slicing lints on proc macros This pr fixes rust-lang/rust-clippy#12824 Even though the issue mentions the indexing case only, it was easy to apply the fix to the slicing case as well. changelog: [`out_of_bounds_indexing`, `indexing_slicing`]: Don't lint on procedural macros.
…ith single_char_pattern lint
…tern, r=Alexendoo Add lint to check manual pattern char comparison This PR adds a new lint asked in rust-lang/rust-clippy#12490 This lint catches manual char comparison in pattern of string functions and propose to use `char` or array of `char` instead. As it's my first contribution i'm not feeling very safe about not matching too much or missing some cases. Thanks in advance for taking time to review and propose feedback ! changelog: new lint [`manual_pattern_char_comparison`]
Let `qualify_min_const_fn` deal with drop terminators Fixes rust-lang#12677 The `method_accepts_droppable` check that was there seemed overly conservative. > Returns true if any of the method parameters is a type that implements `Drop`. > The method can't be made const then, because `drop` can't be const-evaluated. Accepting parameters that implement `Drop` should still be fine as long as the parameter isn't actually dropped, as is the case in the linked issue where the droppable is moved into the return place. This more accurate analysis ("is there a `drop` terminator") is already done by `qualify_min_const_fn` [here](https://github.com/rust-lang/rust-clippy/blob/f5e250180c342bb52808c9a934c962a8fe40afc7/clippy_utils/src/qualify_min_const_fn.rs#L298), so I don't think this additional check is really necessary? Fixing the other, second case in the linked issue was only slightly more involved, since `Vec::new()` is a function call that has the ability to panic, so there must be a `drop()` terminator for cleanup, however we should be able to freely ignore that. [Const checking ignores cleanup blocks](https://github.com/rust-lang/rust/blob/master/compiler/rustc_const_eval/src/transform/check_consts/check.rs#L382-L388), so we should, too? r? `@Jarcho` ---- changelog: [`missing_const_for_fn`]: continue linting on fns with parameters implementing `Drop` if they're not actually dropped
Fix typos of author lint changelog: none
Rustup r? `@ghost` changelog: none
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@bors r+ p=1 |
@bors p=10 yeet! (over the rollup) |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f158600): 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)Results (primary 1.2%)This 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.
CyclesResults (primary 2.9%)This 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.
Binary sizeResults (secondary -0.0%)This 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.
Bootstrap: 671.147s -> 671.518s (0.06%) |
…nishearth Clippy subtree update r? `@Manishearth` Updates `Cargo.lock` with Clippy version bump.
r? @Manishearth
Updates
Cargo.lock
with Clippy version bump.