Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c5a5e86

Browse files
committed
Rename Receiver -> LegacyReceiver
As part of the "arbitrary self types v2" project, we are going to replace the current `Receiver` trait with a new mechanism based on a new, different `Receiver` trait. This PR renames the old trait to get it out the way. Naming is hard. Options considered included: * HardCodedReceiver (because it should only be used for things in the standard library, and hence is sort-of hard coded) * LegacyReceiver * TargetLessReceiver * OldReceiver These are all bad names, but fortunately this will be temporary. Assuming the new mechanism proceeds to stabilization as intended, the legacy trait will be removed altogether. Although we expect this trait to be used only in the standard library, we suspect it may be in use elsehwere, so we're landing this change separately to identify any surprising breakages. It's known that this trait is used within the Rust for Linux project; a patch is in progress to remove their dependency. This is a part of the arbitrary self types v2 project, rust-lang/rfcs#3519 rust-lang#44874 r? @wesleywiser
1 parent 65201c2 commit c5a5e86

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

example/mini_core.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*const U> for *const T {}
4747
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<*mut U> for *mut T {}
4848
impl<T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Box<U>> for Box<T> {}
4949

50-
#[lang = "receiver"]
51-
pub trait Receiver {}
50+
#[lang = "legacy_receiver"]
51+
pub trait LegacyReceiver {}
5252

53-
impl<T: ?Sized> Receiver for &T {}
54-
impl<T: ?Sized> Receiver for &mut T {}
55-
impl<T: ?Sized> Receiver for Box<T> {}
53+
impl<T: ?Sized> LegacyReceiver for &T {}
54+
impl<T: ?Sized> LegacyReceiver for &mut T {}
55+
impl<T: ?Sized> LegacyReceiver for Box<T> {}
5656

5757
#[lang = "copy"]
5858
pub unsafe trait Copy {}

0 commit comments

Comments
 (0)