Skip to content

Inconsistent warning on get_disjoint_mut #139296

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
zirconium-n opened this issue Apr 3, 2025 · 1 comment · Fixed by #139307
Closed

Inconsistent warning on get_disjoint_mut #139296

zirconium-n opened this issue Apr 3, 2025 · 1 comment · Fixed by #139307
Assignees
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@zirconium-n
Copy link
Contributor

zirconium-n commented Apr 3, 2025

Location

slice::get_disjoint_mut got a warning about O(n^2) check for overlapping indices, but HashMap::get_disjoint_mut does not.

Summary

I think we should add this warning to HashMap::get_disjoint_mut as well.

@zirconium-n zirconium-n added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Apr 3, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 3, 2025
@Urgau Urgau added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 3, 2025
@xizheyin
Copy link
Contributor

xizheyin commented Apr 3, 2025

@rustbot claim

Zalathar added a commit to Zalathar/rust that referenced this issue Apr 24, 2025
std: Add performance warnings to HashMap::get_disjoint_mut

Closes rust-lang#139296

The `get_disjoint_mut` in `HashMap` also performs a complexity O(n^2) check. So we need to be reminded of that as well.

https://github.com/rust-lang/hashbrown/blob/b5b0655a37e156f9798ac8dd7e970d4adba9bf90/src/raw/mod.rs#L1216-L1220
@bors bors closed this as completed in cb3c5d7 Apr 24, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 24, 2025
Rollup merge of rust-lang#139307 - xizheyin:issue-139296, r=joboet

std: Add performance warnings to HashMap::get_disjoint_mut

Closes rust-lang#139296

The `get_disjoint_mut` in `HashMap` also performs a complexity O(n^2) check. So we need to be reminded of that as well.

https://github.com/rust-lang/hashbrown/blob/b5b0655a37e156f9798ac8dd7e970d4adba9bf90/src/raw/mod.rs#L1216-L1220
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this issue May 9, 2025
std: Add performance warnings to HashMap::get_disjoint_mut

Closes rust-lang#139296

The `get_disjoint_mut` in `HashMap` also performs a complexity O(n^2) check. So we need to be reminded of that as well.

https://github.com/rust-lang/hashbrown/blob/b5b0655a37e156f9798ac8dd7e970d4adba9bf90/src/raw/mod.rs#L1216-L1220
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants