Skip to content

Commit 65b656a

Browse files
committed
Fix old syntax for cf_type! macro
1 parent 0b41c3f commit 65b656a

File tree

1 file changed

+13
-1
lines changed
  • framework-crates/objc2-core-foundation/src

1 file changed

+13
-1
lines changed

framework-crates/objc2-core-foundation/src/cf_type.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ macro_rules! __cf_type_objc2 {
190190
(impl ($($generics:tt)*) $ty:ty;) => {};
191191
(impl ($($generics:tt)*) $ty:ty; $encoding:literal) => {
192192
$crate::__cf_macro_helpers::cf_objc2_type!(
193-
unsafe impl $($generics)* for RefEncode<$encoding> $ty {}
193+
unsafe impl $($generics)* RefEncode<$encoding> for $ty {}
194194
);
195195
};
196196
}
@@ -201,3 +201,15 @@ macro_rules! __cf_type_objc2 {
201201
macro_rules! __cf_type_objc2 {
202202
($($t:tt)*) => {};
203203
}
204+
205+
#[cfg(test)]
206+
mod tests {
207+
#[allow(dead_code)]
208+
struct TISInputSource {}
209+
210+
// Test old syntax still works (used by dependencies).
211+
cf_type!(
212+
#[encoding_name = "__TISInputSource"]
213+
unsafe impl TISInputSource {}
214+
);
215+
}

0 commit comments

Comments
 (0)