Skip to content

Commit

Permalink
Test that having no return type on msg_send doesn't compile
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Nov 2, 2021
1 parent f3358c3 commit f51e5cf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions objc2/tests/ui/msg_send_no_return_type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use objc2::{class, msg_send};

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

0 comments on commit f51e5cf

Please sign in to comment.