-
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
Update Clippy #74792
Update Clippy #74792
Conversation
The "use .next()" replacement advice is on the last line of the code snippet, where it is vulnerable to truncation. Display that advice at the beginning instead. closes rust-lang#5783
Closes rust-lang#2277 This was fixed when we fixed rust-lang#2542.
This lint catches cases where the last statement of a closure expecting an instance of Ord has a trailing semi-colon. It compiles since the closure ends up return () which also implements Ord but causes unexpected results in cases such as sort_by_key. Fixes rust-lang#5080 reprise: rebase, update and address all concerns
Reprise: new lint: Unintentional return of unit from closures expecting Ord This lint catches cases where the last statement of a closure expecting an instance of Ord has a trailing semi-colon. It compiles since the closure ends up return () which also implements Ord but causes unexpected results in cases such as sort_by_key. Fixes rust-lang#5080 Reprise of rust-lang#5348 where I addressed all the comments there changelog: add lint [`unit_return_expecting_ord`]
improve advice in iter_nth_zero fixes rust-lang#5783 *Please keep the line below* changelog: For iter_nth_zero, the "use .next()" replacement advice is on the last line of the code snippet, where it is vulnerable to truncation. Display that advice at the beginning instead.
Add test for `needless_range_loop` issue Closes rust-lang#2277 This was fixed when we fixed rust-lang#2542. changelog: none
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
Rustup r? @ghost changelog: none
…1995 Removing RHS snippet from SHADOW_UNRELATED message. Fixes rust-lang#5703 I am not sure if I reinvented the wheel here, but I could not really find a snippet function that did this truncation, so I created the function. Please tell me if there was a more obvious way to do this, I am new here. 😄 changelog: Truncates multi-line RHS in shadow_unrelated message if it has more than 5 lines.
Backport remerge rust-1.44.1 r? @ghost changelog: none
Since the beta/ directory already exists, we can't copy the complete master dir
Fix deploy script for beta deployment Since the `beta/` directory already exists, we can't copy the complete `master` dir changelog: none
Changelog [Rendered](https://github.com/flip1995/rust-clippy/blob/changelog/CHANGELOG.md) changelog: none
It's intended only for very temporary use.
…atthiaskrgr redundant_closure_call - don't lint when used more than once Fixes rust-lang#3354. changelog: fix redundant_closure_call false positive when closure called more than once
"Redundant" clones of `ManuallyDrop` are sometimes used for the side effect of invoking the clone, without running the drop implementation of the inner type. In other words, they aren't really redundant. For example, futures-rs crate: ```rust #[allow(clippy::redundant_clone)] // The clone here isn't actually redundant. unsafe fn increase_refcount<T: ArcWake>(data: *const ()) { // Retain Arc, but don't touch refcount by wrapping in ManuallyDrop let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T)); // Now increase refcount, but don't drop new refcount either let _arc_clone: mem::ManuallyDrop<_> = arc.clone(); } ``` Ignore redundant clone lint for ManuallyDrop.
…arth Ignore not really redundant clones of ManuallyDrop "Redundant" clones of `ManuallyDrop` are sometimes used for the side effect of invoking the clone, without running the drop implementation of the inner type. In other words, they aren't really redundant. For example, futures-rs crate: ```rust #[allow(clippy::redundant_clone)] // The clone here isn't actually redundant. unsafe fn increase_refcount<T: ArcWake>(data: *const ()) { // Retain Arc, but don't touch refcount by wrapping in ManuallyDrop let arc = mem::ManuallyDrop::new(Arc::<T>::from_raw(data as *const T)); // Now increase refcount, but don't drop new refcount either let _arc_clone: mem::ManuallyDrop<_> = arc.clone(); } ``` changelog: Ignore redundant clone lint for ManuallyDrop.
This commit modifies the `substitute_normalize_and_test_predicates` query, renaming it to `impossible_predicates` and only checking predicates which do not require substs. By making this change, polymorphization doesn't have to explicitly support vtables. Signed-off-by: David Wood <david@davidtw.co>
trait_sel: only test predicates w/ no substs r? @ghost changelog: none
…earth Update Usage section of README.md Fixes rust-lang#5826 changelog: none
Use `(std::)f64::EPSILON` in the examples as suggested in the lints `float_cmp(_const)` suggests using `{f32|f64}::EPSILON` and it'd be great if the docs mentioned it. changelog: none
…=yaahc Fix FP `useless_conversion` Fix rust-lang#5833. changelog: none
@bors r+ p=1 |
📌 Commit e4e1b8c has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Somehow this caused a massive speedup? https://perf.rust-lang.org/compare.html?start=62392966a3937362146d7228444c8d843d972857&end=6c8927b0cf80ceee19386026cf9d7fd4fd9d486f&stat=instructions:u Am I misunderstanding something? |
See rust-lang/rustc-perf#728, some upstream (rustc-perf) work landed right before this commits benchmark. |
Biweekly Clippy Sync
r? @Manishearth