Skip to content

Commit

Permalink
Arbitrary self types v2: enable in bootstrap.
Browse files Browse the repository at this point in the history
For now, this disables a doctest, which otherwise fails. We'll want to
re-enable that later.
  • Loading branch information
adetaylor committed Mar 7, 2025
1 parent 72dcf08 commit f0a0065
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions library/core/src/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ unsafe impl<T: ?Sized> DerefPure for &mut T {}

/// Indicates that a struct can be used as a method receiver.
/// That is, a type can use this type as a type of `self`, like this:
/// ```
/// # // This is currently compile_fail because the compiler-side parts
/// # // of arbitrary_self_types are not implemented
/// ```ignore (trying to figure out bootstrap stuff, will be reinstated)
/// use std::ops::Receiver;
///
/// struct SmartPointer<T>(T);
Expand Down Expand Up @@ -365,7 +363,6 @@ unsafe impl<T: ?Sized> DerefPure for &mut T {}
/// }
/// ```
#[lang = "receiver"]
#[cfg(not(bootstrap))]
#[stable(feature = "arbitrary_self_types", since = "CURRENT_RUSTC_VERSION")]
pub trait Receiver {
/// The target type on which the method may be called.
Expand All @@ -375,7 +372,6 @@ pub trait Receiver {
type Target: ?Sized;
}

#[cfg(not(bootstrap))]
#[stable(feature = "arbitrary_self_types", since = "CURRENT_RUSTC_VERSION")]
impl<P: ?Sized, T: ?Sized> Receiver for P
where
Expand Down
1 change: 0 additions & 1 deletion library/core/src/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ pub use self::deref::DerefPure;
#[cfg(bootstrap)]
#[unstable(feature = "legacy_receiver_trait", issue = "none")]
pub use self::deref::LegacyReceiver;
#[cfg(not(bootstrap))]
#[stable(feature = "arbitrary_self_types", since = "CURRENT_RUSTC_VERSION")]
pub use self::deref::Receiver;
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit f0a0065

Please sign in to comment.