Skip to content

Commit

Permalink
Merge pull request #144 from madsmtm/ci-fixes
Browse files Browse the repository at this point in the history
CI fixes
  • Loading branch information
madsmtm authored May 22, 2022
2 parents 1c9c9d3 + 713cfad commit 02cf1d2
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches: [master]
pull_request:
schedule:
- cron: '0 9 * * MON'

env:
CARGO_TERM_COLOR: always
Expand Down
9 changes: 5 additions & 4 deletions block2/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ const GLOBAL_DESCRIPTOR: ffi::Block_descriptor_header = ffi::Block_descriptor_he
/// An Objective-C block that does not capture it's environment.
///
/// This is effectively just a glorified function pointer, and can created and
/// stored in static memory using the [`global_block`][`global_block!`] macro.
/// stored in static memory using the [`global_block!`] macro.
///
/// If [`ConcreteBlock`] is the [`Fn`]-block equivalent, this is likewise the
/// [`fn`]-block equivalent.
///
/// [`ConcreteBlock`]: crate::ConcreteBlock
/// [`global_block!`]: crate::global_block
#[repr(C)]
pub struct GlobalBlock<A, R = ()> {
layout: ffi::Block_layout,
Expand Down Expand Up @@ -88,9 +89,9 @@ where

/// Construct a static [`GlobalBlock`].
///
/// The syntax is similar to a static closure. Note that the block cannot
/// capture it's environment, and it's argument types and return type must be
/// [`Encode`].
/// The syntax is similar to a static closure (except that all types have to
/// be specified). Note that the block cannot capture it's environment, and
/// it's argument types and return type must be [`Encode`].
///
/// # Examples
///
Expand Down
1 change: 0 additions & 1 deletion objc2/src/message/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ macro_rules! message_args_impl {
($($a:ident : $t:ident),*) => (
unsafe impl<$($t: Encode),*> MessageArguments for ($($t,)*) {
#[inline]
#[doc(hidden)]
unsafe fn __invoke<R: Encode>(imp: Imp, obj: *mut Object, sel: Sel, ($($a,)*): Self) -> R {
// The imp must be cast to the appropriate function pointer
// type before being called; the msgSend functions are not
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/global_block_not_encode.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ error[E0277]: the trait bound `Box<i32>: objc2_encode::encode::Encode` is not sa
5 | | }
| |_^ the trait `objc2_encode::encode::Encode` is not implemented for `Box<i32>`
|
= help: the following other types implement trait `objc2_encode::encode::Encode`:
&'a T
&'a mut T
()
*const T
*const c_void
*mut T
*mut c_void
ManuallyDrop<T>
and 140 others
= note: required because of the requirements on the impl of `objc2_encode::encode::EncodeArguments` for `(Box<i32>,)`
= note: required because of the requirements on the impl of `Sync` for `GlobalBlock<(Box<i32>,)>`
= note: shared static variables must have a type that implements `Sync`
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/msg_send_not_encode.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ error[E0277]: the trait bound `Vec<u8>: Encode` is not satisfied
7 | let _: Vec<u8> = msg_send![cls, new];
| ^^^^^^^^^^^^^^^^^^^ the trait `Encode` is not implemented for `Vec<u8>`
|
= help: the following other types implement trait `Encode`:
&'a T
&'a mut T
()
*const T
*const c_void
*mut T
*mut c_void
ManuallyDrop<T>
and 142 others
note: required by a bound in `send_message`
--> $WORKSPACE/objc2/src/message/mod.rs
|
Expand Down
8 changes: 8 additions & 0 deletions tests/ui/msg_send_only_message.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ error[E0277]: the trait bound `{integer}: MessageReceiver` is not satisfied
5 | unsafe { msg_send![1, new] };
| ^^^^^^^^^^^^^^^^^ the trait `MessageReceiver` is not implemented for `{integer}`
|
= help: the following other types implement trait `MessageReceiver`:
&'a T
&'a mut T
*const T
*mut T
Id<T, O>
ManuallyDrop<T>
NonNull<T>
= note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)
16 changes: 10 additions & 6 deletions tests/ui/nsvalue_f32_not_eq.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ error[E0277]: the trait bound `f32: Eq` is not satisfied
11 | needs_eq::<NSValue<f32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `f32`
|
= help: the following implementations were found:
<i128 as Eq>
<i16 as Eq>
<i32 as Eq>
<i64 as Eq>
and 8 others
= help: the following other types implement trait `Eq`:
i128
i16
i32
i64
i8
isize
u128
u16
and 4 others
= note: required because of the requirements on the impl of `Eq` for `NSValue<f32>`
note: required by a bound in `needs_eq`
--> ui/nsvalue_f32_not_eq.rs:5:16
Expand Down

0 comments on commit 02cf1d2

Please sign in to comment.