diff options
| author | Adrian Taylor <adetaylor@chromium.org> | 2024-10-25 11:07:06 +0000 |
|---|---|---|
| committer | Adrian Taylor <adetaylor@chromium.org> | 2024-10-25 16:30:47 +0000 |
| commit | ecfcd0879cf9e54992328403655ec4aaeee1a6a9 (patch) | |
| tree | 2eea3bfa1033ec42adfaee071189575ca97aa94d /compiler/rustc_hir/src/lang_items.rs | |
| parent | f61306d47bc98af8bb9d15f1adf6086785590a8c (diff) | |
| download | rust-ecfcd0879cf9e54992328403655ec4aaeee1a6a9.tar.gz rust-ecfcd0879cf9e54992328403655ec4aaeee1a6a9.zip | |
Arbitrary self types v2: (unused) Receiver trait
This commit contains a new Receiver trait, which is the basis for the Arbitrary Self Types v2 RFC. This allows smart pointers to be method receivers even if they're not Deref. This is currently unused by the compiler - a subsequent PR will start to use this for method resolution if the arbitrary_self_types feature gate is enabled. This is being landed first simply to make review simpler: if people feel this should all be in an atomic PR let me know. This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519 https://github.com/rust-lang/rust/issues/44874 r? @wesleywiser
Diffstat (limited to 'compiler/rustc_hir/src/lang_items.rs')
| -rw-r--r-- | compiler/rustc_hir/src/lang_items.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs index ae046c09ebe..ec1a8e0262a 100644 --- a/compiler/rustc_hir/src/lang_items.rs +++ b/compiler/rustc_hir/src/lang_items.rs @@ -241,6 +241,8 @@ language_item_table! { DerefMut, sym::deref_mut, deref_mut_trait, Target::Trait, GenericRequirement::Exact(0); DerefPure, sym::deref_pure, deref_pure_trait, Target::Trait, GenericRequirement::Exact(0); DerefTarget, sym::deref_target, deref_target, Target::AssocTy, GenericRequirement::None; + Receiver, sym::receiver, receiver_trait, Target::Trait, GenericRequirement::None; + ReceiverTarget, sym::receiver_target, receiver_target, Target::AssocTy, GenericRequirement::None; LegacyReceiver, sym::legacy_receiver, legacy_receiver_trait, Target::Trait, GenericRequirement::None; Fn, kw::Fn, fn_trait, Target::Trait, GenericRequirement::Exact(1); |
