@@ -9,10 +9,11 @@ pub trait Copyhelper<T: ?Sized> {
9
9
type CopyOutput : ?Sized + Message ;
10
10
type MutableCopyOutput : ?Sized + Message ;
11
11
12
+ // TODO: Use this to autogenerate `ToOwned` impls
12
13
#[ doc( hidden) ]
13
14
fn __do_copy ( t : & T ) -> Id < T > ;
14
15
}
15
- impl < T : ClassType + NSCopying + Message < Kind = Unknown > > Copyhelper < T > for Unknown {
16
+ impl < T : NSCopying + Message < Kind = Unknown > > Copyhelper < T > for Unknown {
16
17
type CopyOutput = T ;
17
18
type MutableCopyOutput = T ;
18
19
@@ -21,7 +22,7 @@ impl<T: ClassType + NSCopying + Message<Kind = Unknown>> Copyhelper<T> for Unkno
21
22
t. copy ( )
22
23
}
23
24
}
24
- impl < T : ClassType + NSCopying + Message < Kind = Immutable > > Copyhelper < T > for Immutable {
25
+ impl < T : NSCopying + Message < Kind = Immutable > > Copyhelper < T > for Immutable {
25
26
type CopyOutput = T ;
26
27
type MutableCopyOutput = T ;
27
28
@@ -30,7 +31,7 @@ impl<T: ClassType + NSCopying + Message<Kind = Immutable>> Copyhelper<T> for Imm
30
31
t. copy ( )
31
32
}
32
33
}
33
- impl < T : ClassType + NSCopying + Message < Kind = Mutable > > Copyhelper < T > for Mutable {
34
+ impl < T : NSCopying + Message < Kind = Mutable > > Copyhelper < T > for Mutable {
34
35
type CopyOutput = T ;
35
36
type MutableCopyOutput = T ;
36
37
@@ -41,8 +42,8 @@ impl<T: ClassType + NSCopying + Message<Kind = Mutable>> Copyhelper<T> for Mutab
41
42
}
42
43
impl < T , S > Copyhelper < T > for ImmutableWithMutableSubclass < S >
43
44
where
44
- T : ClassType + NSCopying + Message < Kind = ImmutableWithMutableSubclass < S > > ,
45
- S : ClassType + Message < Kind = MutableWithImmutableSuperclass < T > > ,
45
+ T : NSCopying + Message < Kind = ImmutableWithMutableSubclass < S > > ,
46
+ S : Message < Kind = MutableWithImmutableSuperclass < T > > ,
46
47
{
47
48
type CopyOutput = T ;
48
49
type MutableCopyOutput = S ;
54
55
}
55
56
impl < T , S > Copyhelper < T > for MutableWithImmutableSuperclass < S >
56
57
where
57
- T : ClassType + NSMutableCopying + Message < Kind = MutableWithImmutableSuperclass < S > > ,
58
- S : ClassType + Message < Kind = ImmutableWithMutableSubclass < T > > ,
58
+ T : NSMutableCopying + Message < Kind = MutableWithImmutableSuperclass < S > > ,
59
+ S : Message < Kind = ImmutableWithMutableSubclass < T > > ,
59
60
{
60
61
type CopyOutput = S ;
61
62
type MutableCopyOutput = T ;
65
66
t. mutableCopy ( )
66
67
}
67
68
}
68
- impl < T : ClassType + NSCopying + Message < Kind = InteriorMutable > > Copyhelper < T > for InteriorMutable {
69
+ impl < T : NSCopying + Message < Kind = InteriorMutable > > Copyhelper < T > for InteriorMutable {
69
70
type CopyOutput = T ;
70
71
type MutableCopyOutput = T ;
71
72
@@ -74,7 +75,7 @@ impl<T: ClassType + NSCopying + Message<Kind = InteriorMutable>> Copyhelper<T> f
74
75
t. copy ( )
75
76
}
76
77
}
77
- impl < T : ClassType + NSCopying + Message < Kind = MainThreadOnly > > Copyhelper < T > for MainThreadOnly {
78
+ impl < T : NSCopying + Message < Kind = MainThreadOnly > > Copyhelper < T > for MainThreadOnly {
78
79
type CopyOutput = T ;
79
80
type MutableCopyOutput = T ;
80
81
@@ -100,7 +101,7 @@ pub unsafe trait NSCopying {
100
101
/// `NSString`.
101
102
fn copy ( & self ) -> Id < <Self :: Kind as Copyhelper < Self > >:: CopyOutput >
102
103
where
103
- Self : Sized + ClassType ,
104
+ Self : Sized + Message ,
104
105
Self :: Kind : Copyhelper < Self > ,
105
106
{
106
107
unsafe { msg_send_id ! [ self , copy] }
@@ -132,9 +133,10 @@ crate::__inner_extern_protocol!(
132
133
/// - The `mutableCopy` selector must return an owned object.
133
134
/// - TODO: More.
134
135
pub unsafe trait NSMutableCopying {
136
+ #[ allow( non_snake_case) ]
135
137
fn mutableCopy ( & self ) -> Id < <Self :: Kind as Copyhelper < Self > >:: MutableCopyOutput >
136
138
where
137
- Self : Sized + ClassType ,
139
+ Self : Sized + Message ,
138
140
Self :: Kind : Copyhelper < Self > ,
139
141
{
140
142
unsafe { msg_send_id ! [ self , mutableCopy] }
0 commit comments