From a46ab1316042b9cd4d3f08596dd6cb3170d58293 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 14 Nov 2024 08:59:59 +0100 Subject: [PATCH] Update nightly Rust version Code changes are: - `static mut` now warns, so we introduce `SyncUnsafeCell` and use that instead. - Rename of "object safe" to "dyn-compatible". - The rest is Clippy. UI test changes are: - Removal of "which is required by ...", the end result is generally more readable, and hides more implementation details. - Removal of "the token" in macro diagnostics. Sometimes use "keyword" instead. End result is cleaner. - `dyn T` shows up in diagnostics without `+ 'static`, which is nice. - A few more very minor changes. - Due to Clippy suggesting `'_` instead of an explicit lifetime, a few uses of `&` in diagnostics are now cleaner. There are no assembly test changes. --- .github/workflows/ci.yml | 2 +- crates/block2/src/stack.rs | 10 +- crates/header-translator/src/config.rs | 2 +- crates/header-translator/src/id.rs | 2 +- crates/objc2/src/__macro_helpers/mod.rs | 2 + crates/objc2/src/__macro_helpers/msg_send.rs | 2 +- .../src/__macro_helpers/msg_send_retained.rs | 2 +- .../src/__macro_helpers/sync_unsafe_cell.rs | 32 +++++ crates/objc2/src/encode.rs | 4 +- crates/objc2/src/macros/declare_class.rs | 24 ++-- crates/objc2/src/macros/mod.rs | 15 +-- crates/objc2/src/runtime/message_receiver.rs | 12 +- .../objc2/src/runtime/method_encoding_iter.rs | 2 +- .../src/runtime/method_implementation.rs | 2 +- crates/objc2/src/top_level_traits.rs | 18 +-- crates/test-ui/ui/add_method_no_bool.stderr | 4 +- crates/test-ui/ui/array_iter_invalid.stderr | 8 +- .../ui/autoreleasepool_not_send_sync.stderr | 4 +- crates/test-ui/ui/available_invalid.stderr | 6 +- .../declare_class_classtype_imported.stderr | 2 +- .../ui/declare_class_invalid_receiver.stderr | 83 ++++++------ .../ui/declare_class_invalid_syntax.stderr | 46 +++---- .../ui/declare_class_invalid_type.stderr | 32 ++--- .../ui/declare_class_invalid_type2.stderr | 2 +- .../declare_class_mut_self_not_mutable.stderr | 32 ++--- .../extern_class_thread_kind_invalid.stderr | 12 +- .../ui/extern_methods_invalid_type.stderr | 8 +- .../extern_methods_not_allowed_mutable.stderr | 16 +-- .../test-ui/ui/global_block_not_encode.stderr | 2 +- crates/test-ui/ui/invalid_msg_send.stderr | 12 +- .../ui/mainthreadmarker_not_send_sync.stderr | 4 +- .../test-ui/ui/message_receiver_simple.stderr | 6 +- .../ui/msg_send_invalid_receiver.stderr | 16 +-- .../test-ui/ui/msg_send_invalid_return.stderr | 4 +- .../ui/msg_send_not_allowed_mutable.stderr | 16 +-- crates/test-ui/ui/msg_send_not_encode.stderr | 6 +- .../test-ui/ui/msg_send_only_message.stderr | 8 +- crates/test-ui/ui/not_encode.stderr | 22 ++-- crates/test-ui/ui/not_writeback.stderr | 12 +- .../ui/nsarray_bound_not_send_sync.stderr | 16 +-- crates/test-ui/ui/object_not_send_sync.stderr | 12 +- .../ui/protocol_object_only_protocols.stderr | 122 +++++++++--------- .../ui/stack_block_requires_clone.stderr | 3 +- ..._block_with_encoding_requires_clone.stderr | 3 +- ...thread_kind_traits_unimplementable2.stderr | 4 +- .../src/test_foundation_retain_semantics.rs | 4 +- crates/tests/src/test_object.rs | 42 +++--- framework-crates/objc2-foundation/src/iter.rs | 4 +- rust-toolchain.toml | 2 +- 49 files changed, 373 insertions(+), 333 deletions(-) create mode 100644 crates/objc2/src/__macro_helpers/sync_unsafe_cell.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c223fdbf..c87362903 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ env: # END AUTOMATICALLY GENERATED # The current nightly Rust version. Keep this synced with `rust-toolchain.toml` - CURRENT_NIGHTLY: nightly-2024-09-05 + CURRENT_NIGHTLY: nightly-2024-11-14 # Various features that we'd usually want to test with # # Note: The `exception` feature is not enabled here, since it requires diff --git a/crates/block2/src/stack.rs b/crates/block2/src/stack.rs index 7e14089ce..3c948fe5b 100644 --- a/crates/block2/src/stack.rs +++ b/crates/block2/src/stack.rs @@ -71,7 +71,7 @@ where } // Basic constants and helpers. -impl<'f, A, R, Closure> StackBlock<'f, A, R, Closure> { +impl StackBlock<'_, A, R, Closure> { /// The size of the block header and the trailing closure. /// /// This ensures that the closure that the block contains is also moved to @@ -108,7 +108,7 @@ impl<'f, A, R, Closure> StackBlock<'f, A, R, Closure> { } // `StackBlock::new` -impl<'f, A, R, Closure: Clone> StackBlock<'f, A, R, Closure> { +impl StackBlock<'_, A, R, Closure> { // Clone the closure from one block to another. unsafe extern "C-unwind" fn clone_closure(dst: *mut c_void, src: *const c_void) { let dst: *mut Self = dst.cast(); @@ -446,7 +446,7 @@ where }; } -impl<'f, A, R, Closure: Clone> Clone for StackBlock<'f, A, R, Closure> { +impl Clone for StackBlock<'_, A, R, Closure> { #[inline] fn clone(&self) -> Self { Self { @@ -457,7 +457,7 @@ impl<'f, A, R, Closure: Clone> Clone for StackBlock<'f, A, R, Closure> { } } -impl<'f, A, R, Closure: Copy> Copy for StackBlock<'f, A, R, Closure> {} +impl Copy for StackBlock<'_, A, R, Closure> {} impl<'f, A, R, Closure> Deref for StackBlock<'f, A, R, Closure> where @@ -481,7 +481,7 @@ where } } -impl<'f, A, R, Closure> fmt::Debug for StackBlock<'f, A, R, Closure> { +impl fmt::Debug for StackBlock<'_, A, R, Closure> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let mut f = f.debug_struct("StackBlock"); debug_block_header(&self.header, &mut f); diff --git a/crates/header-translator/src/config.rs b/crates/header-translator/src/config.rs index 5b456fb00..2e1d5053b 100644 --- a/crates/header-translator/src/config.rs +++ b/crates/header-translator/src/config.rs @@ -337,7 +337,7 @@ impl<'de> Deserialize<'de> for Counterpart { struct CounterpartVisitor; - impl<'de> de::Visitor<'de> for CounterpartVisitor { + impl de::Visitor<'_> for CounterpartVisitor { type Value = Counterpart; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/crates/header-translator/src/id.rs b/crates/header-translator/src/id.rs index 06f9f1986..ef68b267f 100644 --- a/crates/header-translator/src/id.rs +++ b/crates/header-translator/src/id.rs @@ -59,7 +59,7 @@ pub enum LocationLibrary<'location, 'config> { }, } -impl<'location, 'config> LocationLibrary<'location, 'config> { +impl<'config> LocationLibrary<'_, 'config> { pub fn krate(&self) -> Option<(&'config str, bool)> { match self { Self::System => None, diff --git a/crates/objc2/src/__macro_helpers/mod.rs b/crates/objc2/src/__macro_helpers/mod.rs index 8156def08..c64d1a807 100644 --- a/crates/objc2/src/__macro_helpers/mod.rs +++ b/crates/objc2/src/__macro_helpers/mod.rs @@ -23,6 +23,7 @@ mod module_info; mod msg_send; mod msg_send_retained; mod os_version; +mod sync_unsafe_cell; mod writeback; pub use self::cache::{CachedClass, CachedSel}; @@ -41,6 +42,7 @@ pub use self::module_info::ModuleInfo; pub use self::msg_send::MsgSend; pub use self::msg_send_retained::{MaybeUnwrap, MsgSendId, MsgSendSuperId}; pub use self::os_version::{is_available, AvailableVersion, OSVersion}; +pub use self::sync_unsafe_cell::SyncUnsafeCell; /// Disallow using this passed in value in const and statics for forwards /// compatibility (this function is not a `const` function). diff --git a/crates/objc2/src/__macro_helpers/msg_send.rs b/crates/objc2/src/__macro_helpers/msg_send.rs index 9493ff701..276d0b3bb 100644 --- a/crates/objc2/src/__macro_helpers/msg_send.rs +++ b/crates/objc2/src/__macro_helpers/msg_send.rs @@ -162,7 +162,7 @@ impl MsgSend for T { } } -impl<'a, T: ?Sized + Message> MsgSend for &'a Retained { +impl MsgSend for &Retained { type Inner = T; #[inline] diff --git a/crates/objc2/src/__macro_helpers/msg_send_retained.rs b/crates/objc2/src/__macro_helpers/msg_send_retained.rs index 0464b6445..22994aaa1 100644 --- a/crates/objc2/src/__macro_helpers/msg_send_retained.rs +++ b/crates/objc2/src/__macro_helpers/msg_send_retained.rs @@ -464,7 +464,7 @@ impl<'a> MsgSendIdFailed<'a> for New { } } -impl<'a> MsgSendIdFailed<'a> for Alloc { +impl MsgSendIdFailed<'_> for Alloc { type Args = (); #[cold] diff --git a/crates/objc2/src/__macro_helpers/sync_unsafe_cell.rs b/crates/objc2/src/__macro_helpers/sync_unsafe_cell.rs new file mode 100644 index 000000000..979de8390 --- /dev/null +++ b/crates/objc2/src/__macro_helpers/sync_unsafe_cell.rs @@ -0,0 +1,32 @@ +use core::cell::UnsafeCell; + +#[repr(transparent)] +#[derive(Debug)] +pub struct SyncUnsafeCell { + value: UnsafeCell, +} + +// SAFETY: This type is used for making `static`s which contain `UnsafeCell`. +// The user upholds that such usage is correct. +unsafe impl Sync for SyncUnsafeCell {} + +impl SyncUnsafeCell { + #[inline] + pub const fn new(value: T) -> Self { + Self { + value: UnsafeCell::new(value), + } + } + + #[inline] + pub fn into_inner(self) -> T { + self.value.into_inner() + } +} + +impl SyncUnsafeCell { + #[inline] + pub const fn get(&self) -> *mut T { + self.value.get() + } +} diff --git a/crates/objc2/src/encode.rs b/crates/objc2/src/encode.rs index 7122d9778..81a2a49e0 100644 --- a/crates/objc2/src/encode.rs +++ b/crates/objc2/src/encode.rs @@ -817,8 +817,8 @@ encode_pointer_impls!( ); // SAFETY: References and `NonNull` have a NULL niche -unsafe impl<'a, T: RefEncode + ?Sized> OptionEncode for &'a T {} -unsafe impl<'a, T: RefEncode + ?Sized> OptionEncode for &'a mut T {} +unsafe impl OptionEncode for &T {} +unsafe impl OptionEncode for &mut T {} unsafe impl OptionEncode for NonNull {} /// Helper for implementing [`Encode`]/[`RefEncode`] for function pointers diff --git a/crates/objc2/src/macros/declare_class.rs b/crates/objc2/src/macros/declare_class.rs index 677cfca66..b5c5b20e4 100644 --- a/crates/objc2/src/macros/declare_class.rs +++ b/crates/objc2/src/macros/declare_class.rs @@ -425,9 +425,15 @@ macro_rules! declare_class { // Anonymous block to hide the shared statics const _: () = { - static mut __OBJC2_CLASS: $crate::__macro_helpers::MaybeUninit<&'static $crate::runtime::AnyClass> = $crate::__macro_helpers::MaybeUninit::uninit(); - static mut __OBJC2_IVAR_OFFSET: $crate::__macro_helpers::MaybeUninit<$crate::__macro_helpers::isize> = $crate::__macro_helpers::MaybeUninit::uninit(); - static mut __OBJC2_DROP_FLAG_OFFSET: $crate::__macro_helpers::MaybeUninit<$crate::__macro_helpers::isize> = $crate::__macro_helpers::MaybeUninit::uninit(); + static __OBJC2_CLASS: $crate::__macro_helpers::SyncUnsafeCell< + $crate::__macro_helpers::MaybeUninit<&'static $crate::runtime::AnyClass> + > = $crate::__macro_helpers::SyncUnsafeCell::new($crate::__macro_helpers::MaybeUninit::uninit()); + static __OBJC2_IVAR_OFFSET: $crate::__macro_helpers::SyncUnsafeCell< + $crate::__macro_helpers::MaybeUninit<$crate::__macro_helpers::isize> + > = $crate::__macro_helpers::SyncUnsafeCell::new($crate::__macro_helpers::MaybeUninit::uninit()); + static __OBJC2_DROP_FLAG_OFFSET: $crate::__macro_helpers::SyncUnsafeCell< + $crate::__macro_helpers::MaybeUninit<$crate::__macro_helpers::isize> + > = $crate::__macro_helpers::SyncUnsafeCell::new($crate::__macro_helpers::MaybeUninit::uninit()); // Creation unsafe impl ClassType for $for_class { @@ -458,18 +464,18 @@ macro_rules! declare_class { // SAFETY: Modification is ensured by `Once` to happen // before any access to the variables. unsafe { - __OBJC2_CLASS.write(__objc2_cls); + __OBJC2_CLASS.get().write($crate::__macro_helpers::MaybeUninit::new(__objc2_cls)); if ::HAS_IVARS { - __OBJC2_IVAR_OFFSET.write(__objc2_ivar_offset); + __OBJC2_IVAR_OFFSET.get().write($crate::__macro_helpers::MaybeUninit::new(__objc2_ivar_offset)); } if ::HAS_DROP_FLAG { - __OBJC2_DROP_FLAG_OFFSET.write(__objc2_drop_flag_offset); + __OBJC2_DROP_FLAG_OFFSET.get().write($crate::__macro_helpers::MaybeUninit::new(__objc2_drop_flag_offset)); } } }); // SAFETY: We just registered the class, so is now available - unsafe { __OBJC2_CLASS.assume_init() } + unsafe { __OBJC2_CLASS.get().read().assume_init() } } #[inline] @@ -492,7 +498,7 @@ macro_rules! declare_class { if ::HAS_IVARS { // SAFETY: Accessing the offset is guaranteed to only be // done after the class has been initialized. - unsafe { __OBJC2_IVAR_OFFSET.assume_init() } + unsafe { __OBJC2_IVAR_OFFSET.get().read().assume_init() } } else { // Fall back to an offset of zero. // @@ -506,7 +512,7 @@ macro_rules! declare_class { fn __drop_flag_offset() -> $crate::__macro_helpers::isize { if ::HAS_DROP_FLAG { // SAFETY: Same as above. - unsafe { __OBJC2_DROP_FLAG_OFFSET.assume_init() } + unsafe { __OBJC2_DROP_FLAG_OFFSET.get().read().assume_init() } } else { // Fall back to an offset of zero. // diff --git a/crates/objc2/src/macros/mod.rs b/crates/objc2/src/macros/mod.rs index a871ccffe..ab2ffb0a8 100644 --- a/crates/objc2/src/macros/mod.rs +++ b/crates/objc2/src/macros/mod.rs @@ -427,9 +427,6 @@ macro_rules! __statics_sel { /// Clang does this by marking `REF` with LLVM's /// `externally_initialized`. /// - /// `static mut` is used so that we don't need to wrap the - /// `UnsafeCell` in something that implements `Sync`. - /// /// /// # Safety /// @@ -452,8 +449,8 @@ macro_rules! __statics_sel { link_section = "__OBJC,__message_refs,literal_pointers,no_dead_strip", )] #[export_name = $crate::__macro_helpers::concat!("\x01L_OBJC_SELECTOR_REFERENCES_", $hash)] - static mut REF: $crate::__macro_helpers::UnsafeCell<$crate::runtime::Sel> = unsafe { - $crate::__macro_helpers::UnsafeCell::new($crate::runtime::Sel::__internal_from_ptr(NAME_DATA.as_ptr())) + static REF: $crate::__macro_helpers::SyncUnsafeCell<$crate::runtime::Sel> = unsafe { + $crate::__macro_helpers::SyncUnsafeCell::new($crate::runtime::Sel::__internal_from_ptr(NAME_DATA.as_ptr())) }; $crate::__statics_image_info!($hash); @@ -512,8 +509,8 @@ macro_rules! __statics_class { "\x01L_OBJC_CLASSLIST_REFERENCES_$_", $hash, )] - static mut REF: $crate::__macro_helpers::UnsafeCell<&$crate::runtime::AnyClass> = unsafe { - $crate::__macro_helpers::UnsafeCell::new(&CLASS) + static REF: $crate::__macro_helpers::SyncUnsafeCell<&$crate::runtime::AnyClass> = unsafe { + $crate::__macro_helpers::SyncUnsafeCell::new(&CLASS) }; $crate::__statics_image_info!($hash); @@ -544,9 +541,9 @@ macro_rules! __statics_class { "\x01L_OBJC_CLASS_REFERENCES_", $hash, )] - static mut REF: $crate::__macro_helpers::UnsafeCell<&$crate::runtime::AnyClass> = unsafe { + static REF: $crate::__macro_helpers::SyncUnsafeCell<&$crate::runtime::AnyClass> = unsafe { let ptr: *const $crate::runtime::AnyClass = NAME_DATA.as_ptr().cast(); - $crate::__macro_helpers::UnsafeCell::new(&*ptr) + $crate::__macro_helpers::SyncUnsafeCell::new(&*ptr) }; $crate::__statics_image_info!($hash); diff --git a/crates/objc2/src/runtime/message_receiver.rs b/crates/objc2/src/runtime/message_receiver.rs index 22a9f53ae..1acc6fcfc 100644 --- a/crates/objc2/src/runtime/message_receiver.rs +++ b/crates/objc2/src/runtime/message_receiver.rs @@ -509,8 +509,8 @@ unsafe impl MessageReceiver for NonNull { } } -impl<'a, T: ?Sized + Message> private::Sealed for &'a T {} -unsafe impl<'a, T: ?Sized + Message> MessageReceiver for &'a T { +impl private::Sealed for &T {} +unsafe impl MessageReceiver for &T { type __Inner = T; #[inline] @@ -520,13 +520,13 @@ unsafe impl<'a, T: ?Sized + Message> MessageReceiver for &'a T { } } -impl<'a> private::Sealed for &'a mut AnyObject {} +impl private::Sealed for &mut AnyObject {} /// `&mut AnyObject` is allowed as mutable, for easier transition from `objc`, /// even though it's basically always incorrect to hold `&mut AnyObject`. /// /// Use `*mut AnyObject` instead if you know for certain you need mutability, /// and cannot make do with interior mutability. -unsafe impl<'a> MessageReceiver for &'a mut AnyObject { +unsafe impl MessageReceiver for &mut AnyObject { type __Inner = AnyObject; #[inline] @@ -545,8 +545,8 @@ unsafe impl MessageReceiver for *const AnyClass { } } -impl<'a> private::Sealed for &'a AnyClass {} -unsafe impl<'a> MessageReceiver for &'a AnyClass { +impl private::Sealed for &AnyClass {} +unsafe impl MessageReceiver for &AnyClass { type __Inner = AnyClass; #[inline] diff --git a/crates/objc2/src/runtime/method_encoding_iter.rs b/crates/objc2/src/runtime/method_encoding_iter.rs index 726e9fa0d..da85c9468 100644 --- a/crates/objc2/src/runtime/method_encoding_iter.rs +++ b/crates/objc2/src/runtime/method_encoding_iter.rs @@ -54,7 +54,7 @@ impl<'a> MethodEncodingIter<'a> { } } -impl<'a> Iterator for MethodEncodingIter<'a> { +impl Iterator for MethodEncodingIter<'_> { type Item = Result<(EncodingBox, Option), EncodingParseError>; fn next(&mut self) -> Option { diff --git a/crates/objc2/src/runtime/method_implementation.rs b/crates/objc2/src/runtime/method_implementation.rs index c61036767..a3c3f44c7 100644 --- a/crates/objc2/src/runtime/method_implementation.rs +++ b/crates/objc2/src/runtime/method_implementation.rs @@ -15,7 +15,7 @@ mod private { /// This is a sealed trait that is implemented for a lot of `extern "C"` /// function pointer types. // -// Note: `Sized` is intentionally added to make the trait not object safe. +// Note: `Sized` is intentionally added to make the trait dyn-incompatible. pub trait MethodImplementation: private::Sealed + Sized { /// The callee type of the method. type Callee: ?Sized + RefEncode; diff --git a/crates/objc2/src/top_level_traits.rs b/crates/objc2/src/top_level_traits.rs index dc07daa72..db5351c3c 100644 --- a/crates/objc2/src/top_level_traits.rs +++ b/crates/objc2/src/top_level_traits.rs @@ -572,19 +572,19 @@ unsafe impl MainThreadOnly for ProtocolObject

{} /// [`dyn AllocAnyThread`]: AllocAnyThread /// [`dyn MainThreadOnly`]: MainThreadOnly pub trait ThreadKind: private::SealedThreadKind { - // To mark `ThreadKind` as not object safe for now. + // To mark `ThreadKind` as dyn-incompatible for now. #[doc(hidden)] - const __NOT_OBJECT_SAFE: (); + const __DYN_INCOMPATIBLE: (); } -impl<'a> private::SealedThreadKind for dyn AllocAnyThread + 'a {} -impl<'a> ThreadKind for dyn AllocAnyThread + 'a { - const __NOT_OBJECT_SAFE: () = (); +impl private::SealedThreadKind for dyn AllocAnyThread + '_ {} +impl ThreadKind for dyn AllocAnyThread + '_ { + const __DYN_INCOMPATIBLE: () = (); } -impl<'a> private::SealedThreadKind for dyn MainThreadOnly + 'a {} -impl<'a> ThreadKind for dyn MainThreadOnly + 'a { - const __NOT_OBJECT_SAFE: () = (); +impl private::SealedThreadKind for dyn MainThreadOnly + '_ {} +impl ThreadKind for dyn MainThreadOnly + '_ { + const __DYN_INCOMPATIBLE: () = (); } #[cfg(test)] @@ -592,5 +592,5 @@ mod tests { use super::*; #[allow(unused)] - fn object_safe(_: &dyn AllocAnyThread, _: &dyn MainThreadOnly) {} + fn dyn_compatible(_: &dyn AllocAnyThread, _: &dyn MainThreadOnly) {} } diff --git a/crates/test-ui/ui/add_method_no_bool.stderr b/crates/test-ui/ui/add_method_no_bool.stderr index 115319e73..f17b7d84b 100644 --- a/crates/test-ui/ui/add_method_no_bool.stderr +++ b/crates/test-ui/ui/add_method_no_bool.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `bool: Encode` is not satisfied --> ui/add_method_no_bool.rs | | builder.add_method(sel!(myBoolTakingMethod:), method); - | ---------- ^^^^^^ the trait `Encode` is not implemented for `bool`, which is required by `unsafe extern "C" fn(&NSObject, objc2::runtime::Sel, bool): MethodImplementation` + | ---------- ^^^^^^ the trait `Encode` is not implemented for `bool` | | | required by a bound introduced by this call | @@ -31,7 +31,7 @@ error[E0277]: the trait bound `bool: Encode` is not satisfied --> ui/add_method_no_bool.rs | | builder.add_method(sel!(myBoolReturningMethod), method); - | ---------- ^^^^^^ the trait `Encode` is not implemented for `bool`, which is required by `unsafe extern "C" fn(&NSObject, objc2::runtime::Sel) -> bool: MethodImplementation` + | ---------- ^^^^^^ the trait `Encode` is not implemented for `bool` | | | required by a bound introduced by this call | diff --git a/crates/test-ui/ui/array_iter_invalid.stderr b/crates/test-ui/ui/array_iter_invalid.stderr index 82823fd32..bcc85a06a 100644 --- a/crates/test-ui/ui/array_iter_invalid.stderr +++ b/crates/test-ui/ui/array_iter_invalid.stderr @@ -4,7 +4,7 @@ error[E0277]: `&mut Retained>` is not an iterator | for s in &mut arr { | ^^^^^^^^ `&mut Retained>` is not an iterator | - = help: the trait `Iterator` is not implemented for `Retained>`, which is required by `&mut Retained>: IntoIterator` + = help: the trait `Iterator` is not implemented for `Retained>` = note: required for `&mut Retained>` to implement `Iterator` = note: required for `&mut Retained>` to implement `IntoIterator` help: consider removing the leading `&`-reference @@ -19,7 +19,7 @@ error[E0277]: `&mut Retained>` is not an iterator | for s in &mut arr { | ^^^^^^^^ `&mut Retained>` is not an iterator | - = help: the trait `Iterator` is not implemented for `Retained>`, which is required by `&mut Retained>: IntoIterator` + = help: the trait `Iterator` is not implemented for `Retained>` = note: required for `&mut Retained>` to implement `Iterator` = note: required for `&mut Retained>` to implement `IntoIterator` help: consider removing the leading `&`-reference @@ -34,7 +34,7 @@ error[E0277]: `&mut Retained>` is not an iterator | for s in &mut arr { | ^^^^^^^^ `&mut Retained>` is not an iterator | - = help: the trait `Iterator` is not implemented for `Retained>`, which is required by `&mut Retained>: IntoIterator` + = help: the trait `Iterator` is not implemented for `Retained>` = note: required for `&mut Retained>` to implement `Iterator` = note: required for `&mut Retained>` to implement `IntoIterator` help: consider removing the leading `&`-reference @@ -49,7 +49,7 @@ error[E0277]: `&mut Retained>` is not an iterator | for s in &mut arr { | ^^^^^^^^ `&mut Retained>` is not an iterator | - = help: the trait `Iterator` is not implemented for `Retained>`, which is required by `&mut Retained>: IntoIterator` + = help: the trait `Iterator` is not implemented for `Retained>` = note: required for `&mut Retained>` to implement `Iterator` = note: required for `&mut Retained>` to implement `IntoIterator` help: consider removing the leading `&`-reference diff --git a/crates/test-ui/ui/autoreleasepool_not_send_sync.stderr b/crates/test-ui/ui/autoreleasepool_not_send_sync.stderr index b89b31970..04ac467df 100644 --- a/crates/test-ui/ui/autoreleasepool_not_send_sync.stderr +++ b/crates/test-ui/ui/autoreleasepool_not_send_sync.stderr @@ -4,7 +4,7 @@ error[E0277]: `*mut c_void` cannot be shared between threads safely | needs_sync::>(); | ^^^^^^^^^^^^^^^^^^^ `*mut c_void` cannot be shared between threads safely | - = help: within `AutoreleasePool<'_>`, the trait `Sync` is not implemented for `*mut c_void`, which is required by `AutoreleasePool<'_>: Sync` + = help: within `AutoreleasePool<'_>`, the trait `Sync` is not implemented for `*mut c_void` note: required because it appears within the type `objc2::rc::autorelease::Pool` --> $WORKSPACE/crates/objc2/src/rc/autorelease.rs | @@ -33,7 +33,7 @@ error[E0277]: `*mut c_void` cannot be shared between threads safely | needs_send::>(); | ^^^^^^^^^^^^^^^^^^^ `*mut c_void` cannot be shared between threads safely | - = help: within `objc2::rc::autorelease::Pool`, the trait `Sync` is not implemented for `*mut c_void`, which is required by `AutoreleasePool<'_>: Send` + = help: within `objc2::rc::autorelease::Pool`, the trait `Sync` is not implemented for `*mut c_void` note: required because it appears within the type `objc2::rc::autorelease::Pool` --> $WORKSPACE/crates/objc2/src/rc/autorelease.rs | diff --git a/crates/test-ui/ui/available_invalid.stderr b/crates/test-ui/ui/available_invalid.stderr index 9e9c08026..fef939bd5 100644 --- a/crates/test-ui/ui/available_invalid.stderr +++ b/crates/test-ui/ui/available_invalid.stderr @@ -1,4 +1,4 @@ -error: no rules expected the token `1` +error: no rules expected `1` --> ui/available_invalid.rs | | available!(macos = 1 1); @@ -6,7 +6,7 @@ error: no rules expected the token `1` | = note: while trying to match sequence start -error: no rules expected the token `ABCD` +error: no rules expected `ABCD` --> ui/available_invalid.rs | | available!(macos = ABCD); @@ -30,7 +30,7 @@ note: while trying to match meta-variable `$major:literal` | $os:ident $(= $major:literal $(. $minor:literal $(. $patch:literal)?)?)? | ^^^^^^^^^^^^^^ -error: no rules expected the token `:` +error: no rules expected `:` --> ui/available_invalid.rs | | available!(macos: 1.2); diff --git a/crates/test-ui/ui/declare_class_classtype_imported.stderr b/crates/test-ui/ui/declare_class_classtype_imported.stderr index a60443068..6ed2da67d 100644 --- a/crates/test-ui/ui/declare_class_classtype_imported.stderr +++ b/crates/test-ui/ui/declare_class_classtype_imported.stderr @@ -1,4 +1,4 @@ -error: no rules expected the token `objc2` +error: no rules expected `objc2` --> ui/declare_class_classtype_imported.rs | | unsafe impl objc2::ClassType for CustomObject { diff --git a/crates/test-ui/ui/declare_class_invalid_receiver.stderr b/crates/test-ui/ui/declare_class_invalid_receiver.stderr index a1d3eaa10..eb5853ccc 100644 --- a/crates/test-ui/ui/declare_class_invalid_receiver.stderr +++ b/crates/test-ui/ui/declare_class_invalid_receiver.stderr @@ -10,13 +10,13 @@ error[E0277]: the trait bound `Box: MessageReceiver` is not satisf | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `Box`, which is required by `extern "C-unwind" fn(Box, objc2::runtime::Sel): MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `Box` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -44,13 +44,13 @@ error[E0277]: the trait bound `Retained: MessageReceiver` is not s | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `Retained`, which is required by `extern "C-unwind" fn(Retained, objc2::runtime::Sel): MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `Retained` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -78,13 +78,13 @@ error[E0277]: the trait bound `CustomObject: MessageReceiver` is not satisfied | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `CustomObject`, which is required by `extern "C-unwind" fn(CustomObject, objc2::runtime::Sel): MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `CustomObject` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -162,13 +162,13 @@ error[E0277]: the trait bound `Box: MessageReceiver` is not satisf | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `Box`, which is required by `extern "C-unwind" fn(Box, objc2::runtime::Sel) -> IdReturnValue: MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `Box` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -196,13 +196,13 @@ error[E0277]: the trait bound `Retained: MessageReceiver` is not s | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `Retained`, which is required by `extern "C-unwind" fn(Retained, objc2::runtime::Sel) -> IdReturnValue: MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `Retained` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -230,13 +230,13 @@ error[E0277]: the trait bound `CustomObject: MessageReceiver` is not satisfied | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `CustomObject`, which is required by `extern "C-unwind" fn(CustomObject, objc2::runtime::Sel) -> IdReturnValue: MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `CustomObject` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -262,12 +262,12 @@ error[E0277]: the trait bound `Box: MessageReceiver` is not satisf ... | | | } | | ); - | |_^ the trait `MessageReceiver` is not implemented for `Box`, which is required by `RetainSemantics<5>: MessageRecieveId, Retained>` + | |_^ the trait `MessageReceiver` is not implemented for `Box` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -285,12 +285,12 @@ error[E0277]: the trait bound `Retained: MessageReceiver` is not s ... | | | } | | ); - | |_^ the trait `MessageReceiver` is not implemented for `Retained`, which is required by `RetainSemantics<5>: MessageRecieveId, Retained>` + | |_^ the trait `MessageReceiver` is not implemented for `Retained` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -308,12 +308,12 @@ error[E0277]: the trait bound `CustomObject: MessageReceiver` is not satisfied ... | | | } | | ); - | |_^ the trait `MessageReceiver` is not implemented for `CustomObject`, which is required by `RetainSemantics<5>: MessageRecieveId>` + | |_^ the trait `MessageReceiver` is not implemented for `CustomObject` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -331,12 +331,12 @@ error[E0277]: the trait bound `Allocated: MessageReceiver` is not ... | | | } | | ); - | |_^ the trait `MessageReceiver` is not implemented for `Allocated`, which is required by `RetainSemantics<5>: MessageRecieveId, Retained>` + | |_^ the trait `MessageReceiver` is not implemented for `Allocated` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -356,6 +356,7 @@ error[E0277]: the trait bound `RetainSemantics<3>: MessageRecieveId<&CustomObjec | | ); | |_^ the trait `MessageRecieveId<&CustomObject, Retained>` is not implemented for `RetainSemantics<3>` | - = help: the trait `MessageRecieveId, Retained>` is implemented for `RetainSemantics<3>` + = help: the trait `MessageRecieveId<&CustomObject, Retained>` is not implemented for `RetainSemantics<3>` + but trait `MessageRecieveId, Retained>` is implemented for it = help: for that trait implementation, expected `Allocated`, found `&CustomObject` = note: this error originates in the macro `$crate::__declare_class_method_out_inner` which comes from the expansion of the macro `declare_class` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/test-ui/ui/declare_class_invalid_syntax.stderr b/crates/test-ui/ui/declare_class_invalid_syntax.stderr index 1ffe9ad83..56af91388 100644 --- a/crates/test-ui/ui/declare_class_invalid_syntax.stderr +++ b/crates/test-ui/ui/declare_class_invalid_syntax.stderr @@ -46,7 +46,7 @@ error: expected expression, found `}` | } | ^ expected expression -error: no rules expected the token `(` +error: no rules expected `(` --> ui/declare_class_invalid_syntax.rs | | fn test_pattern((a, b): (u32, i32)) { @@ -66,7 +66,7 @@ note: while trying to match `:` | $param:ident : $param_ty:ty $(, $($rest:tt)*)? | ^ -error: no rules expected the token `(` +error: no rules expected `(` --> ui/declare_class_invalid_syntax.rs | | / declare_class!( @@ -81,7 +81,7 @@ error: no rules expected the token `(` = note: while trying to match end of macro = note: this error originates in the macro `$crate::__declare_class_register_methods` which comes from the expansion of the macro `declare_class` (in Nightly builds, run with -Z macro-backtrace for more info) -error: no rules expected the token `(` +error: no rules expected `(` --> ui/declare_class_invalid_syntax.rs | | / declare_class!( @@ -295,19 +295,19 @@ error: `#[method_id(...)]` must have a return type | = note: this error originates in the macro `$crate::__declare_class_method_out_inner` which comes from the expansion of the macro `declare_class` (in Nightly builds, run with -Z macro-backtrace for more info) -error: no rules expected the token `(` +error: no rules expected `(` --> ui/declare_class_invalid_syntax.rs | | fn test_pattern((a, b): (u32, i32)) { | ^ no rules expected this token in macro call | -note: while trying to match `_` +note: while trying to match reserved identifier `_` --> $WORKSPACE/crates/objc2/src/macros/declare_class.rs | | (_ : $param_ty:ty $(, $($params_rest:tt)*)?) | ^ -error: no rules expected the token `)` +error: no rules expected `)` --> ui/declare_class_invalid_syntax.rs | | / declare_class!( @@ -326,55 +326,55 @@ note: while trying to match `:` | ^ = note: this error originates in the macro `$crate::__declare_class_method_out` which comes from the expansion of the macro `declare_class` (in Nightly builds, run with -Z macro-backtrace for more info) -error: no rules expected the token `pub` +error: no rules expected keyword `pub` --> ui/declare_class_invalid_syntax.rs | | pub fn test_pub() {} | ^^^ no rules expected this token in macro call | -note: while trying to match `unsafe` +note: while trying to match keyword `unsafe` --> $WORKSPACE/crates/objc2/src/macros/declare_class.rs | | unsafe fn $name:ident($($params:tt)*) $(-> $ret:ty)? $body:block | ^^^^^^ -error: no rules expected the token `const` +error: no rules expected keyword `const` --> ui/declare_class_invalid_syntax.rs | | const fn test_const() {} | ^^^^^ no rules expected this token in macro call | -note: while trying to match `unsafe` +note: while trying to match keyword `unsafe` --> $WORKSPACE/crates/objc2/src/macros/declare_class.rs | | unsafe fn $name:ident($($params:tt)*) $(-> $ret:ty)? $body:block | ^^^^^^ -error: no rules expected the token `async` +error: no rules expected keyword `async` --> ui/declare_class_invalid_syntax.rs | | async fn test_async() {} | ^^^^^ no rules expected this token in macro call | -note: while trying to match `unsafe` +note: while trying to match keyword `unsafe` --> $WORKSPACE/crates/objc2/src/macros/declare_class.rs | | unsafe fn $name:ident($($params:tt)*) $(-> $ret:ty)? $body:block | ^^^^^^ -error: no rules expected the token `extern` +error: no rules expected keyword `extern` --> ui/declare_class_invalid_syntax.rs | | extern "C" fn test_extern() {} | ^^^^^^ no rules expected this token in macro call | -note: while trying to match `unsafe` +note: while trying to match keyword `unsafe` --> $WORKSPACE/crates/objc2/src/macros/declare_class.rs | | unsafe fn $name:ident($($params:tt)*) $(-> $ret:ty)? $body:block | ^^^^^^ -error: no rules expected the token `test_fn_fn` +error: no rules expected `test_fn_fn` --> ui/declare_class_invalid_syntax.rs | | fn fn test_fn_fn() {} @@ -386,7 +386,7 @@ note: while trying to match `(` | fn $name:ident($($params:tt)*) $(-> $ret:ty)? $body:block | ^ -error: no rules expected the token `<` +error: no rules expected `<` --> ui/declare_class_invalid_syntax.rs | | fn test_generic() {} @@ -398,7 +398,7 @@ note: while trying to match `(` | fn $name:ident($($params:tt)*) $(-> $ret:ty)? $body:block | ^ -error: no rules expected the token `;` +error: no rules expected `;` --> ui/declare_class_invalid_syntax.rs | | fn test_no_body(&self); @@ -422,7 +422,7 @@ note: while trying to match meta-variable `$body:block` | fn $name:ident($($params:tt)*) $(-> $ret:ty)? $body:block | ^^^^^^^^^^^ -error: no rules expected the token `!` +error: no rules expected `!` --> ui/declare_class_invalid_syntax.rs | | #![doc = "inner_attribute"] @@ -434,7 +434,7 @@ note: while trying to match `[` | $(#[$($m:tt)*])* | ^ -error: no rules expected the token `type` +error: no rules expected keyword `type` --> ui/declare_class_invalid_syntax.rs | | type TypeAlias = Self; @@ -442,7 +442,7 @@ error: no rules expected the token `type` | = note: while trying to match end of macro -error: no rules expected the token `const` +error: no rules expected keyword `const` --> ui/declare_class_invalid_syntax.rs | | const CONSTANT: () = (); @@ -450,13 +450,13 @@ error: no rules expected the token `const` | = note: while trying to match end of macro -error: no rules expected the token `}` +error: no rules expected `}` --> ui/declare_class_invalid_syntax.rs | | } | ^ no rules expected this token in macro call | -note: while trying to match `const` +note: while trying to match keyword `const` --> $WORKSPACE/crates/objc2/src/macros/declare_class.rs | | const NAME: &'static str = $name_const:expr; @@ -468,7 +468,7 @@ error: unexpected end of macro invocation | } | ^ missing tokens in macro arguments | -note: while trying to match `impl` +note: while trying to match keyword `impl` --> $WORKSPACE/crates/objc2/src/macros/declare_class.rs | | impl DeclaredClass for $for_declared:ty { diff --git a/crates/test-ui/ui/declare_class_invalid_type.stderr b/crates/test-ui/ui/declare_class_invalid_type.stderr index 62c72846e..3a5b348d9 100644 --- a/crates/test-ui/ui/declare_class_invalid_type.stderr +++ b/crates/test-ui/ui/declare_class_invalid_type.stderr @@ -8,7 +8,7 @@ error[E0277]: the trait bound `Retained: EncodeReturn` is not sati ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Retained`, which is required by `Retained: __macro_helpers::convert::return_private::Sealed` + | |_^ the trait `Encode` is not implemented for `Retained` | = help: the following other types implement trait `Encode`: &'a T @@ -43,7 +43,7 @@ error[E0277]: the trait bound `Vec<()>: EncodeReturn` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Vec<()>`, which is required by `Vec<()>: __macro_helpers::convert::return_private::Sealed` + | |_^ the trait `Encode` is not implemented for `Vec<()>` | = help: the following other types implement trait `Encode`: &'a T @@ -78,7 +78,7 @@ error[E0277]: the trait bound `Box: EncodeArgument` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Box`, which is required by `Box: __macro_helpers::convert::argument_private::Sealed` + | |_^ the trait `Encode` is not implemented for `Box` | = help: the following other types implement trait `Encode`: &'a T @@ -117,7 +117,7 @@ error[E0277]: the trait bound `CustomObject: EncodeArgument` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `CustomObject`, which is required by `CustomObject: __macro_helpers::convert::argument_private::Sealed` + | |_^ the trait `Encode` is not implemented for `CustomObject` | = help: the following other types implement trait `Encode`: &'a T @@ -156,7 +156,7 @@ error[E0277]: the trait bound `Retained: EncodeReturn` is not sati ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Retained`, which is required by `Retained: ConvertReturn` + | |_^ the trait `Encode` is not implemented for `Retained` | = help: the following other types implement trait `Encode`: &'a T @@ -184,7 +184,7 @@ error[E0277]: the trait bound `Retained: Encode` is not satisfied | | ); | | ^ | | | - | |_the trait `Encode` is not implemented for `Retained`, which is required by `extern "C-unwind" fn(&AnyClass, objc2::runtime::Sel) -> Retained: MethodImplementation` + | |_the trait `Encode` is not implemented for `Retained` | required by a bound introduced by this call | = help: the following other types implement trait `Encode`: @@ -219,7 +219,7 @@ error[E0277]: the trait bound `Vec<()>: EncodeReturn` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Vec<()>`, which is required by `Vec<()>: ConvertReturn` + | |_^ the trait `Encode` is not implemented for `Vec<()>` | = help: the following other types implement trait `Encode`: &'a T @@ -247,7 +247,7 @@ error[E0277]: the trait bound `Vec<()>: Encode` is not satisfied | | ); | | ^ | | | - | |_the trait `Encode` is not implemented for `Vec<()>`, which is required by `extern "C-unwind" fn(&AnyClass, objc2::runtime::Sel) -> Vec<()>: MethodImplementation` + | |_the trait `Encode` is not implemented for `Vec<()>` | required by a bound introduced by this call | = help: the following other types implement trait `Encode`: @@ -282,7 +282,7 @@ error[E0277]: the trait bound `Box: EncodeArgument` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Box`, which is required by `Box: ConvertArgument` + | |_^ the trait `Encode` is not implemented for `Box` | = help: the following other types implement trait `Encode`: &'a T @@ -310,7 +310,7 @@ error[E0277]: the trait bound `Box: Encode` is not satisfied | | ); | | ^ | | | - | |_the trait `Encode` is not implemented for `Box`, which is required by `extern "C-unwind" fn(&CustomObject, objc2::runtime::Sel, Box): MethodImplementation` + | |_the trait `Encode` is not implemented for `Box` | required by a bound introduced by this call | = help: the following other types implement trait `Encode`: @@ -345,7 +345,7 @@ error[E0277]: the trait bound `CustomObject: EncodeArgument` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `CustomObject`, which is required by `CustomObject: ConvertArgument` + | |_^ the trait `Encode` is not implemented for `CustomObject` | = help: the following other types implement trait `Encode`: &'a T @@ -373,7 +373,7 @@ error[E0277]: the trait bound `CustomObject: Encode` is not satisfied | | ); | | ^ | | | - | |_the trait `Encode` is not implemented for `CustomObject`, which is required by `extern "C-unwind" fn(&CustomObject, objc2::runtime::Sel, CustomObject): MethodImplementation` + | |_the trait `Encode` is not implemented for `CustomObject` | required by a bound introduced by this call | = help: the following other types implement trait `Encode`: @@ -408,7 +408,7 @@ error[E0277]: the trait bound `Retained: EncodeReturn` is not sati ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Retained`, which is required by `Retained: ConvertReturn` + | |_^ the trait `Encode` is not implemented for `Retained` | = help: the following other types implement trait `Encode`: &'a T @@ -434,7 +434,7 @@ error[E0277]: the trait bound `Vec<()>: EncodeReturn` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Vec<()>`, which is required by `Vec<()>: ConvertReturn` + | |_^ the trait `Encode` is not implemented for `Vec<()>` | = help: the following other types implement trait `Encode`: &'a T @@ -460,7 +460,7 @@ error[E0277]: the trait bound `Box: EncodeArgument` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `Box`, which is required by `Box: ConvertArgument` + | |_^ the trait `Encode` is not implemented for `Box` | = help: the following other types implement trait `Encode`: &'a T @@ -486,7 +486,7 @@ error[E0277]: the trait bound `CustomObject: EncodeArgument` is not satisfied ... | | | } | | ); - | |_^ the trait `Encode` is not implemented for `CustomObject`, which is required by `CustomObject: ConvertArgument` + | |_^ the trait `Encode` is not implemented for `CustomObject` | = help: the following other types implement trait `Encode`: &'a T diff --git a/crates/test-ui/ui/declare_class_invalid_type2.stderr b/crates/test-ui/ui/declare_class_invalid_type2.stderr index 49888dbb6..2185dc7bd 100644 --- a/crates/test-ui/ui/declare_class_invalid_type2.stderr +++ b/crates/test-ui/ui/declare_class_invalid_type2.stderr @@ -25,7 +25,7 @@ error[E0277]: the trait bound `i32: MaybeOptionId` is not satisfied ... | | | } | | ); - | |_^ the trait `MaybeOptionId` is not implemented for `i32`, which is required by `RetainSemantics<5>: MessageRecieveId<&CustomObject, i32>` + | |_^ the trait `MaybeOptionId` is not implemented for `i32` | = help: the following other types implement trait `MaybeOptionId`: Option> diff --git a/crates/test-ui/ui/declare_class_mut_self_not_mutable.stderr b/crates/test-ui/ui/declare_class_mut_self_not_mutable.stderr index 78601ed30..dc70f5dc1 100644 --- a/crates/test-ui/ui/declare_class_mut_self_not_mutable.stderr +++ b/crates/test-ui/ui/declare_class_mut_self_not_mutable.stderr @@ -10,13 +10,13 @@ error[E0277]: the trait bound `&mut CustomObject: MessageReceiver` is not satisf | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `&mut CustomObject`, which is required by `extern "C-unwind" fn(&mut CustomObject, objc2::runtime::Sel) -> &mut CustomObject: MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `&mut CustomObject` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -45,13 +45,13 @@ error[E0277]: the trait bound `&mut CustomObject: MessageReceiver` is not satisf | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `&mut CustomObject`, which is required by `extern "C-unwind" fn(&mut CustomObject, objc2::runtime::Sel): MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `&mut CustomObject` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -80,13 +80,13 @@ error[E0277]: the trait bound `&mut CustomObject: MessageReceiver` is not satisf | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `&mut CustomObject`, which is required by `extern "C-unwind" fn(&mut CustomObject, objc2::runtime::Sel) -> IdReturnValue: MethodImplementation` + | |_the trait `MessageReceiver` is not implemented for `&mut CustomObject` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -113,12 +113,12 @@ error[E0277]: the trait bound `&mut CustomObject: MessageReceiver` is not satisf ... | | | } | | ); - | |_^ the trait `MessageReceiver` is not implemented for `&mut CustomObject`, which is required by `RetainSemantics<5>: MessageRecieveId<&mut CustomObject, Retained>` + | |_^ the trait `MessageReceiver` is not implemented for `&mut CustomObject` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T diff --git a/crates/test-ui/ui/extern_class_thread_kind_invalid.stderr b/crates/test-ui/ui/extern_class_thread_kind_invalid.stderr index fa99140ae..180fb4101 100644 --- a/crates/test-ui/ui/extern_class_thread_kind_invalid.stderr +++ b/crates/test-ui/ui/extern_class_thread_kind_invalid.stderr @@ -4,11 +4,11 @@ error[E0038]: the trait `ThreadKind` cannot be made into an object | type ThreadKind = dyn ThreadKind; | ^^^^^^^^^^^^^^ `ThreadKind` cannot be made into an object | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit --> $WORKSPACE/crates/objc2/src/top_level_traits.rs | - | const __NOT_OBJECT_SAFE: (); - | ^^^^^^^^^^^^^^^^^ the trait cannot be made into an object because it contains this associated `const` + | const __DYN_INCOMPATIBLE: (); + | ^^^^^^^^^^^^^^^^^^ the trait cannot be made into an object because it contains this associated `const` error[E0277]: the trait bound `BogusThreadKind: ValidThreadKind<(dyn ThreadKind + 'static)>` is not satisfied --> ui/extern_class_thread_kind_invalid.rs @@ -36,9 +36,9 @@ error[E0038]: the trait `ThreadKind` cannot be made into an object | | ); | |_^ `ThreadKind` cannot be made into an object | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit +note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit --> $WORKSPACE/crates/objc2/src/top_level_traits.rs | - | const __NOT_OBJECT_SAFE: (); - | ^^^^^^^^^^^^^^^^^ the trait cannot be made into an object because it contains this associated `const` + | const __DYN_INCOMPATIBLE: (); + | ^^^^^^^^^^^^^^^^^^ the trait cannot be made into an object because it contains this associated `const` = note: this error originates in the macro `$crate::__inner_extern_class` which comes from the expansion of the macro `extern_class` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/crates/test-ui/ui/extern_methods_invalid_type.stderr b/crates/test-ui/ui/extern_methods_invalid_type.stderr index d399ad606..68218e13c 100644 --- a/crates/test-ui/ui/extern_methods_invalid_type.stderr +++ b/crates/test-ui/ui/extern_methods_invalid_type.stderr @@ -7,7 +7,7 @@ error[E0277]: the trait bound `Retained: ConvertReturn` is not satisfi | | fn a(&self) -> Retained; | | } | | ); - | |_^ the trait `Encode` is not implemented for `Retained`, which is required by `Retained: ConvertReturn` + | |_^ the trait `Encode` is not implemented for `Retained` | = help: the following other types implement trait `Encode`: &'a T @@ -62,7 +62,7 @@ error[E0277]: the trait bound `Box: Encode` is not satisfied | | fn c(&self, arg: Box); | | } | | ); - | |_^ the trait `Encode` is not implemented for `Box`, which is required by `(Box,): ConvertArguments` + | |_^ the trait `Encode` is not implemented for `Box` | = help: the following other types implement trait `Encode`: &'a T @@ -96,7 +96,7 @@ error[E0277]: the trait bound `Result<(), Retained>: ConvertReturn` is | | fn error(arg: i32) -> Result<(), Retained>; | | } | | ); - | |_^ the trait `Encode` is not implemented for `Result<(), Retained>`, which is required by `Result<(), Retained>: ConvertReturn` + | |_^ the trait `Encode` is not implemented for `Result<(), Retained>` | = help: the following other types implement trait `Encode`: &'a T @@ -151,7 +151,7 @@ error[E0277]: the trait bound `MainThreadMarker: ConvertReturn` is not satisfied | | fn main_thread_marker_as_return() -> MainThreadMarker; | | } | | ); - | |_^ the trait `Encode` is not implemented for `MainThreadMarker`, which is required by `MainThreadMarker: ConvertReturn` + | |_^ the trait `Encode` is not implemented for `MainThreadMarker` | = help: the following other types implement trait `Encode`: &'a T diff --git a/crates/test-ui/ui/extern_methods_not_allowed_mutable.stderr b/crates/test-ui/ui/extern_methods_not_allowed_mutable.stderr index 8bc49b6e9..8839928ba 100644 --- a/crates/test-ui/ui/extern_methods_not_allowed_mutable.stderr +++ b/crates/test-ui/ui/extern_methods_not_allowed_mutable.stderr @@ -9,13 +9,13 @@ error[E0277]: the trait bound `&mut MyObject: MsgSend` is not satisfied | | ); | | ^ | | | - | |_the trait `MessageReceiver` is not implemented for `&mut MyObject`, which is required by `&mut MyObject: MsgSend` + | |_the trait `MessageReceiver` is not implemented for `&mut MyObject` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -33,12 +33,12 @@ error[E0277]: the trait bound `&mut MyObject: MessageReceiver` is not satisfied | | fn test_id(&mut self) -> Retained; | | } | | ); - | |_^ the trait `MessageReceiver` is not implemented for `&mut MyObject`, which is required by `RetainSemantics<5>: MsgSendId<_, _>` + | |_^ the trait `MessageReceiver` is not implemented for `&mut MyObject` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T diff --git a/crates/test-ui/ui/global_block_not_encode.stderr b/crates/test-ui/ui/global_block_not_encode.stderr index 0af60498d..ffcb5e8b0 100644 --- a/crates/test-ui/ui/global_block_not_encode.stderr +++ b/crates/test-ui/ui/global_block_not_encode.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `Box: objc2::encode::Encode` is not satisfied | / global_block! { | | pub static BLOCK = |_b: Box| {}; | | } - | |_^ the trait `objc2::encode::Encode` is not implemented for `Box`, which is required by `GlobalBlock<(dyn Fn(Box) + 'static)>: Sync` + | |_^ the trait `objc2::encode::Encode` is not implemented for `Box` | = help: the following other types implement trait `objc2::encode::Encode`: &'a T diff --git a/crates/test-ui/ui/invalid_msg_send.stderr b/crates/test-ui/ui/invalid_msg_send.stderr index 9eee34784..dbc0bbd1b 100644 --- a/crates/test-ui/ui/invalid_msg_send.stderr +++ b/crates/test-ui/ui/invalid_msg_send.stderr @@ -22,20 +22,20 @@ note: while trying to match meta-variable `$selector_and_arguments:tt` | [$obj:expr, $($selector_and_arguments:tt)+] => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: no rules expected the token `)` +error: no rules expected `)` --> ui/invalid_msg_send.rs | | let _: () = unsafe { msg_send![obj, a:] }; | ^^^^^^^^^^^^^^^^^^ no rules expected this token in macro call | -note: while trying to match `_` +note: while trying to match reserved identifier `_` --> $WORKSPACE/crates/objc2/src/macros/__msg_send_parse.rs | | ($selector:ident: _ $(,)?) | ^ = note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) -error: no rules expected the token `)` +error: no rules expected `)` --> ui/invalid_msg_send.rs | | let _: () = unsafe { msg_send![obj, a: b c] }; @@ -59,7 +59,7 @@ error: expected identifier, found `:` | ($selector:ident : $argument:expr $(, $($rest:tt)*)?) | -------------- while parsing argument for this `expr` macro fragment -error: no rules expected the token `d` +error: no rules expected `d` --> ui/invalid_msg_send.rs | | let _: () = unsafe { msg_send![obj, a: b, c d] }; @@ -82,7 +82,7 @@ error: expected identifier, found `:` | ($selector:ident : $argument:expr $(, $($rest:tt)*)?) | -------------- while parsing argument for this `expr` macro fragment -error: no rules expected the token `,` +error: no rules expected `,` --> ui/invalid_msg_send.rs | | let _: () = unsafe { msg_send![obj, a: b c: d,] }; @@ -94,7 +94,7 @@ note: while trying to match `)` | ($($selector:ident : $argument:expr)*) | ^ -error: no rules expected the token `b` +error: no rules expected `b` --> ui/invalid_msg_send.rs | | let _: Result<(), Retained> = unsafe { msg_send![obj, a: _, b: _] }; diff --git a/crates/test-ui/ui/mainthreadmarker_not_send_sync.stderr b/crates/test-ui/ui/mainthreadmarker_not_send_sync.stderr index 1915d6f0f..f226c2313 100644 --- a/crates/test-ui/ui/mainthreadmarker_not_send_sync.stderr +++ b/crates/test-ui/ui/mainthreadmarker_not_send_sync.stderr @@ -4,7 +4,7 @@ error[E0277]: `*mut ()` cannot be shared between threads safely | needs_sync::(); | ^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely | - = help: within `MainThreadMarker`, the trait `Sync` is not implemented for `*mut ()`, which is required by `MainThreadMarker: Sync` + = help: within `MainThreadMarker`, the trait `Sync` is not implemented for `*mut ()` note: required because it appears within the type `PhantomData<*mut ()>` --> $RUST/core/src/marker.rs | @@ -27,7 +27,7 @@ error[E0277]: `*mut ()` cannot be sent between threads safely | needs_send::(); | ^^^^^^^^^^^^^^^^ `*mut ()` cannot be sent between threads safely | - = help: within `MainThreadMarker`, the trait `Send` is not implemented for `*mut ()`, which is required by `MainThreadMarker: Send` + = help: within `MainThreadMarker`, the trait `Send` is not implemented for `*mut ()` note: required because it appears within the type `PhantomData<*mut ()>` --> $RUST/core/src/marker.rs | diff --git a/crates/test-ui/ui/message_receiver_simple.stderr b/crates/test-ui/ui/message_receiver_simple.stderr index bd594cf61..f82fe96fb 100644 --- a/crates/test-ui/ui/message_receiver_simple.stderr +++ b/crates/test-ui/ui/message_receiver_simple.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `&Retained: runtime::message_receiver::p --> ui/message_receiver_simple.rs | | let _: usize = unsafe { MessageReceiver::send_message(&obj, sel!(hash), ()) }; - | ----------------------------- ^^^ the trait `Message` is not implemented for `Retained`, which is required by `&Retained: runtime::message_receiver::private::Sealed` + | ----------------------------- ^^^ the trait `Message` is not implemented for `Retained` | | | required by a bound introduced by this call | @@ -24,7 +24,7 @@ error[E0277]: the trait bound `bool: Encode` is not satisfied --> ui/message_receiver_simple.rs | | let _: () = unsafe { MessageReceiver::send_message(&*obj, sel!(hash:), (true,)) }; - | ----------------------------- ^^^^ the trait `Encode` is not implemented for `bool`, which is required by `(bool,): EncodeArguments` + | ----------------------------- ^^^^ the trait `Encode` is not implemented for `bool` | | | required by a bound introduced by this call | @@ -50,7 +50,7 @@ error[E0277]: the trait bound `bool: EncodeReturn` is not satisfied --> ui/message_receiver_simple.rs | | let _: bool = unsafe { MessageReceiver::send_message(&*obj, sel!(hash), ()) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `bool`, which is required by `bool: EncodeReturn` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `bool` | = help: the following other types implement trait `Encode`: &'a T diff --git a/crates/test-ui/ui/msg_send_invalid_receiver.stderr b/crates/test-ui/ui/msg_send_invalid_receiver.stderr index 56a086d5f..9970828c9 100644 --- a/crates/test-ui/ui/msg_send_invalid_receiver.stderr +++ b/crates/test-ui/ui/msg_send_invalid_receiver.stderr @@ -87,12 +87,12 @@ error[E0277]: the trait bound `Retained: MessageReceiver` is not satis --> ui/msg_send_invalid_receiver.rs | | let _: Retained = unsafe { msg_send_id![obj, new] }; - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `MessageReceiver` is not implemented for `Retained`, which is required by `RetainSemantics<1>: MsgSendId<_, _>` + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `MessageReceiver` is not implemented for `Retained` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -105,12 +105,12 @@ error[E0277]: the trait bound `Retained: MessageReceiver` is not satis --> ui/msg_send_invalid_receiver.rs | | let _: Retained = unsafe { msg_send_id![obj, copy] }; - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `MessageReceiver` is not implemented for `Retained`, which is required by `RetainSemantics<4>: MsgSendId<_, _>` + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `MessageReceiver` is not implemented for `Retained` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T diff --git a/crates/test-ui/ui/msg_send_invalid_return.stderr b/crates/test-ui/ui/msg_send_invalid_return.stderr index 9783acd01..bcaef9b0f 100644 --- a/crates/test-ui/ui/msg_send_invalid_return.stderr +++ b/crates/test-ui/ui/msg_send_invalid_return.stderr @@ -19,7 +19,7 @@ error[E0277]: the trait bound `AnyClass: Message` is not satisfied --> ui/msg_send_invalid_return.rs | | let _: Retained = unsafe { msg_send_id![cls, new] }; - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Message` is not implemented for `AnyClass`, which is required by `RetainSemantics<1>: MsgSendId<_, _>` + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Message` is not implemented for `AnyClass` | = help: the following other types implement trait `Message`: AnyObject @@ -34,7 +34,7 @@ error[E0277]: the trait bound `AnyClass: Message` is not satisfied --> ui/msg_send_invalid_return.rs | | let _: Option> = unsafe { msg_send_id![cls, new] }; - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Message` is not implemented for `AnyClass`, which is required by `RetainSemantics<1>: MsgSendId<_, _>` + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Message` is not implemented for `AnyClass` | = help: the following other types implement trait `Message`: AnyObject diff --git a/crates/test-ui/ui/msg_send_not_allowed_mutable.stderr b/crates/test-ui/ui/msg_send_not_allowed_mutable.stderr index 9429e2e4b..aabdaef82 100644 --- a/crates/test-ui/ui/msg_send_not_allowed_mutable.stderr +++ b/crates/test-ui/ui/msg_send_not_allowed_mutable.stderr @@ -4,13 +4,13 @@ error[E0277]: the trait bound `&mut NSObject: MsgSend` is not satisfied | let _: () = unsafe { msg_send![&mut *obj, test] }; | ----------^^^^^^^^^------- | | | - | | the trait `MessageReceiver` is not implemented for `&mut NSObject`, which is required by `&mut NSObject: MsgSend` + | | the trait `MessageReceiver` is not implemented for `&mut NSObject` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T @@ -22,12 +22,12 @@ error[E0277]: the trait bound `&mut NSObject: MessageReceiver` is not satisfied --> ui/msg_send_not_allowed_mutable.rs | | let _: Retained = unsafe { msg_send_id![obj, test] }; - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `MessageReceiver` is not implemented for `&mut NSObject`, which is required by `RetainSemantics<5>: MsgSendId<_, _>` + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `MessageReceiver` is not implemented for `&mut NSObject` | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T diff --git a/crates/test-ui/ui/msg_send_not_encode.stderr b/crates/test-ui/ui/msg_send_not_encode.stderr index b0dac3000..d561b9021 100644 --- a/crates/test-ui/ui/msg_send_not_encode.stderr +++ b/crates/test-ui/ui/msg_send_not_encode.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `Vec: ConvertReturn` is not satisfied --> ui/msg_send_not_encode.rs | | let _: Vec = msg_send![cls, new]; - | ^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Vec`, which is required by `Vec: ConvertReturn` + | ^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Vec` | = help: the following other types implement trait `Encode`: &'a T @@ -30,7 +30,7 @@ error[E0277]: the trait bound `Vec: Encode` is not satisfied --> ui/msg_send_not_encode.rs | | let _: () = msg_send![cls, newWith: x]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Vec`, which is required by `(Vec,): ConvertArguments` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Vec` | = help: the following other types implement trait `Encode`: &'a T @@ -59,7 +59,7 @@ error[E0277]: the trait bound `(): Encode` is not satisfied --> ui/msg_send_not_encode.rs | | let _: () = msg_send![cls, unitAsArgument: ()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `()`, which is required by `((),): ConvertArguments` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `()` | = help: the following other types implement trait `Encode`: &'a T diff --git a/crates/test-ui/ui/msg_send_only_message.stderr b/crates/test-ui/ui/msg_send_only_message.stderr index 10c802bf0..c2eabbc74 100644 --- a/crates/test-ui/ui/msg_send_only_message.stderr +++ b/crates/test-ui/ui/msg_send_only_message.stderr @@ -4,13 +4,13 @@ error[E0277]: the trait bound `{integer}: MsgSend` is not satisfied | unsafe { msg_send![1, new] }; | ----------^------ | | | - | | the trait `MessageReceiver` is not implemented for `{integer}`, which is required by `{integer}: MsgSend` + | | the trait `MessageReceiver` is not implemented for `{integer}` | required by a bound introduced by this call | = help: the following other types implement trait `MessageReceiver`: - &'a AnyClass - &'a T - &'a mut AnyObject + &AnyClass + &T + &mut AnyObject *const AnyClass *const T *mut T diff --git a/crates/test-ui/ui/not_encode.stderr b/crates/test-ui/ui/not_encode.stderr index 46f25f592..00e6f63c4 100644 --- a/crates/test-ui/ui/not_encode.stderr +++ b/crates/test-ui/ui/not_encode.stderr @@ -46,7 +46,7 @@ error[E0277]: the trait bound `&(): Encode` is not satisfied --> ui/not_encode.rs | | is_encode::<&()>(); - | ^^^ the trait `RefEncode` is not implemented for `()`, which is required by `&(): Encode` + | ^^^ the trait `RefEncode` is not implemented for `()` | = help: the following other types implement trait `RefEncode`: &'a T @@ -69,7 +69,7 @@ error[E0277]: the trait bound `(): RefEncode` is not satisfied --> ui/not_encode.rs | | is_encode::<*const ()>(); - | ^^^^^^^^^ the trait `RefEncode` is not implemented for `()`, which is required by `*const (): Encode` + | ^^^^^^^^^ the trait `RefEncode` is not implemented for `()` | = help: the following other types implement trait `RefEncode`: &'a T @@ -114,7 +114,7 @@ error[E0277]: the trait bound `(): Encode` is not satisfied --> ui/not_encode.rs | | is_encode::<&Block>(); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `()`, which is required by `&block2::Block: Encode` + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `()` | = help: the following other types implement trait `Encode`: &'a T @@ -140,7 +140,7 @@ error[E0277]: the trait bound `bool: Encode` is not satisfied --> ui/not_encode.rs | | is_encode::<&Block bool>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `bool`, which is required by `&block2::Block bool>: Encode` + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `bool` | = help: the following other types implement trait `Encode`: &'a T @@ -232,7 +232,7 @@ error[E0277]: the trait bound `&objc2::runtime::Sel: Encode` is not satisfied --> ui/not_encode.rs | | is_encode::<&Sel>(); - | ^^^^ the trait `RefEncode` is not implemented for `objc2::runtime::Sel`, which is required by `&objc2::runtime::Sel: Encode` + | ^^^^ the trait `RefEncode` is not implemented for `objc2::runtime::Sel` | = note: required for `&objc2::runtime::Sel` to implement `Encode` note: required by a bound in `is_encode` @@ -250,11 +250,11 @@ error[E0277]: the trait bound `UnsafeCell<&u8>: OptionEncode` is not satisfied --> ui/not_encode.rs | | is_encode::>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `OptionEncode` is not implemented for `UnsafeCell<&u8>`, which is required by `Option>: Encode` + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `OptionEncode` is not implemented for `UnsafeCell<&u8>` | = help: the following other types implement trait `OptionEncode`: - &'a T - &'a mut T + &T + &mut T NonNull NonZero NonZero @@ -273,11 +273,11 @@ error[E0277]: the trait bound `Cell<&u8>: OptionEncode` is not satisfied --> ui/not_encode.rs | | is_encode::>>(); - | ^^^^^^^^^^^^^^^^^ the trait `OptionEncode` is not implemented for `Cell<&u8>`, which is required by `Option>: Encode` + | ^^^^^^^^^^^^^^^^^ the trait `OptionEncode` is not implemented for `Cell<&u8>` | = help: the following other types implement trait `OptionEncode`: - &'a T - &'a mut T + &T + &mut T NonNull NonZero NonZero diff --git a/crates/test-ui/ui/not_writeback.stderr b/crates/test-ui/ui/not_writeback.stderr index 464cc8b20..6bb428858 100644 --- a/crates/test-ui/ui/not_writeback.stderr +++ b/crates/test-ui/ui/not_writeback.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `&mut Retained: ConvertReturn` is not sa --> ui/not_writeback.rs | | let _: &mut Retained = unsafe { msg_send![obj, a] }; - | ^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained`, which is required by `&mut Retained: ConvertReturn` + | ^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained` | = help: the following other types implement trait `RefEncode`: &'a T @@ -31,7 +31,7 @@ error[E0277]: the trait bound `Retained: Encode` is not satisfied --> ui/not_writeback.rs | | let _: () = unsafe { msg_send![obj, a: param] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Retained`, which is required by `(Retained,): ConvertArguments` + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Retained` | = help: the following other types implement trait `Encode`: &'a T @@ -60,7 +60,7 @@ error[E0277]: the trait bound `Retained: RefEncode` is not satisfied --> ui/not_writeback.rs | | let _: () = unsafe { msg_send![obj, a: ¶m] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained`, which is required by `(&Retained,): ConvertArguments` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained` | = help: the following other types implement trait `RefEncode`: &'a T @@ -90,7 +90,7 @@ error[E0277]: the trait bound `Retained: RefEncode` is not satisfied --> ui/not_writeback.rs | | let _: () = unsafe { msg_send![obj, a: Some(¶m)] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained`, which is required by `(Option<&Retained>,): ConvertArguments` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained` | = help: the following other types implement trait `RefEncode`: &'a T @@ -122,7 +122,7 @@ error[E0277]: the trait bound `Retained: RefEncode` is not satisfied --> ui/not_writeback.rs | | let _: () = unsafe { msg_send![obj, a: param] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained`, which is required by `(*mut Retained,): ConvertArguments` + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained` | = help: the following other types implement trait `RefEncode`: &'a T @@ -152,7 +152,7 @@ error[E0277]: the trait bound `Retained: RefEncode` is not satisfied --> ui/not_writeback.rs | | let _: () = unsafe { msg_send![obj, a: param] }; - | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained`, which is required by `(&mut &mut Retained,): ConvertArguments` + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `RefEncode` is not implemented for `Retained` | = help: the following other types implement trait `RefEncode`: &'a T diff --git a/crates/test-ui/ui/nsarray_bound_not_send_sync.stderr b/crates/test-ui/ui/nsarray_bound_not_send_sync.stderr index af21edcc0..388f5ed90 100644 --- a/crates/test-ui/ui/nsarray_bound_not_send_sync.stderr +++ b/crates/test-ui/ui/nsarray_bound_not_send_sync.stderr @@ -4,7 +4,7 @@ error[E0277]: `*mut NSObject` cannot be shared between threads safely | needs_sync::>(); | ^^^^^^^^^^^^^^^^^ `*mut NSObject` cannot be shared between threads safely | - = help: within `NSArray`, the trait `Sync` is not implemented for `*mut NSObject`, which is required by `NSArray: Sync` + = help: within `NSArray`, the trait `Sync` is not implemented for `*mut NSObject` note: required because it appears within the type `PhantomData<*mut NSObject>` --> $RUST/core/src/marker.rs | @@ -27,7 +27,7 @@ error[E0277]: `UnsafeCell, PhantomPinned)>>` | needs_sync::>(); | ^^^^^^^^^^^^^^^^^ `UnsafeCell, PhantomPinned)>>` cannot be shared between threads safely | - = help: within `NSArray`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>`, which is required by `NSArray: Sync` + = help: within `NSArray`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>` note: required because it appears within the type `objc2::runtime::AnyObject` --> $WORKSPACE/crates/objc2/src/runtime/mod.rs | @@ -55,7 +55,7 @@ error[E0277]: `*mut NSObject` cannot be sent between threads safely | needs_send::>(); | ^^^^^^^^^^^^^^^^^ `*mut NSObject` cannot be sent between threads safely | - = help: within `NSArray`, the trait `Send` is not implemented for `*mut NSObject`, which is required by `NSArray: Send` + = help: within `NSArray`, the trait `Send` is not implemented for `*mut NSObject` note: required because it appears within the type `PhantomData<*mut NSObject>` --> $RUST/core/src/marker.rs | @@ -78,7 +78,7 @@ error[E0277]: `*const UnsafeCell<()>` cannot be sent between threads safely | needs_send::>(); | ^^^^^^^^^^^^^^^^^ `*const UnsafeCell<()>` cannot be sent between threads safely | - = help: within `NSArray`, the trait `Send` is not implemented for `*const UnsafeCell<()>`, which is required by `NSArray: Send` + = help: within `NSArray`, the trait `Send` is not implemented for `*const UnsafeCell<()>` = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)` note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>` --> $RUST/core/src/marker.rs @@ -117,7 +117,7 @@ error[E0277]: `*mut NSObject` cannot be shared between threads safely | needs_sync::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `*mut NSObject` cannot be shared between threads safely | - = help: within `NSMutableArray`, the trait `Sync` is not implemented for `*mut NSObject`, which is required by `NSMutableArray: Sync` + = help: within `NSMutableArray`, the trait `Sync` is not implemented for `*mut NSObject` note: required because it appears within the type `PhantomData<*mut NSObject>` --> $RUST/core/src/marker.rs | @@ -140,7 +140,7 @@ error[E0277]: `UnsafeCell, PhantomPinned)>>` | needs_sync::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell, PhantomPinned)>>` cannot be shared between threads safely | - = help: within `NSMutableArray`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>`, which is required by `NSMutableArray: Sync` + = help: within `NSMutableArray`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>` note: required because it appears within the type `objc2::runtime::AnyObject` --> $WORKSPACE/crates/objc2/src/runtime/mod.rs | @@ -173,7 +173,7 @@ error[E0277]: `*mut NSObject` cannot be sent between threads safely | needs_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `*mut NSObject` cannot be sent between threads safely | - = help: within `NSMutableArray`, the trait `Send` is not implemented for `*mut NSObject`, which is required by `NSMutableArray: Send` + = help: within `NSMutableArray`, the trait `Send` is not implemented for `*mut NSObject` note: required because it appears within the type `PhantomData<*mut NSObject>` --> $RUST/core/src/marker.rs | @@ -196,7 +196,7 @@ error[E0277]: `*const UnsafeCell<()>` cannot be sent between threads safely | needs_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `*const UnsafeCell<()>` cannot be sent between threads safely | - = help: within `NSMutableArray`, the trait `Send` is not implemented for `*const UnsafeCell<()>`, which is required by `NSMutableArray: Send` + = help: within `NSMutableArray`, the trait `Send` is not implemented for `*const UnsafeCell<()>` = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)` note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>` --> $RUST/core/src/marker.rs diff --git a/crates/test-ui/ui/object_not_send_sync.stderr b/crates/test-ui/ui/object_not_send_sync.stderr index 99136b364..b3d9b8b56 100644 --- a/crates/test-ui/ui/object_not_send_sync.stderr +++ b/crates/test-ui/ui/object_not_send_sync.stderr @@ -4,7 +4,7 @@ error[E0277]: `UnsafeCell, PhantomPinned)>>` | needs_sync::(); | ^^^^^^^^^ `UnsafeCell, PhantomPinned)>>` cannot be shared between threads safely | - = help: within `AnyObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>`, which is required by `AnyObject: Sync` + = help: within `AnyObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>` note: required because it appears within the type `AnyObject` --> $WORKSPACE/crates/objc2/src/runtime/mod.rs | @@ -22,7 +22,7 @@ error[E0277]: `*const UnsafeCell<()>` cannot be sent between threads safely | needs_send::(); | ^^^^^^^^^ `*const UnsafeCell<()>` cannot be sent between threads safely | - = help: within `AnyObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>`, which is required by `AnyObject: Send` + = help: within `AnyObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>` = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)` note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>` --> $RUST/core/src/marker.rs @@ -51,7 +51,7 @@ error[E0277]: `UnsafeCell, PhantomPinned)>>` | needs_sync::(); | ^^^^^^^^ `UnsafeCell, PhantomPinned)>>` cannot be shared between threads safely | - = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>`, which is required by `NSObject: Sync` + = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>` note: required because it appears within the type `AnyObject` --> $WORKSPACE/crates/objc2/src/runtime/mod.rs | @@ -74,7 +74,7 @@ error[E0277]: `*const UnsafeCell<()>` cannot be sent between threads safely | needs_send::(); | ^^^^^^^^ `*const UnsafeCell<()>` cannot be sent between threads safely | - = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>`, which is required by `NSObject: Send` + = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>` = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)` note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>` --> $RUST/core/src/marker.rs @@ -108,7 +108,7 @@ error[E0277]: `UnsafeCell, PhantomPinned)>>` | needs_sync::(); | ^^^^^^^ `UnsafeCell, PhantomPinned)>>` cannot be shared between threads safely | - = help: within `NSValue`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>`, which is required by `NSValue: Sync` + = help: within `NSValue`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>` note: required because it appears within the type `AnyObject` --> $WORKSPACE/crates/objc2/src/runtime/mod.rs | @@ -136,7 +136,7 @@ error[E0277]: `*const UnsafeCell<()>` cannot be sent between threads safely | needs_send::(); | ^^^^^^^ `*const UnsafeCell<()>` cannot be sent between threads safely | - = help: within `NSValue`, the trait `Send` is not implemented for `*const UnsafeCell<()>`, which is required by `NSValue: Send` + = help: within `NSValue`, the trait `Send` is not implemented for `*const UnsafeCell<()>` = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)` note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>` --> $RUST/core/src/marker.rs diff --git a/crates/test-ui/ui/protocol_object_only_protocols.stderr b/crates/test-ui/ui/protocol_object_only_protocols.stderr index c0dffa165..5ff49b771 100644 --- a/crates/test-ui/ui/protocol_object_only_protocols.stderr +++ b/crates/test-ui/ui/protocol_object_only_protocols.stderr @@ -34,14 +34,14 @@ error[E0277]: the trait bound `dyn Send: ImplementedBy` is not satisfi | required by a bound introduced by this call | = help: the following other types implement trait `ImplementedBy`: - (dyn NSCoding + 'static) - (dyn NSCopying + 'static) - (dyn NSDiscardableContent + 'static) - (dyn NSFastEnumeration + 'static) - (dyn NSMutableCopying + 'static) - (dyn NSObjectProtocol + 'static) - (dyn NSObjectProtocol + Send + 'static) - (dyn NSObjectProtocol + Send + Sync + 'static) + dyn NSCoding + dyn NSCopying + dyn NSDiscardableContent + dyn NSFastEnumeration + dyn NSMutableCopying + dyn NSObjectProtocol + Send + Sync + dyn NSObjectProtocol + Send + dyn NSObjectProtocol + Sync and $N others note: required by a bound in `ProtocolObject::

::from_ref` --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs @@ -61,14 +61,14 @@ error[E0277]: the trait bound `dyn Foo: ImplementedBy` is not satisfie | required by a bound introduced by this call | = help: the following other types implement trait `ImplementedBy`: - (dyn NSCoding + 'static) - (dyn NSCopying + 'static) - (dyn NSDiscardableContent + 'static) - (dyn NSFastEnumeration + 'static) - (dyn NSMutableCopying + 'static) - (dyn NSObjectProtocol + 'static) - (dyn NSObjectProtocol + Send + 'static) - (dyn NSObjectProtocol + Send + Sync + 'static) + dyn NSCoding + dyn NSCopying + dyn NSDiscardableContent + dyn NSFastEnumeration + dyn NSMutableCopying + dyn NSObjectProtocol + Send + Sync + dyn NSObjectProtocol + Send + dyn NSObjectProtocol + Sync and $N others note: required by a bound in `ProtocolObject::

::from_ref` --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs @@ -87,16 +87,16 @@ error[E0277]: `*const UnsafeCell<()>` cannot be sent between threads safely | | | required by a bound introduced by this call | - = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>`, which is required by `dyn NSObjectProtocol + Send: ImplementedBy` + = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>` = help: the following other types implement trait `ImplementedBy`: - (dyn NSCoding + 'static) - (dyn NSCopying + 'static) - (dyn NSDiscardableContent + 'static) - (dyn NSFastEnumeration + 'static) - (dyn NSMutableCopying + 'static) - (dyn NSObjectProtocol + 'static) - (dyn NSObjectProtocol + Send + 'static) - (dyn NSObjectProtocol + Send + Sync + 'static) + dyn NSCoding + dyn NSCopying + dyn NSDiscardableContent + dyn NSFastEnumeration + dyn NSMutableCopying + dyn NSObjectProtocol + Send + Sync + dyn NSObjectProtocol + Send + dyn NSObjectProtocol + Sync and $N others = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)` note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>` @@ -137,16 +137,16 @@ error[E0277]: `UnsafeCell, PhantomPinned)>>` | | | required by a bound introduced by this call | - = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>`, which is required by `dyn NSObjectProtocol + Sync: ImplementedBy` + = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>` = help: the following other types implement trait `ImplementedBy`: - (dyn NSCoding + 'static) - (dyn NSCopying + 'static) - (dyn NSDiscardableContent + 'static) - (dyn NSFastEnumeration + 'static) - (dyn NSMutableCopying + 'static) - (dyn NSObjectProtocol + 'static) - (dyn NSObjectProtocol + Send + 'static) - (dyn NSObjectProtocol + Send + Sync + 'static) + dyn NSCoding + dyn NSCopying + dyn NSDiscardableContent + dyn NSFastEnumeration + dyn NSMutableCopying + dyn NSObjectProtocol + Send + Sync + dyn NSObjectProtocol + Send + dyn NSObjectProtocol + Sync and $N others note: required because it appears within the type `AnyObject` --> $WORKSPACE/crates/objc2/src/runtime/mod.rs @@ -176,16 +176,16 @@ error[E0277]: `UnsafeCell, PhantomPinned)>>` | | | required by a bound introduced by this call | - = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>`, which is required by `dyn NSObjectProtocol + Send + Sync: ImplementedBy` + = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell, PhantomPinned)>>` = help: the following other types implement trait `ImplementedBy`: - (dyn NSCoding + 'static) - (dyn NSCopying + 'static) - (dyn NSDiscardableContent + 'static) - (dyn NSFastEnumeration + 'static) - (dyn NSMutableCopying + 'static) - (dyn NSObjectProtocol + 'static) - (dyn NSObjectProtocol + Send + 'static) - (dyn NSObjectProtocol + Send + Sync + 'static) + dyn NSCoding + dyn NSCopying + dyn NSDiscardableContent + dyn NSFastEnumeration + dyn NSMutableCopying + dyn NSObjectProtocol + Send + Sync + dyn NSObjectProtocol + Send + dyn NSObjectProtocol + Sync and $N others note: required because it appears within the type `AnyObject` --> $WORKSPACE/crates/objc2/src/runtime/mod.rs @@ -215,16 +215,16 @@ error[E0277]: `*const UnsafeCell<()>` cannot be sent between threads safely | | | required by a bound introduced by this call | - = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>`, which is required by `dyn NSObjectProtocol + Send + Sync: ImplementedBy` + = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>` = help: the following other types implement trait `ImplementedBy`: - (dyn NSCoding + 'static) - (dyn NSCopying + 'static) - (dyn NSDiscardableContent + 'static) - (dyn NSFastEnumeration + 'static) - (dyn NSMutableCopying + 'static) - (dyn NSObjectProtocol + 'static) - (dyn NSObjectProtocol + Send + 'static) - (dyn NSObjectProtocol + Send + Sync + 'static) + dyn NSCoding + dyn NSCopying + dyn NSDiscardableContent + dyn NSFastEnumeration + dyn NSMutableCopying + dyn NSObjectProtocol + Send + Sync + dyn NSObjectProtocol + Send + dyn NSObjectProtocol + Sync and $N others = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)` note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>` @@ -261,7 +261,7 @@ error[E0277]: the trait bound `NSObject: NSCopying` is not satisfied --> ui/protocol_object_only_protocols.rs | | let _: &ProtocolObject = ProtocolObject::from_ref(&*obj); - | ------------------------ ^^^^^ the trait `NSCopying` is not implemented for `NSObject`, which is required by `dyn NSCopying: ImplementedBy` + | ------------------------ ^^^^^ the trait `NSCopying` is not implemented for `NSObject` | | | required by a bound introduced by this call | @@ -294,14 +294,14 @@ error[E0277]: the trait bound `dyn NSCopying + Send: ImplementedBy` is | required by a bound introduced by this call | = help: the following other types implement trait `ImplementedBy`: - (dyn NSCoding + 'static) - (dyn NSCopying + 'static) - (dyn NSDiscardableContent + 'static) - (dyn NSFastEnumeration + 'static) - (dyn NSMutableCopying + 'static) - (dyn NSObjectProtocol + 'static) - (dyn NSObjectProtocol + Send + 'static) - (dyn NSObjectProtocol + Send + Sync + 'static) + dyn NSCoding + dyn NSCopying + dyn NSDiscardableContent + dyn NSFastEnumeration + dyn NSMutableCopying + dyn NSObjectProtocol + Send + Sync + dyn NSObjectProtocol + Send + dyn NSObjectProtocol + Sync and $N others note: required by a bound in `ProtocolObject::

::from_ref` --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs diff --git a/crates/test-ui/ui/stack_block_requires_clone.stderr b/crates/test-ui/ui/stack_block_requires_clone.stderr index 346f4c107..a523e44a6 100644 --- a/crates/test-ui/ui/stack_block_requires_clone.stderr +++ b/crates/test-ui/ui/stack_block_requires_clone.stderr @@ -9,8 +9,9 @@ error[E0277]: the trait bound `Foo: Clone` is not satisfied in `{closure@$DIR/ui | | required by a bound introduced by this call | | let _ = &foo; | | }); - | |_____^ within `{closure@$DIR/ui/stack_block_requires_clone.rs:7:29: 7:36}`, the trait `Clone` is not implemented for `Foo`, which is required by `{closure@$DIR/ui/stack_block_requires_clone.rs:7:29: 7:36}: Clone` + | |_____^ unsatisfied trait bound | + = help: within `{closure@$DIR/ui/stack_block_requires_clone.rs:7:29: 7:36}`, the trait `Clone` is not implemented for `Foo` note: required because it's used within this closure --> ui/stack_block_requires_clone.rs | diff --git a/crates/test-ui/ui/stack_block_with_encoding_requires_clone.stderr b/crates/test-ui/ui/stack_block_with_encoding_requires_clone.stderr index e190cf94c..53da05eb1 100644 --- a/crates/test-ui/ui/stack_block_with_encoding_requires_clone.stderr +++ b/crates/test-ui/ui/stack_block_with_encoding_requires_clone.stderr @@ -9,8 +9,9 @@ error[E0277]: the trait bound `Foo: Clone` is not satisfied in `{closure@$DIR/ui | | required by a bound introduced by this call | | let _ = &foo; | | }); - | |_____^ within `{closure@$DIR/ui/stack_block_with_encoding_requires_clone.rs:15:59: 15:66}`, the trait `Clone` is not implemented for `Foo`, which is required by `{closure@$DIR/ui/stack_block_with_encoding_requires_clone.rs:15:59: 15:66}: Clone` + | |_____^ unsatisfied trait bound | + = help: within `{closure@$DIR/ui/stack_block_with_encoding_requires_clone.rs:15:59: 15:66}`, the trait `Clone` is not implemented for `Foo` note: required because it's used within this closure --> ui/stack_block_with_encoding_requires_clone.rs | diff --git a/crates/test-ui/ui/thread_kind_traits_unimplementable2.stderr b/crates/test-ui/ui/thread_kind_traits_unimplementable2.stderr index 4ccc9b792..a9721a50d 100644 --- a/crates/test-ui/ui/thread_kind_traits_unimplementable2.stderr +++ b/crates/test-ui/ui/thread_kind_traits_unimplementable2.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `CustomStruct: objc2::top_level_traits::private::S --> ui/thread_kind_traits_unimplementable2.rs | | unsafe impl AllocAnyThread for CustomStruct {} - | ^^^^^^^^^^^^ the trait `ClassType` is not implemented for `CustomStruct`, which is required by `CustomStruct: objc2::top_level_traits::private::SealedAllocAnyThread` + | ^^^^^^^^^^^^ the trait `ClassType` is not implemented for `CustomStruct` | = help: the following other types implement trait `ClassType`: NSObject @@ -22,7 +22,7 @@ error[E0277]: the trait bound `CustomStruct: objc2::top_level_traits::private::S --> ui/thread_kind_traits_unimplementable2.rs | | unsafe impl MainThreadOnly for CustomStruct {} - | ^^^^^^^^^^^^ the trait `ClassType` is not implemented for `CustomStruct`, which is required by `CustomStruct: objc2::top_level_traits::private::SealedMainThreadOnly` + | ^^^^^^^^^^^^ the trait `ClassType` is not implemented for `CustomStruct` | = help: the following other types implement trait `ClassType`: NSObject diff --git a/crates/tests/src/test_foundation_retain_semantics.rs b/crates/tests/src/test_foundation_retain_semantics.rs index 78b5346f8..7f4072beb 100644 --- a/crates/tests/src/test_foundation_retain_semantics.rs +++ b/crates/tests/src/test_foundation_retain_semantics.rs @@ -382,7 +382,7 @@ fn dictionary_insert_key_copies() { let key1 = NSCopyingRcTestObject::new(); let mut expected = ThreadTestData::current(); - let _ = dict.insert(&*key1, &*NSNumber::new_i32(1)); + dict.insert(&*key1, &*NSNumber::new_i32(1)); // Create copy expected.copy += 1; expected.alloc += 1; @@ -400,7 +400,7 @@ fn dictionary_insert_key_copies() { fn dictionary_get_key_copies() { let dict = NSMutableDictionary::new(); let key1 = NSCopyingRcTestObject::new(); - let _ = dict.insert(&*key1, &*NSNumber::new_i32(1)); + dict.insert(&*key1, &*NSNumber::new_i32(1)); let expected = ThreadTestData::current(); let _ = dict.objectForKey(&key1); diff --git a/crates/tests/src/test_object.rs b/crates/tests/src/test_object.rs index fc671db5e..6039c37ec 100644 --- a/crates/tests/src/test_object.rs +++ b/crates/tests/src/test_object.rs @@ -96,7 +96,7 @@ unsafe impl MyTestProtocol for MyTestObject {} #[cfg(all(target_vendor = "apple", target_arch = "aarch64"))] #[used] -static FIX_LINKING: &'static AnyClass = { +static FIX_LINKING: &AnyClass = { extern "C" { #[link_name = "OBJC_CLASS_$_MyTestObject"] static CLASS: AnyClass; @@ -134,12 +134,12 @@ impl MyTestObject { fn var1_ivar(&self) -> &c_int { let ivar = Self::class().instance_variable(&c("var1")).unwrap(); - unsafe { ivar.load(&self) } + unsafe { ivar.load(self) } } fn var1_ivar_ptr(&self) -> *mut c_int { let ivar = Self::class().instance_variable(&c("var1")).unwrap(); - unsafe { ivar.load_ptr(&self) } + unsafe { ivar.load_ptr(self) } } fn add_to_ivar1(&self, number: c_int) { @@ -152,12 +152,12 @@ impl MyTestObject { fn var2_ivar(&self) -> &Bool { let ivar = Self::class().instance_variable(&c("var2")).unwrap(); - unsafe { ivar.load(&self) } + unsafe { ivar.load(self) } } fn var2_ivar_ptr(&self) -> *mut Bool { let ivar = Self::class().instance_variable(&c("var2")).unwrap(); - unsafe { ivar.load_ptr(&self) } + unsafe { ivar.load_ptr(self) } } fn var3(&self) -> *mut AnyObject { @@ -170,12 +170,12 @@ impl MyTestObject { fn var3_ivar(&self) -> &*mut AnyObject { let ivar = Self::class().instance_variable(&c("var3")).unwrap(); - unsafe { ivar.load(&self) } + unsafe { ivar.load(self) } } fn var3_ivar_ptr(&self) -> *mut *mut AnyObject { let ivar = Self::class().instance_variable(&c("var3")).unwrap(); - unsafe { ivar.load_ptr(&self) } + unsafe { ivar.load_ptr(self) } } } @@ -336,27 +336,27 @@ fn test_protocol() { #[cfg(feature = "all")] fn downcast_basics() { let obj = NSString::new(); - assert!(matches!(obj.downcast_ref::(), Some(_))); + assert!(obj.downcast_ref::().is_some()); let obj = obj.into_super(); - assert!(matches!(obj.downcast_ref::(), None)); - assert!(matches!(obj.downcast_ref::(), Some(_))); + assert!(obj.downcast_ref::().is_none()); + assert!(obj.downcast_ref::().is_some()); let obj = NSMutableString::new(); - assert!(matches!(obj.downcast_ref::(), Some(_))); - assert!(matches!(obj.downcast_ref::(), Some(_))); - assert!(matches!(obj.downcast_ref::(), Some(_))); - assert!(matches!(obj.downcast_ref::(), None)); + assert!(obj.downcast_ref::().is_some()); + assert!(obj.downcast_ref::().is_some()); + assert!(obj.downcast_ref::().is_some()); + assert!(obj.downcast_ref::().is_none()); let obj = obj.into_super().into_super(); - assert!(matches!(obj.downcast_ref::(), Some(_))); - assert!(matches!(obj.downcast_ref::(), Some(_))); - assert!(matches!(obj.downcast_ref::(), Some(_))); - assert!(matches!(obj.downcast_ref::(), None)); + assert!(obj.downcast_ref::().is_some()); + assert!(obj.downcast_ref::().is_some()); + assert!(obj.downcast_ref::().is_some()); + assert!(obj.downcast_ref::().is_none()); let obj: Retained> = NSArray::new(); - assert!(matches!(obj.downcast_ref::(), None)); - assert!(matches!(obj.downcast_ref::>(), Some(_))); + assert!(obj.downcast_ref::().is_none()); + assert!(obj.downcast_ref::>().is_some()); } #[test] @@ -364,7 +364,7 @@ fn downcast_basics() { fn test_downcast_class() { // Ensure that downcasting `AnyClass` doesn't cause unsoundness. let cls = NSString::class(); - let obj = unsafe { &*(cls as *const AnyClass as *const AnyObject) }; + let obj = unsafe { &*(cls as *const AnyClass).cast::() }; // AnyClass is an NSObject internally. assert!(obj.downcast_ref::().is_some()); diff --git a/framework-crates/objc2-foundation/src/iter.rs b/framework-crates/objc2-foundation/src/iter.rs index 9cdea1ca7..fa6354003 100644 --- a/framework-crates/objc2-foundation/src/iter.rs +++ b/framework-crates/objc2-foundation/src/iter.rs @@ -364,7 +364,7 @@ impl<'a, C: ?Sized + FastEnumerationHelper> Iter<'a, C> { } } -impl<'a, C: FastEnumerationHelper> Iterator for Iter<'a, C> { +impl Iterator for Iter<'_, C> { type Item = Retained; #[inline] @@ -543,7 +543,7 @@ where } } -impl<'a, C, E> Iterator for IterWithBackingEnum<'a, C, E> +impl Iterator for IterWithBackingEnum<'_, C, E> where C: ?Sized + FastEnumerationHelper, E: FastEnumerationHelper, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 170d5191b..214a0dd15 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] # Remember to update this in ci.yml as well. -channel = "nightly-2024-09-05" +channel = "nightly-2024-11-14" profile = "minimal" components = ["rustfmt", "clippy", "rust-src"]