declare_interior_mutable_const, borrow_interior_mutable_const: resolve <T as Trait>::AssocT projections#14125
Conversation
declare_interior_mutable_const, borrow_interior_mutable_const: resolve <T as Trait>::AssocT projections
This is a great idea! Would you like to implement it here, in another PR or would you like for someone else (probably me) to implement it? |
I think I might give it a try myself, but definitely in a separate PR, because for now I just want to unblock rust-lang/rust#136316 |
|
Oh I didn't know this was a blocking PR, sorry for the wait. I'll be swift in the reviews then. |
No problem, it's nothing urgent. In fact it is not even 100% blocking. We can just avoid using |
There was a problem hiding this comment.
LGTM, thanks! ❤️
For transparency, I had to open a thread on Zulip asking for some assistance because try_normalize_erasing_regions was out of my area of expertise, and with that newly-found knowledge, I think this is a good use of the function.
Also, compiler-errors took a look at this and he also thinks it's fine.
Yay, that is reassuring. As for the |
…Simulacrum Create `Atomic<T>` type alias (rebase) Rebase of rust-lang#130543. Additional changes: - Switch from `allow` to `expect` for `private_bounds` on `AtomicPrimitive` - Unhide `AtomicPrimitive::AtomicInner` from docs, because rustdoc shows the definition `pub type Atomic<T> = <T as AtomicPrimitive>::AtomicInner;` and generated links for it. - `NonZero` did not have this issue, because they kept the new alias private before the direction was changed. - Use `Atomic<_>` in more places, including inside `Once`'s `Futex`. This is possible thanks to rust-lang/rust-clippy#14125 The rest will either get moved back to rust-lang#130543 or rust-lang#130543 will be closed in favor of this instead. --- * ACP: rust-lang/libs-team#443 (comment) * Tracking issue: rust-lang#130539
…Simulacrum Create `Atomic<T>` type alias (rebase) Rebase of rust-lang#130543. Additional changes: - Switch from `allow` to `expect` for `private_bounds` on `AtomicPrimitive` - Unhide `AtomicPrimitive::AtomicInner` from docs, because rustdoc shows the definition `pub type Atomic<T> = <T as AtomicPrimitive>::AtomicInner;` and generated links for it. - `NonZero` did not have this issue, because they kept the new alias private before the direction was changed. - Use `Atomic<_>` in more places, including inside `Once`'s `Futex`. This is possible thanks to rust-lang/rust-clippy#14125 The rest will either get moved back to rust-lang#130543 or rust-lang#130543 will be closed in favor of this instead. --- * ACP: rust-lang/libs-team#443 (comment) * Tracking issue: rust-lang#130539
…Simulacrum Create `Atomic<T>` type alias (rebase) Rebase of rust-lang#130543. Additional changes: - Switch from `allow` to `expect` for `private_bounds` on `AtomicPrimitive` - Unhide `AtomicPrimitive::AtomicInner` from docs, because rustdoc shows the definition `pub type Atomic<T> = <T as AtomicPrimitive>::AtomicInner;` and generated links for it. - `NonZero` did not have this issue, because they kept the new alias private before the direction was changed. - Use `Atomic<_>` in more places, including inside `Once`'s `Futex`. This is possible thanks to rust-lang/rust-clippy#14125 The rest will either get moved back to rust-lang#130543 or rust-lang#130543 will be closed in favor of this instead. --- * ACP: rust-lang/libs-team#443 (comment) * Tracking issue: rust-lang#130539
changelog: [
declare_interior_mutable_const,borrow_interior_mutable_const]: resolve<T as Trait>::AssocTprojectionsThis came up during rust-lang/rust#130543 where we have
<T as AtomicPrimitive>::Assoc = AtomicTinstead of justAtomicTand clippy failed to resolve that properly.This really needs a review, because
try_normalize_erasing_regionsis the right thing to call here.ValTree::Branchlayers (I think I do).Also, shouldn't this lint's infrastructure rely on
Freezetrait (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)).