Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Fully deprecate objc2::rc::{Id, WeakId} #679

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/objc2/src/rc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@ pub use self::allocated_partial_init::{Allocated, PartialInit};
pub use self::autorelease::{
autoreleasepool, autoreleasepool_leaking, AutoreleasePool, AutoreleaseSafe,
};
pub use self::retained::{Id, Retained};
// Re-export `Id` for backwards compatibility, but still mark it as deprecated.
#[allow(deprecated)]
pub use self::retained::Id;
pub use self::retained::Retained;
pub use self::retained_traits::{DefaultRetained, RetainedFromIterator, RetainedIntoIterator};
#[cfg(test)]
pub(crate) use self::test_object::{RcTestObject, ThreadTestData};
pub use self::weak::{Weak, WeakId};
pub use self::weak::Weak;
// Same as above.
#[allow(deprecated)]
pub use self::weak::WeakId;
7 changes: 2 additions & 5 deletions crates/objc2/src/rc/retained.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ pub struct Retained<T: ?Sized> {

/// Short type-alias to [`Retained`].
///
/// This type is soft-deprecated, and will be fully deprecated in `v0.6.0`,
/// see [#617].
///
/// [`Retained<T>`]: Retained
/// [#617]: https://github.com/madsmtm/objc2/issues/617
/// This is fully deprecated since `v0.6.0`, use [`Retained`] instead.
#[deprecated(since = "0.6.0", note = "Renamed to `Retained`.")]
pub type Id<T> = Retained<T>;
PaulDance marked this conversation as resolved.
Show resolved Hide resolved

impl<T: ?Sized> Retained<T> {
Expand Down
3 changes: 2 additions & 1 deletion crates/objc2/src/rc/weak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ pub struct Weak<T: ?Sized> {
item: PhantomData<Retained<T>>,
}

/// Soft-deprecated type-alias to [`Weak`].
/// Fully-deprecated type-alias to [`Weak`].
#[deprecated(since = "0.6.0", note = "Renamed to `Weak`.")]
pub type WeakId<T> = Weak<T>;

impl<T: Message> Weak<T> {
Expand Down
Loading