Code Monkey home page Code Monkey logo

rust-block's People

Contributors

frewsxcv avatar jdm avatar ssheldon avatar waywardmonkeys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rust-block's Issues

Additional maintainers

It looks like you may have moved on to other things, would you consider accepting additional maintainers? I'd like to see the open PRs make progress. Thanks!

Lots of transmute warnings that will become errors

For example:

/Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs:210:25: 210:39 warning: `unsafe extern "C" fn(*mut ConcreteBlock<(), isize, isize>) -> isize {X.IntoConcreteBlock<()>::into_concrete_block::concrete_block_invoke_args0::<isize, isize>}` is now zero-sized and has to be cast to a pointer before transmuting to `unsafe extern "C" fn(*mut ConcreteBlock<(), isize, isize>, ...) -> isize`, #[warn(transmute_from_fn_item_types)] on by default
/Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs:210                         mem::transmute($f::<$($t,)* R, X>), self)
                                                                                                                ^~~~~~~~~~~~~~
/Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs:192:9: 192:35 note: in this expansion of concrete_block_impl! (defined in /Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs)
/Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs:217:1: 217:51 note: in this expansion of concrete_block_impl! (defined in /Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs)
/Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs:210:25: 210:39 warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
/Users/servo/.cargo/registry/src/github.com-88ac128001ac3a9a/block-0.1.4/src/lib.rs:210:25: 210:39 note: for more information, see issue #19925 <https://github.com/rust-lang/rust/issues/19925>

Need to copy the block

It is important to copy your block to the heap (with the copy method) before passing it to Objective-C; this is because our ConcreteBlock is only meant to be copied once, and we can enforce this in Rust, but if Objective-C code were to copy it twice we could have a double free.

This is really unfortunate and error prone. It would be great to leverage the type system to do this automatically for us or at least enforce safety at compile time.

`block2 0.2.0-alpha.6`: Implementing `Encode`/`RefEncode` is bothersome and not always possible

I tried using the alpha 6 of block2, which lead me to objc2_encode which asked me to implement Encode and RefEncode

  1. It is bothersome to implement for the default case (a struct/union) with no particular semantics, in which case a derive proc macro could be provided.
  2. When using types from libc, e.g. stat, I either have to stop and not implement the traits or I have to go deep to find if there are pointers/members to other structs where I have to do the same until I reach only base types. In the case of pointers I don't even know how I would do it ? A mimic struct defined locally which implements Encode ?

I don't know if there is a good solution to 2. sadly, because adding a dep in libc on objc2_encode is certainly not going to work.

License File

For packaging of downstream packages it would be nice to have a dedicated license which is used to gather all licenses of all depencies and repackage these license files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.