rust icon indicating copy to clipboard operation
rust copied to clipboard

Add detection of [Partial]Ord methods in the `ambiguous_wide_pointer_comparisons` lint

Open Urgau opened this issue 1 year ago • 3 comments
trafficstars

Partially addresses https://github.com/rust-lang/rust/issues/121264 by adding diagnostics items for PartialOrd and Ord methods, detecting such diagnostics items as "binary operation" and suggesting the correct replacement.

I also took the opportunity to change the suggestion to use new methods .cast() on *mut T an d *const T.

Urgau avatar Feb 18 '24 14:02 Urgau

r? @estebank

rustbot has assigned @estebank. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Feb 18 '24 14:02 rustbot

:umbrella: The latest upstream changes (presumably #119673) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Feb 18 '24 23:02 bors

@estebank ping.

Urgau avatar Mar 11 '24 13:03 Urgau

r? compiler

Urgau avatar Mar 15 '24 10:03 Urgau

r? @Nadrieril (as discussed privately)

Urgau avatar Mar 26 '24 11:03 Urgau

I've addressed all the review comments and CI passes; this is ready.

@rustbot ready

Urgau avatar Mar 29 '24 16:03 Urgau

Thanks!

@bors r+

Nadrieril avatar Mar 29 '24 18:03 Nadrieril

:pushpin: Commit d4b514f982e4214e0f9237c905670b1207ae0c95 has been approved by Nadrieril

It is now in the queue for this repository.

bors avatar Mar 29 '24 18:03 bors

:hourglass: Testing commit d4b514f982e4214e0f9237c905670b1207ae0c95 with merge af4a5a13a15fa0c60e06321077ef452f769b42fd...

bors avatar Mar 29 '24 18:03 bors

:sunny: Test successful - checks-actions Approved by: Nadrieril Pushing af4a5a13a15fa0c60e06321077ef452f769b42fd to master...

bors avatar Mar 29 '24 20:03 bors

Finished benchmarking commit (af4a5a13a15fa0c60e06321077ef452f769b42fd): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
-0.5% [-0.7%, -0.3%] 2
Improvements ✅
(secondary)
-1.4% [-3.5%, -0.2%] 3
All ❌✅ (primary) -0.5% [-0.7%, -0.3%] 2

Max RSS (memory usage)

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.4% [2.3%, 4.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 669.534s -> 667.985s (-0.23%) Artifact size: 315.85 MiB -> 315.84 MiB (-0.00%)

rust-timer avatar Mar 29 '24 21:03 rust-timer

One secondary regression on incr alongside some improvements even on the same bench, nothing to worry about

Nadrieril avatar Mar 29 '24 22:03 Nadrieril