Skip to content

Commit d6f7096

Browse files
committed
Remove unnecessary bounds on object implementations
These are probably not necessary, since we control how the objects are created. Though it does prevent users from accidentally returning e.g. `&NSValue<&u8>` (when they intended `&NSValue<u8>`) in a message send, it might also be overly restrictive.
1 parent d66a381 commit d6f7096

File tree

5 files changed

+1
-7
lines changed

5 files changed

+1
-7
lines changed

objc2-foundation/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1616
### Changed
1717
* **BREAKING**: Made some creation methods a bit less generic (e.g.
1818
`INSDictionary::from_keys_and_objects` now always returns `Id<_, Shared>`).
19+
* Relax bounds on generic `INSObject` impls.
1920

2021
### Removed
2122
* **BREAKING**: Removed associated `Ownership` type from `INSObject`; instead,

objc2-foundation/src/array.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ object!(
172172
unsafe pub struct NSArray<T, O: Ownership> {
173173
item: PhantomData<Id<T, O>>,
174174
}
175-
impl where T: INSObject
176175
);
177176

178177
unsafe impl<T: INSObject, O: Ownership> INSArray for NSArray<T, O> {
@@ -318,7 +317,6 @@ object!(
318317
unsafe pub struct NSMutableArray<T, O: Ownership> {
319318
item: PhantomData<Id<T, O>>,
320319
}
321-
impl where T: INSObject
322320
);
323321

324322
unsafe impl<T: INSObject, O: Ownership> INSArray for NSMutableArray<T, O> {

objc2-foundation/src/dictionary.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ object!(
143143
key: PhantomData<Id<K, Shared>>,
144144
obj: PhantomData<Id<V, Owned>>,
145145
}
146-
impl where
147-
K: INSObject,
148-
V: INSObject,
149146
);
150147

151148
impl<K: INSObject, V: INSObject> NSDictionary<K, V> {

objc2-foundation/src/macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ macro_rules! object {
1818
unsafe $v:vis struct $name:ident<$($t:ident $(: $b:ident)?),*> {
1919
$($p:ident: $pty:ty,)*
2020
}
21-
$(impl where $($w:tt)+)?
2221
) => {
2322
// TODO: `extern type`
2423
$(#[$m])*

objc2-foundation/src/value.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ object!(
7373
unsafe pub struct NSValue<T> {
7474
value: PhantomData<T>,
7575
}
76-
impl where T: 'static
7776
);
7877

7978
unsafe impl<T: 'static + Copy + Encode> INSValue for NSValue<T> {

0 commit comments

Comments
 (0)