-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
136 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
use objc2::{extern_class, extern_methods, ClassType}; | ||
use objc2::foundation::NSObject; | ||
|
||
extern_class!( | ||
pub struct MyObject; | ||
|
||
unsafe impl ClassType for MyObject { | ||
type Superclass = NSObject; | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl MyObject { | ||
#[sel(a:)] | ||
fn a(); | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl MyObject { | ||
#[sel(b)] | ||
fn b(arg: i32); | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl MyObject { | ||
#[sel(c:d:e:)] | ||
fn c(arg1: i32, arg2: u32); | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl MyObject { | ||
#[sel(x:)] | ||
fn x(&self); | ||
} | ||
); | ||
|
||
extern_methods!( | ||
unsafe impl MyObject { | ||
#[sel(y)] | ||
fn y(&self, arg: i32); | ||
} | ||
); | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
error: Number of arguments in function and selector did not match! | ||
--> ui/extern_methods_wrong_arguments.rs | ||
| | ||
| / extern_methods!( | ||
| | unsafe impl MyObject { | ||
| | #[sel(a:)] | ||
| | fn a(); | ||
| | } | ||
| | ); | ||
| |_^ | ||
| | ||
= note: this error originates in the macro `$crate::__collect_msg_send` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: Number of arguments in function and selector did not match! | ||
--> ui/extern_methods_wrong_arguments.rs | ||
| | ||
| / extern_methods!( | ||
| | unsafe impl MyObject { | ||
| | #[sel(b)] | ||
| | fn b(arg: i32); | ||
| | } | ||
| | ); | ||
| |_^ | ||
| | ||
= note: this error originates in the macro `$crate::__collect_msg_send` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: Number of arguments in function and selector did not match! | ||
--> ui/extern_methods_wrong_arguments.rs | ||
| | ||
| / extern_methods!( | ||
| | unsafe impl MyObject { | ||
| | #[sel(c:d:e:)] | ||
| | fn c(arg1: i32, arg2: u32); | ||
| | } | ||
| | ); | ||
| |_^ | ||
| | ||
= note: this error originates in the macro `$crate::__collect_msg_send` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: Number of arguments in function and selector did not match! | ||
--> ui/extern_methods_wrong_arguments.rs | ||
| | ||
| / extern_methods!( | ||
| | unsafe impl MyObject { | ||
| | #[sel(x:)] | ||
| | fn x(&self); | ||
| | } | ||
| | ); | ||
| |_^ | ||
| | ||
= note: this error originates in the macro `$crate::__collect_msg_send` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: Number of arguments in function and selector did not match! | ||
--> ui/extern_methods_wrong_arguments.rs | ||
| | ||
| / extern_methods!( | ||
| | unsafe impl MyObject { | ||
| | #[sel(y)] | ||
| | fn y(&self, arg: i32); | ||
| | } | ||
| | ); | ||
| |_^ | ||
| | ||
= note: this error originates in the macro `$crate::__collect_msg_send` which comes from the expansion of the macro `extern_methods` (in Nightly builds, run with -Z macro-backtrace for more info) |