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 Aug 31, 2021
1 parent 181f35e commit 092f428
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions objc/tests/ui/msg_send_no_return_type.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use objc::{class, msg_send};

fn main() {
unsafe {
let cls = class!(NSObject);
let _obj = msg_send![cls, new];
}
}
9 changes: 9 additions & 0 deletions objc/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 a macro (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 092f428

Please sign in to comment.