diff --git a/.travis-disabled.yml b/.travis-disabled.yml index 4172dedde..c87cb6b09 100644 --- a/.travis-disabled.yml +++ b/.travis-disabled.yml @@ -42,4 +42,4 @@ jobs: # Remove workspace since `rust-test-ios` is not made for that - rm Cargo.toml # TODO: env: FEATURES="exception" - script: cd objc && ../rust-test-ios + script: cd objc2 && ../rust-test-ios diff --git a/objc2/CHANGELOG.md b/objc2/CHANGELOG.md index be3cc2a44..07c2ea344 100644 --- a/objc2/CHANGELOG.md +++ b/objc2/CHANGELOG.md @@ -52,7 +52,7 @@ ### Fixed -* Fixed the implementation of `objc::runtime` structs so there can't be unsound +* Fixed the implementation of `objc2::runtime` structs so there can't be unsound references to uninhabited types. ## 0.2.2 diff --git a/objc2/Cargo.toml b/objc2/Cargo.toml index 87fd37f36..6360e61c3 100644 --- a/objc2/Cargo.toml +++ b/objc2/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "objc" +name = "objc2" version = "0.2.7" # Remember to update html_root_url in lib.rs authors = ["Steven Sheldon", "Mads Marquart "] edition = "2018" @@ -13,7 +13,7 @@ categories = [ ] readme = "README.md" repository = "https://github.com/madsmtm/objc2" -documentation = "https://docs.rs/objc/" +documentation = "https://docs.rs/objc2/" license = "MIT" exclude = [ diff --git a/objc2/README.md b/objc2/README.md index 4be066b57..8e41f546c 100644 --- a/objc2/README.md +++ b/objc2/README.md @@ -1,8 +1,8 @@ -# `objc` +# `objc2` -[![Latest version](https://badgen.net/crates/v/objc)](https://crates.io/crates/objc) +[![Latest version](https://badgen.net/crates/v/objc2)](https://crates.io/crates/objc2) [![License](https://badgen.net/badge/license/MIT/blue)](../LICENSE.txt) -[![Documentation](https://docs.rs/objc/badge.svg)](https://docs.rs/objc/) +[![Documentation](https://docs.rs/objc2/badge.svg)](https://docs.rs/objc2/) [![CI Status](https://github.com/madsmtm/objc2/workflows/CI/badge.svg)](https://github.com/madsmtm/objc2/actions) Objective-C Runtime bindings and wrapper for Rust. @@ -12,8 +12,8 @@ Objective-C Runtime bindings and wrapper for Rust. Objective-C objects can be messaged using the `msg_send!` macro: ```rust , no_run -use objc::{class, msg_send}; -use objc::runtime::{BOOL, Object}; +use objc2::{class, msg_send}; +use objc2::runtime::{BOOL, Object}; let cls = class!(NSObject); unsafe { @@ -34,8 +34,8 @@ A `WeakPtr` will not retain the object, but can be upgraded to a `StrongPtr` and safely fails if the object has been deallocated. ```rust , no_run -use objc::{class, msg_send}; -use objc::rc::{autoreleasepool, StrongPtr}; +use objc2::{class, msg_send}; +use objc2::rc::{autoreleasepool, StrongPtr}; // StrongPtr will release the object when dropped let obj = unsafe { @@ -65,9 +65,9 @@ The following example demonstrates declaring a class named `MyNumber` that has one ivar, a `u32` named `_number` and a `number` method that returns it: ```rust , no_run -use objc::{class, sel}; -use objc::declare::ClassDecl; -use objc::runtime::{Object, Sel}; +use objc2::{class, sel}; +use objc2::declare::ClassDecl; +use objc2::runtime::{Object, Sel}; let superclass = class!(NSObject); let mut decl = ClassDecl::new("MyNumber", superclass).unwrap(); diff --git a/objc2/examples/introspection.rs b/objc2/examples/introspection.rs index 195062ce2..189796928 100644 --- a/objc2/examples/introspection.rs +++ b/objc2/examples/introspection.rs @@ -1,6 +1,6 @@ -use objc::rc::StrongPtr; -use objc::runtime::{Class, Object}; -use objc::{class, msg_send, sel, Encode}; +use objc2::rc::StrongPtr; +use objc2::runtime::{Class, Object}; +use objc2::{class, msg_send, sel, Encode}; fn main() { // Get a class diff --git a/objc2/src/declare.rs b/objc2/src/declare.rs index 072cc4345..f2ab27497 100644 --- a/objc2/src/declare.rs +++ b/objc2/src/declare.rs @@ -10,9 +10,9 @@ The following example demonstrates declaring a class named `MyNumber` that has one ivar, a `u32` named `_number` and a `number` method that returns it: ``` no_run -# use objc::{class, sel}; -# use objc::declare::ClassDecl; -# use objc::runtime::{Class, Object, Sel}; +# use objc2::{class, sel}; +# use objc2::declare::ClassDecl; +# use objc2::runtime::{Class, Object, Sel}; let superclass = class!(NSObject); let mut decl = ClassDecl::new("MyNumber", superclass).unwrap(); diff --git a/objc2/src/lib.rs b/objc2/src/lib.rs index 4e1e19605..02df9997d 100644 --- a/objc2/src/lib.rs +++ b/objc2/src/lib.rs @@ -6,8 +6,8 @@ Objective-C Runtime bindings and wrapper for Rust. Objective-C objects can be messaged using the [`msg_send!`](macro.msg_send!.html) macro: ``` no_run -# use objc::{class, msg_send}; -# use objc::runtime::{BOOL, Class, Object}; +# use objc2::{class, msg_send}; +# use objc2::runtime::{BOOL, Class, Object}; # unsafe { let cls = class!(NSObject); let obj: *mut Object = msg_send![cls, new]; @@ -66,7 +66,7 @@ The bindings can be used on Linux or *BSD utilizing the #![warn(missing_docs)] #![allow(clippy::missing_safety_doc)] // Update in Cargo.toml as well. -#![doc(html_root_url = "https://docs.rs/objc/0.2.7")] +#![doc(html_root_url = "https://docs.rs/objc2/0.2.7")] extern crate alloc; extern crate std; diff --git a/objc2/src/macros.rs b/objc2/src/macros.rs index f83c09e86..3be5291cc 100644 --- a/objc2/src/macros.rs +++ b/objc2/src/macros.rs @@ -13,7 +13,7 @@ To check for a class that may not exist, use [`Class::get`]. # Examples ``` no_run -# use objc::class; +# use objc2::class; let cls = class!(NSObject); ``` */ @@ -41,7 +41,7 @@ Returns a [`Sel`]. # Examples ``` -# use objc::sel; +# use objc2::sel; let sel = sel!(description); let sel = sel!(setObject:forKey:); ``` @@ -85,8 +85,8 @@ method's argument's encoding does not match the encoding of the given arguments. # Examples ``` no_run -# use objc::msg_send; -# use objc::runtime::Object; +# use objc2::msg_send; +# use objc2::runtime::Object; # unsafe { let obj: *mut Object; # let obj: *mut Object = 0 as *mut Object; diff --git a/objc2/src/message/mod.rs b/objc2/src/message/mod.rs index 30e022a81..a36c78b80 100644 --- a/objc2/src/message/mod.rs +++ b/objc2/src/message/mod.rs @@ -85,9 +85,9 @@ pub unsafe trait Message: RefEncode { # Example ``` no_run - # use objc::{class, msg_send, sel}; - # use objc::runtime::{BOOL, Class, Object}; - # use objc::Message; + # use objc2::{class, msg_send, sel}; + # use objc2::runtime::{BOOL, Class, Object}; + # use objc2::Message; let obj: &Object; # obj = unsafe { msg_send![class!(NSObject), new] }; let sel = sel!(isKindOfClass:); diff --git a/objc2/src/rc/autorelease.rs b/objc2/src/rc/autorelease.rs index b3ed68ec4..e29dd03a5 100644 --- a/objc2/src/rc/autorelease.rs +++ b/objc2/src/rc/autorelease.rs @@ -25,12 +25,12 @@ pub struct AutoreleasePool { } /// ```rust,compile_fail -/// use objc::rc::AutoreleasePool; +/// use objc2::rc::AutoreleasePool; /// fn needs_sync() {} /// needs_sync::(); /// ``` /// ```rust,compile_fail -/// use objc::rc::AutoreleasePool; +/// use objc2::rc::AutoreleasePool; /// fn needs_send() {} /// needs_send::(); /// ``` @@ -224,9 +224,9 @@ impl !AutoreleaseSafe for AutoreleasePool {} /// Basic usage: /// /// ```rust -/// use objc::{class, msg_send}; -/// use objc::rc::{autoreleasepool, AutoreleasePool}; -/// use objc::runtime::Object; +/// use objc2::{class, msg_send}; +/// use objc2::rc::{autoreleasepool, AutoreleasePool}; +/// use objc2::runtime::Object; /// /// fn needs_lifetime_from_pool<'p>(pool: &'p AutoreleasePool) -> &'p mut Object { /// let obj: *mut Object = unsafe { msg_send![class!(NSObject), new] }; @@ -247,9 +247,9 @@ impl !AutoreleaseSafe for AutoreleasePool {} /// safely take it out of the pool: /// /// ```rust,compile_fail -/// # use objc::{class, msg_send}; -/// # use objc::rc::{autoreleasepool, AutoreleasePool}; -/// # use objc::runtime::Object; +/// # use objc2::{class, msg_send}; +/// # use objc2::rc::{autoreleasepool, AutoreleasePool}; +/// # use objc2::runtime::Object; /// # /// # fn needs_lifetime_from_pool<'p>(pool: &'p AutoreleasePool) -> &'p mut Object { /// # let obj: *mut Object = unsafe { msg_send![class!(NSObject), new] }; @@ -272,9 +272,9 @@ impl !AutoreleaseSafe for AutoreleasePool {} not(feature = "unstable_autoreleasesafe"), doc = "```rust,should_panic" )] -/// # use objc::{class, msg_send}; -/// # use objc::rc::{autoreleasepool, AutoreleasePool}; -/// # use objc::runtime::Object; +/// # use objc2::{class, msg_send}; +/// # use objc2::rc::{autoreleasepool, AutoreleasePool}; +/// # use objc2::runtime::Object; /// # /// # fn needs_lifetime_from_pool<'p>(pool: &'p AutoreleasePool) -> &'p mut Object { /// # let obj: *mut Object = unsafe { msg_send![class!(NSObject), new] }; diff --git a/objc2/src/rc/mod.rs b/objc2/src/rc/mod.rs index c479fc1fd..317a30c42 100644 --- a/objc2/src/rc/mod.rs +++ b/objc2/src/rc/mod.rs @@ -16,8 +16,8 @@ For more information on Objective-C's reference counting, see Apple's documentat # Example ``` no_run -# use objc::{class, msg_send}; -# use objc::rc::{autoreleasepool, StrongPtr}; +# use objc2::{class, msg_send}; +# use objc2::rc::{autoreleasepool, StrongPtr}; // StrongPtr will release the object when dropped let obj = unsafe { StrongPtr::new(msg_send![class!(NSObject), new]) diff --git a/objc2/tests-ios/prelude.rs b/objc2/tests-ios/prelude.rs index 2eabd4c83..17c7752fc 100644 --- a/objc2/tests-ios/prelude.rs +++ b/objc2/tests-ios/prelude.rs @@ -1,9 +1,9 @@ #[macro_use] -extern crate objc; +extern crate objc2; -use objc::rc::*; -use objc::runtime::*; -pub use objc::*; +use objc2::rc::*; +use objc2::runtime::*; +pub use objc2::*; #[path = "../src/test_utils.rs"] mod test_utils; diff --git a/objc2/tests/use_macros.rs b/objc2/tests/use_macros.rs index 958e678e2..7336f2046 100644 --- a/objc2/tests/use_macros.rs +++ b/objc2/tests/use_macros.rs @@ -1,7 +1,7 @@ #![cfg(target_vendor = "apple")] -use objc::runtime::Object; -use objc::{class, msg_send, sel}; +use objc2::runtime::Object; +use objc2::{class, msg_send, sel}; #[test] fn use_class_and_msg_send() { diff --git a/objc2_block/src/lib.rs b/objc2_block/src/lib.rs index d50220317..e8178cef4 100644 --- a/objc2_block/src/lib.rs +++ b/objc2_block/src/lib.rs @@ -65,7 +65,7 @@ use std::os::raw::{c_int, c_ulong}; use objc2_encode::{Encode, EncodeArguments, Encoding, RefEncode}; -// TODO: Replace with `objc::Class` +// TODO: Replace with `objc2::Class` #[repr(C)] struct ClassInternal { _priv: [u8; 0], diff --git a/objc2_encode/README.md b/objc2_encode/README.md index e931ecc6e..45e31835e 100644 --- a/objc2_encode/README.md +++ b/objc2_encode/README.md @@ -15,8 +15,8 @@ Additionally it provides traits for annotating types that has a corresponding Objective-C encoding, respectively `Encode` for structs and `RefEncode` for references (and `EncodeArguments` for function arguments). -These types are exported under the `objc` crate as well, so usually you would -just use that crate. +These types are exported under the `objc2` crate as well, so usually you would +just use that. # Examples diff --git a/objc2_encode/src/encode.rs b/objc2_encode/src/encode.rs index 9e9b94d45..8c1827124 100644 --- a/objc2_encode/src/encode.rs +++ b/objc2_encode/src/encode.rs @@ -23,7 +23,7 @@ use crate::Encoding; /// in Objective-C with the type in question. /// /// You should also beware of having [`Drop`] types implement this, since when -/// passed to Objective-C via. `objc::msg_send!` their destructor will not be +/// passed to Objective-C via. `objc2::msg_send!` their destructor will not be /// called! /// /// # Examples diff --git a/objc2_foundation/Cargo.toml b/objc2_foundation/Cargo.toml index 4ac85efff..939a32315 100644 --- a/objc2_foundation/Cargo.toml +++ b/objc2_foundation/Cargo.toml @@ -23,5 +23,5 @@ block = ["objc2_block"] [dependencies] objc2_block = { path = "../objc2_block", optional = true } -objc = { path = "../objc2", version = "0.2.7" } +objc2 = { path = "../objc2" } objc2_id = { path = "../objc2_id" } diff --git a/objc2_foundation/examples/custom_class.rs b/objc2_foundation/examples/custom_class.rs index 40b353cc0..907cef8a1 100644 --- a/objc2_foundation/examples/custom_class.rs +++ b/objc2_foundation/examples/custom_class.rs @@ -1,9 +1,9 @@ use std::sync::Once; -use objc::declare::ClassDecl; -use objc::runtime::{Class, Object, Sel}; -use objc::{msg_send, sel}; -use objc::{Encoding, Message, RefEncode}; +use objc2::declare::ClassDecl; +use objc2::runtime::{Class, Object, Sel}; +use objc2::{msg_send, sel}; +use objc2::{Encoding, Message, RefEncode}; use objc2_foundation::{INSObject, NSObject}; /// In the future this should be an `extern type`, if that gets stabilized, diff --git a/objc2_foundation/src/array.rs b/objc2_foundation/src/array.rs index bfcd9b61e..f537fdade 100644 --- a/objc2_foundation/src/array.rs +++ b/objc2_foundation/src/array.rs @@ -4,9 +4,9 @@ use core::ffi::c_void; use core::marker::PhantomData; use core::ops::{Index, Range}; -use objc::runtime::{Class, Object}; -use objc::{class, msg_send}; -use objc::{Encode, Encoding}; +use objc2::runtime::{Class, Object}; +use objc2::{class, msg_send}; +use objc2::{Encode, Encoding}; use objc2_id::{Id, Owned, Ownership, ShareId, Shared}; use super::{INSCopying, INSFastEnumeration, INSMutableCopying, INSObject, NSEnumerator}; diff --git a/objc2_foundation/src/data.rs b/objc2_foundation/src/data.rs index c2b16e4a0..1e752357c 100644 --- a/objc2_foundation/src/data.rs +++ b/objc2_foundation/src/data.rs @@ -5,7 +5,7 @@ use core::ops::Range; use core::slice; use super::{INSCopying, INSMutableCopying, INSObject, NSRange}; -use objc::msg_send; +use objc2::msg_send; #[cfg(feature = "block")] use objc2_block::{Block, ConcreteBlock}; use objc2_id::Id; diff --git a/objc2_foundation/src/dictionary.rs b/objc2_foundation/src/dictionary.rs index 4923ca814..4ff9f1997 100644 --- a/objc2_foundation/src/dictionary.rs +++ b/objc2_foundation/src/dictionary.rs @@ -4,8 +4,8 @@ use core::marker::PhantomData; use core::ops::Index; use core::ptr; -use objc::runtime::Class; -use objc::{class, msg_send}; +use objc2::runtime::Class; +use objc2::{class, msg_send}; use objc2_id::{Id, Owned, Ownership, ShareId}; use super::{INSCopying, INSFastEnumeration, INSObject, NSArray, NSEnumerator, NSSharedArray}; diff --git a/objc2_foundation/src/enumerator.rs b/objc2_foundation/src/enumerator.rs index 08cf2a124..16e80c581 100644 --- a/objc2_foundation/src/enumerator.rs +++ b/objc2_foundation/src/enumerator.rs @@ -4,8 +4,8 @@ use core::ptr; use core::slice; use std::os::raw::c_ulong; -use objc::runtime::Object; -use objc::{msg_send, Encode, Encoding, RefEncode}; +use objc2::runtime::Object; +use objc2::{msg_send, Encode, Encoding, RefEncode}; use objc2_id::Id; use super::INSObject; diff --git a/objc2_foundation/src/lib.rs b/objc2_foundation/src/lib.rs index 24ca3f112..3ee059c22 100644 --- a/objc2_foundation/src/lib.rs +++ b/objc2_foundation/src/lib.rs @@ -26,7 +26,7 @@ pub use self::value::{INSValue, NSValue}; extern "C" {} #[cfg(not(target_vendor = "apple"))] -use objc::runtime::Class; +use objc2::runtime::Class; #[cfg(not(target_vendor = "apple"))] #[link(name = "gnustep-base", kind = "dylib")] diff --git a/objc2_foundation/src/macros.rs b/objc2_foundation/src/macros.rs index b93521fbf..09023c3de 100644 --- a/objc2_foundation/src/macros.rs +++ b/objc2_foundation/src/macros.rs @@ -7,15 +7,15 @@ macro_rules! object_struct { _private: [u8; 0], } - unsafe impl ::objc::Message for $name {} + unsafe impl ::objc2::Message for $name {} - unsafe impl ::objc::RefEncode for $name { - const ENCODING_REF: ::objc::Encoding<'static> = ::objc::Encoding::Object; + unsafe impl ::objc2::RefEncode for $name { + const ENCODING_REF: ::objc2::Encoding<'static> = ::objc2::Encoding::Object; } impl $crate::INSObject for $name { - fn class() -> &'static ::objc::runtime::Class { - ::objc::class!($name) + fn class() -> &'static ::objc2::runtime::Class { + ::objc2::class!($name) } } @@ -55,10 +55,10 @@ macro_rules! object_impl { object_impl!($name, $($t),+); ); ($name:ident, $($t:ident),*) => ( - unsafe impl<$($t),*> ::objc::Message for $name<$($t),*> { } + unsafe impl<$($t),*> ::objc2::Message for $name<$($t),*> { } - unsafe impl<$($t),*> ::objc::RefEncode for $name<$($t),*> { - const ENCODING_REF: ::objc::Encoding<'static> = ::objc::Encoding::Object; + unsafe impl<$($t),*> ::objc2::RefEncode for $name<$($t),*> { + const ENCODING_REF: ::objc2::Encoding<'static> = ::objc2::Encoding::Object; } ); } diff --git a/objc2_foundation/src/object.rs b/objc2_foundation/src/object.rs index 78811fd40..00572ba3a 100644 --- a/objc2_foundation/src/object.rs +++ b/objc2_foundation/src/object.rs @@ -1,14 +1,14 @@ use core::any::Any; -use objc::msg_send; -use objc::runtime::{Class, BOOL, NO}; -use objc::Message; +use objc2::msg_send; +use objc2::runtime::{Class, BOOL, NO}; +use objc2::Message; use objc2_id::{Id, ShareId}; use super::NSString; /* -The Sized bound is unfortunate; ideally, objc objects would not be +The Sized bound is unfortunate; ideally, Objective-C objects would not be treated as Sized. However, rust won't allow casting a dynamically-sized type pointer to an Object pointer, because dynamically-sized types can have fat pointers (two words) instead of real pointers. diff --git a/objc2_foundation/src/string.rs b/objc2_foundation/src/string.rs index 07b03f4b5..2b67df022 100644 --- a/objc2_foundation/src/string.rs +++ b/objc2_foundation/src/string.rs @@ -4,7 +4,7 @@ use core::slice; use core::str; use std::os::raw::c_char; -use objc::msg_send; +use objc2::msg_send; use objc2_id::{Id, ShareId}; use super::INSObject; diff --git a/objc2_foundation/src/value.rs b/objc2_foundation/src/value.rs index 191ad2415..1cb37a8cc 100644 --- a/objc2_foundation/src/value.rs +++ b/objc2_foundation/src/value.rs @@ -7,9 +7,9 @@ use core::str; use std::ffi::{CStr, CString}; use std::os::raw::c_char; -use objc::runtime::Class; -use objc::Encode; -use objc::{class, msg_send}; +use objc2::runtime::Class; +use objc2::Encode; +use objc2::{class, msg_send}; use objc2_id::Id; use super::{INSCopying, INSObject}; @@ -81,7 +81,7 @@ where #[cfg(test)] mod tests { use crate::{INSValue, NSValue}; - use objc::Encode; + use objc2::Encode; #[test] fn test_value() { diff --git a/objc2_foundation_derive/src/lib.rs b/objc2_foundation_derive/src/lib.rs index f4c33b448..6ed5f23c0 100644 --- a/objc2_foundation_derive/src/lib.rs +++ b/objc2_foundation_derive/src/lib.rs @@ -27,16 +27,16 @@ pub fn impl_object(input: TokenStream) -> TokenStream { let mut gen = Tokens::new(); quote!( - unsafe impl #impl_generics ::objc::Message for #name #ty_generics #where_clause { } + unsafe impl #impl_generics ::objc2::Message for #name #ty_generics #where_clause { } ) .to_tokens(&mut gen); quote!( impl #impl_generics INSObject for #name #ty_generics #where_clause { - fn class() -> &'static ::objc::runtime::Class { + fn class() -> &'static ::objc2::runtime::Class { extern { #[link_name = #link_name] - static OBJC_CLASS: ::objc::runtime::Class; + static OBJC_CLASS: ::objc2::runtime::Class; } unsafe { &OBJC_CLASS diff --git a/objc2_id/Cargo.toml b/objc2_id/Cargo.toml index deec120ff..7fb326346 100644 --- a/objc2_id/Cargo.toml +++ b/objc2_id/Cargo.toml @@ -17,4 +17,4 @@ documentation = "https://docs.rs/objc2_id/" license = "MIT" [dependencies] -objc = { path = "../objc2", version = "0.2.7" } +objc2 = { path = "../objc2" } diff --git a/objc2_id/README.md b/objc2_id/README.md index 35075863c..91c77a85f 100644 --- a/objc2_id/README.md +++ b/objc2_id/README.md @@ -18,7 +18,7 @@ which can be cloned to allow multiple references. Weak references may be created using the WeakId struct. ``` rust -use objc::runtime::{Class, Object}; +use objc2::runtime::{Class, Object}; use objc2_id::{Id, WeakId}; let cls = Class::get("NSObject").unwrap(); diff --git a/objc2_id/src/id.rs b/objc2_id/src/id.rs index 3e36a5ae1..f7ff02760 100644 --- a/objc2_id/src/id.rs +++ b/objc2_id/src/id.rs @@ -4,9 +4,9 @@ use core::hash; use core::marker::PhantomData; use core::ops::{Deref, DerefMut}; -use objc::rc::{StrongPtr, WeakPtr}; -use objc::runtime::Object; -use objc::Message; +use objc2::rc::{StrongPtr, WeakPtr}; +use objc2::runtime::Object; +use objc2::Message; /// A type used to mark that a struct owns the object(s) it contains, /// so it has the sole references to them. @@ -235,8 +235,8 @@ unsafe impl Send for WeakId {} #[cfg(test)] mod tests { use super::{Id, ShareId, WeakId}; - use objc::runtime::Object; - use objc::{class, msg_send}; + use objc2::runtime::Object; + use objc2::{class, msg_send}; #[cfg(not(target_vendor = "apple"))] #[test] diff --git a/objc2_id/src/lib.rs b/objc2_id/src/lib.rs index 9b15efdea..68ec9272d 100644 --- a/objc2_id/src/lib.rs +++ b/objc2_id/src/lib.rs @@ -12,8 +12,8 @@ can be cloned to allow multiple references. Weak references may be created using the [`WeakId`] struct. ```no_run -# use objc::msg_send; -use objc::runtime::{Class, Object}; +# use objc2::msg_send; +use objc2::runtime::{Class, Object}; use objc2_id::{Id, WeakId}; let cls = Class::get("NSObject").unwrap(); @@ -48,7 +48,7 @@ mod id; // TODO: Remove the need for this hack #[cfg(not(target_vendor = "apple"))] -use objc::runtime::Class; +use objc2::runtime::Class; #[cfg(not(target_vendor = "apple"))] #[link(name = "gnustep-base", kind = "dylib")]