-
Notifications
You must be signed in to change notification settings - Fork 1.6k
declare_interior_mutable_const
, borrow_interior_mutable_const
: resolve <T as Trait>::AssocT
projections
#14125
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>::AssocT
projectionsThis came up during rust-lang/rust#130543 where we have
<T as AtomicPrimitive>::Assoc = AtomicT
instead of justAtomicT
and clippy failed to resolve that properly.This really needs a review, because
try_normalize_erasing_regions
is the right thing to call here.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)).