@@ -8,13 +8,13 @@ error[E0277]: the trait bound `NSObject: ImplementedBy<NSObject>` is not satisfi
88 |
99 = help: the following other types implement trait `ImplementedBy<T>`:
1010 (dyn NSObjectProtocol + 'static)
11+ (dyn NSObjectProtocol + Send + 'static)
12+ (dyn NSObjectProtocol + Send + Sync + 'static)
13+ (dyn NSObjectProtocol + Sync + 'static)
1114 (dyn NSAccessibilityColor + 'static)
1215 (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
1316 (dyn NSAccessibilityElementProtocol + 'static)
1417 (dyn NSAccessibilityGroup + 'static)
15- (dyn NSAccessibilityButton + 'static)
16- (dyn NSAccessibilitySwitch + 'static)
17- (dyn NSAccessibilityRadioButton + 'static)
1818 and $N others
1919note: required by a bound in `ProtocolObject::<P>::from_ref`
2020 --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
@@ -35,13 +35,13 @@ error[E0277]: the trait bound `dyn Send: ImplementedBy<NSObject>` is not satisfi
3535 |
3636 = help: the following other types implement trait `ImplementedBy<T>`:
3737 (dyn NSObjectProtocol + 'static)
38+ (dyn NSObjectProtocol + Send + 'static)
39+ (dyn NSObjectProtocol + Send + Sync + 'static)
40+ (dyn NSObjectProtocol + Sync + 'static)
3841 (dyn NSAccessibilityColor + 'static)
3942 (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
4043 (dyn NSAccessibilityElementProtocol + 'static)
4144 (dyn NSAccessibilityGroup + 'static)
42- (dyn NSAccessibilityButton + 'static)
43- (dyn NSAccessibilitySwitch + 'static)
44- (dyn NSAccessibilityRadioButton + 'static)
4545 and $N others
4646note: required by a bound in `ProtocolObject::<P>::from_ref`
4747 --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
@@ -62,13 +62,13 @@ error[E0277]: the trait bound `dyn Foo: ImplementedBy<NSObject>` is not satisfie
6262 |
6363 = help: the following other types implement trait `ImplementedBy<T>`:
6464 (dyn NSObjectProtocol + 'static)
65+ (dyn NSObjectProtocol + Send + 'static)
66+ (dyn NSObjectProtocol + Send + Sync + 'static)
67+ (dyn NSObjectProtocol + Sync + 'static)
6568 (dyn NSAccessibilityColor + 'static)
6669 (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
6770 (dyn NSAccessibilityElementProtocol + 'static)
6871 (dyn NSAccessibilityGroup + 'static)
69- (dyn NSAccessibilityButton + 'static)
70- (dyn NSAccessibilitySwitch + 'static)
71- (dyn NSAccessibilityRadioButton + 'static)
7272 and $N others
7373note: required by a bound in `ProtocolObject::<P>::from_ref`
7474 --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
@@ -79,24 +79,52 @@ note: required by a bound in `ProtocolObject::<P>::from_ref`
7979 | P: ImplementedBy<T>,
8080 | ^^^^^^^^^^^^^^^^ required by this bound in `ProtocolObject::<P>::from_ref`
8181
82- error[E0277]: the trait bound `dyn NSObjectProtocol + Send: ImplementedBy<NSObject >` is not satisfied
82+ error[E0277]: `*const UnsafeCell<() >` cannot be sent between threads safely
8383 --> ui/protocol_object_only_protocols.rs
8484 |
8585 | let _: &ProtocolObject<dyn NSObjectProtocol + Send> = ProtocolObject::from_ref(&*obj);
86- | ------------------------ ^^^^^ the trait `ImplementedBy<NSObject >` is not implemented for `dyn NSObjectProtocol + Send`
86+ | ------------------------ ^^^^^ `*const UnsafeCell<() >` cannot be sent between threads safely
8787 | |
8888 | required by a bound introduced by this call
8989 |
90+ = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>`
9091 = help: the following other types implement trait `ImplementedBy<T>`:
9192 (dyn NSObjectProtocol + 'static)
93+ (dyn NSObjectProtocol + Send + 'static)
94+ (dyn NSObjectProtocol + Send + Sync + 'static)
95+ (dyn NSObjectProtocol + Sync + 'static)
9296 (dyn NSAccessibilityColor + 'static)
9397 (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
9498 (dyn NSAccessibilityElementProtocol + 'static)
9599 (dyn NSAccessibilityGroup + 'static)
96- (dyn NSAccessibilityButton + 'static)
97- (dyn NSAccessibilitySwitch + 'static)
98- (dyn NSAccessibilityRadioButton + 'static)
99100 and $N others
101+ = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)`
102+ note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>`
103+ --> $RUST/core/src/marker.rs
104+ |
105+ | pub struct PhantomData<T: ?Sized>;
106+ | ^^^^^^^^^^^
107+ note: required because it appears within the type `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>`
108+ --> $RUST/core/src/cell.rs
109+ |
110+ | pub struct UnsafeCell<T: ?Sized> {
111+ | ^^^^^^^^^^
112+ note: required because it appears within the type `objc_object`
113+ --> $WORKSPACE/crates/objc-sys/src/object.rs
114+ |
115+ | pub struct objc_object {
116+ | ^^^^^^^^^^^
117+ note: required because it appears within the type `AnyObject`
118+ --> $WORKSPACE/crates/objc2/src/runtime/mod.rs
119+ |
120+ | pub struct AnyObject(ffi::objc_object);
121+ | ^^^^^^^^^
122+ note: required because it appears within the type `NSObject`
123+ --> $WORKSPACE/crates/objc2/src/runtime/nsobject.rs
124+ |
125+ | pub struct NSObject {
126+ | ^^^^^^^^
127+ = note: required for `dyn NSObjectProtocol + Send` to implement `ImplementedBy<NSObject>`
100128note: required by a bound in `ProtocolObject::<P>::from_ref`
101129 --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
102130 |
@@ -106,24 +134,85 @@ note: required by a bound in `ProtocolObject::<P>::from_ref`
106134 | P: ImplementedBy<T>,
107135 | ^^^^^^^^^^^^^^^^ required by this bound in `ProtocolObject::<P>::from_ref`
108136
109- error[E0277]: the trait bound `dyn NSObjectProtocol + Sync: ImplementedBy<NSObject>` is not satisfied
137+ error[E0277]: `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>` cannot be shared between threads safely
110138 --> ui/protocol_object_only_protocols.rs
111139 |
112140 | let _: &ProtocolObject<dyn NSObjectProtocol + Sync> = ProtocolObject::from_ref(&*obj);
113- | ------------------------ ^^^^^ the trait `ImplementedBy<NSObject>` is not implemented for `dyn NSObjectProtocol + Sync`
141+ | ------------------------ ^^^^^ `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>` cannot be shared between threads safely
114142 | |
115143 | required by a bound introduced by this call
116144 |
145+ = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>`
146+ = help: the following other types implement trait `ImplementedBy<T>`:
147+ (dyn NSObjectProtocol + 'static)
148+ (dyn NSObjectProtocol + Send + 'static)
149+ (dyn NSObjectProtocol + Send + Sync + 'static)
150+ (dyn NSObjectProtocol + Sync + 'static)
151+ (dyn NSAccessibilityColor + 'static)
152+ (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
153+ (dyn NSAccessibilityElementProtocol + 'static)
154+ (dyn NSAccessibilityGroup + 'static)
155+ and $N others
156+ note: required because it appears within the type `objc_object`
157+ --> $WORKSPACE/crates/objc-sys/src/object.rs
158+ |
159+ | pub struct objc_object {
160+ | ^^^^^^^^^^^
161+ note: required because it appears within the type `AnyObject`
162+ --> $WORKSPACE/crates/objc2/src/runtime/mod.rs
163+ |
164+ | pub struct AnyObject(ffi::objc_object);
165+ | ^^^^^^^^^
166+ note: required because it appears within the type `NSObject`
167+ --> $WORKSPACE/crates/objc2/src/runtime/nsobject.rs
168+ |
169+ | pub struct NSObject {
170+ | ^^^^^^^^
171+ = note: required for `dyn NSObjectProtocol + Sync` to implement `ImplementedBy<NSObject>`
172+ note: required by a bound in `ProtocolObject::<P>::from_ref`
173+ --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
174+ |
175+ | pub fn from_ref<T: ?Sized + Message>(obj: &T) -> &Self
176+ | -------- required by a bound in this associated function
177+ | where
178+ | P: ImplementedBy<T>,
179+ | ^^^^^^^^^^^^^^^^ required by this bound in `ProtocolObject::<P>::from_ref`
180+
181+ error[E0277]: `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>` cannot be shared between threads safely
182+ --> ui/protocol_object_only_protocols.rs
183+ |
184+ | let _: &ProtocolObject<dyn NSObjectProtocol + Send + Sync> = ProtocolObject::from_ref(&*obj);
185+ | ------------------------ ^^^^^ `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>` cannot be shared between threads safely
186+ | |
187+ | required by a bound introduced by this call
188+ |
189+ = help: within `NSObject`, the trait `Sync` is not implemented for `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>`
117190 = help: the following other types implement trait `ImplementedBy<T>`:
118191 (dyn NSObjectProtocol + 'static)
192+ (dyn NSObjectProtocol + Send + 'static)
193+ (dyn NSObjectProtocol + Send + Sync + 'static)
194+ (dyn NSObjectProtocol + Sync + 'static)
119195 (dyn NSAccessibilityColor + 'static)
120196 (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
121197 (dyn NSAccessibilityElementProtocol + 'static)
122198 (dyn NSAccessibilityGroup + 'static)
123- (dyn NSAccessibilityButton + 'static)
124- (dyn NSAccessibilitySwitch + 'static)
125- (dyn NSAccessibilityRadioButton + 'static)
126199 and $N others
200+ note: required because it appears within the type `objc_object`
201+ --> $WORKSPACE/crates/objc-sys/src/object.rs
202+ |
203+ | pub struct objc_object {
204+ | ^^^^^^^^^^^
205+ note: required because it appears within the type `AnyObject`
206+ --> $WORKSPACE/crates/objc2/src/runtime/mod.rs
207+ |
208+ | pub struct AnyObject(ffi::objc_object);
209+ | ^^^^^^^^^
210+ note: required because it appears within the type `NSObject`
211+ --> $WORKSPACE/crates/objc2/src/runtime/nsobject.rs
212+ |
213+ | pub struct NSObject {
214+ | ^^^^^^^^
215+ = note: required for `dyn NSObjectProtocol + Send + Sync` to implement `ImplementedBy<NSObject>`
127216note: required by a bound in `ProtocolObject::<P>::from_ref`
128217 --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
129218 |
@@ -133,24 +222,52 @@ note: required by a bound in `ProtocolObject::<P>::from_ref`
133222 | P: ImplementedBy<T>,
134223 | ^^^^^^^^^^^^^^^^ required by this bound in `ProtocolObject::<P>::from_ref`
135224
136- error[E0277]: the trait bound `dyn NSObjectProtocol + Send + Sync: ImplementedBy<NSObject >` is not satisfied
225+ error[E0277]: `*const UnsafeCell<() >` cannot be sent between threads safely
137226 --> ui/protocol_object_only_protocols.rs
138227 |
139228 | let _: &ProtocolObject<dyn NSObjectProtocol + Send + Sync> = ProtocolObject::from_ref(&*obj);
140- | ------------------------ ^^^^^ the trait `ImplementedBy<NSObject >` is not implemented for `dyn NSObjectProtocol + Send + Sync`
229+ | ------------------------ ^^^^^ `*const UnsafeCell<() >` cannot be sent between threads safely
141230 | |
142231 | required by a bound introduced by this call
143232 |
233+ = help: within `NSObject`, the trait `Send` is not implemented for `*const UnsafeCell<()>`
144234 = help: the following other types implement trait `ImplementedBy<T>`:
145235 (dyn NSObjectProtocol + 'static)
236+ (dyn NSObjectProtocol + Send + 'static)
237+ (dyn NSObjectProtocol + Send + Sync + 'static)
238+ (dyn NSObjectProtocol + Sync + 'static)
146239 (dyn NSAccessibilityColor + 'static)
147240 (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
148241 (dyn NSAccessibilityElementProtocol + 'static)
149242 (dyn NSAccessibilityGroup + 'static)
150- (dyn NSAccessibilityButton + 'static)
151- (dyn NSAccessibilitySwitch + 'static)
152- (dyn NSAccessibilityRadioButton + 'static)
153243 and $N others
244+ = note: required because it appears within the type `(*const UnsafeCell<()>, PhantomPinned)`
245+ note: required because it appears within the type `PhantomData<(*const UnsafeCell<()>, PhantomPinned)>`
246+ --> $RUST/core/src/marker.rs
247+ |
248+ | pub struct PhantomData<T: ?Sized>;
249+ | ^^^^^^^^^^^
250+ note: required because it appears within the type `UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>`
251+ --> $RUST/core/src/cell.rs
252+ |
253+ | pub struct UnsafeCell<T: ?Sized> {
254+ | ^^^^^^^^^^
255+ note: required because it appears within the type `objc_object`
256+ --> $WORKSPACE/crates/objc-sys/src/object.rs
257+ |
258+ | pub struct objc_object {
259+ | ^^^^^^^^^^^
260+ note: required because it appears within the type `AnyObject`
261+ --> $WORKSPACE/crates/objc2/src/runtime/mod.rs
262+ |
263+ | pub struct AnyObject(ffi::objc_object);
264+ | ^^^^^^^^^
265+ note: required because it appears within the type `NSObject`
266+ --> $WORKSPACE/crates/objc2/src/runtime/nsobject.rs
267+ |
268+ | pub struct NSObject {
269+ | ^^^^^^^^
270+ = note: required for `dyn NSObjectProtocol + Send + Sync` to implement `ImplementedBy<NSObject>`
154271note: required by a bound in `ProtocolObject::<P>::from_ref`
155272 --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
156273 |
@@ -198,13 +315,13 @@ error[E0277]: the trait bound `dyn NSCopying + Send: ImplementedBy<NSObject>` is
198315 |
199316 = help: the following other types implement trait `ImplementedBy<T>`:
200317 (dyn NSObjectProtocol + 'static)
318+ (dyn NSObjectProtocol + Send + 'static)
319+ (dyn NSObjectProtocol + Send + Sync + 'static)
320+ (dyn NSObjectProtocol + Sync + 'static)
201321 (dyn NSAccessibilityColor + 'static)
202322 (dyn NSAccessibilityCustomRotorItemSearchDelegate + 'static)
203323 (dyn NSAccessibilityElementProtocol + 'static)
204324 (dyn NSAccessibilityGroup + 'static)
205- (dyn NSAccessibilityButton + 'static)
206- (dyn NSAccessibilitySwitch + 'static)
207- (dyn NSAccessibilityRadioButton + 'static)
208325 and $N others
209326note: required by a bound in `ProtocolObject::<P>::from_ref`
210327 --> $WORKSPACE/crates/objc2/src/runtime/protocol_object.rs
0 commit comments