Skip to content

Commit f51e5cf

Browse files
committed
Test that having no return type on msg_send doesn't compile
1 parent f3358c3 commit f51e5cf

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use objc2::{class, msg_send};
2+
3+
fn main() {
4+
unsafe {
5+
let cls = class!(NSObject);
6+
let _obj = msg_send![cls, new];
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/msg_send_no_return_type.rs:6:20
3+
|
4+
6 | let _obj = msg_send![cls, new];
5+
| ---- ^^^^^^^^^^^^^^^^^^^ cannot infer type
6+
| |
7+
| consider giving `_obj` a type
8+
|
9+
= note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)

0 commit comments

Comments
 (0)