Skip to content
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: resolve projections during internal mutability analysis #136369

Closed
wants to merge 1 commit into from

Conversation

GrigorenkoPV
Copy link
Contributor

This came up during #130543 where we have <T as AtomicPrimitive>::Assoc = AtomicT instead of just AtomicT and clippy failed to resolve that properly.

This really needs a review, because

  • I don't know if try_normalize_erasing_regions is the right thing to call here.
  • I'm not sure if I peel off the correct amount of ValTree::Branch layers (I think I do).

Also,

  • Shouldn't this lint's infrastructure rely on Freeze trait (Tracking Issue for the Freeze trait #121675) instead of hardcoding a list of known-to-be-interior-mutable types?
  • Should I open this PR in clippy repo instead?

@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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 rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 31, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@blyxyas
Copy link
Member

blyxyas commented Jan 31, 2025

We'd love for Clippy-exclusive PRs to be open directly on the repo.

Could you open this PR there instesd?
Thanks! ❤️

@GrigorenkoPV
Copy link
Contributor Author

We'd love for Clippy-exclusive PRs to be open directly on the repo.

Could you open this PR there instesd? Thanks! ❤️

Sure thing.

Closing in favor of rust-lang/rust-clippy#14125

@GrigorenkoPV GrigorenkoPV deleted the clippy-freeze branch January 31, 2025 23:35
github-merge-queue bot pushed a commit to rust-lang/rust-clippy that referenced this pull request Feb 11, 2025
…solve `<T as Trait>::AssocT` projections (#14125)

changelog: [`declare_interior_mutable_const`,
`borrow_interior_mutable_const`]: resolve `<T as Trait>::AssocT`
projections

---

This came up during rust-lang/rust#130543 where
we have `<T as AtomicPrimitive>::Assoc = AtomicT` instead of just
`AtomicT` and clippy failed to resolve that properly.

This really needs a review, because

- I don't know if `try_normalize_erasing_regions` is the right thing to
call here.
- I'm not sure if I peel off the correct amount of `ValTree::Branch`
layers (I think I do).

Also, shouldn't this lint's infrastructure rely on `Freeze` trait
(rust-lang/rust#121675) instead of hardcoding
a list of known-to-be-interior-mutable types?

---

Previously filed this in the main rust repo
(rust-lang/rust#136369), was asked to do it here
instead
(rust-lang/rust#136369 (comment)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants