pathfinder icon indicating copy to clipboard operation
pathfinder copied to clipboard

msg_send! compile error

Open JavedNissar opened this issue 6 years ago • 6 comments

Not sure what could be causing this but I'm getting the following error on cargo build. It seems to have been introduced in 29713c5cd9b1b47392e716ff6f18be388d9d46ae

error[E0282]: type annotations needed
   --> /Users/javednissar/.cargo/registry/src/github.com-1ecc6299db9ec823/metal-0.14.0/src/lib.rs:128:13
    |
128 |             msg_send![self.0, release];
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |             |
    |             cannot infer type
    |             consider giving `result` a type
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

JavedNissar avatar Dec 01 '19 20:12 JavedNissar

Try updating the objc and core-foundation crates.

jdm avatar Dec 01 '19 23:12 jdm

Oh, and the metal crate.

jdm avatar Dec 01 '19 23:12 jdm

So, I updated those but I kept getting that era until I updated cocoa too but once I updated cocoa, it started giving me this error.

error[E0308]: mismatched types
   --> metal/src/lib.rs:887:53
    |
887 |             vertex_argument_buffer.did_modify_range(range);
    |                                                     ^^^^^ expected struct `cocoa::foundation::NSRange`, found a different struct `cocoa::foundation::NSRange`
    |
    = note: expected type `cocoa::foundation::NSRange` (struct `cocoa::foundation::NSRange`)
               found type `cocoa::foundation::NSRange` (struct `cocoa::foundation::NSRange`)
note: Perhaps two different versions of crate `cocoa` are being used?
   --> metal/src/lib.rs:887:53
    |
887 |             vertex_argument_buffer.did_modify_range(range);
    |                                                     ^^^^^

error[E0308]: mismatched types
   --> metal/src/lib.rs:891:55
    |
891 |             fragment_argument_buffer.did_modify_range(range);
    |                                                       ^^^^^ expected struct `cocoa::foundation::NSRange`, found a different struct `cocoa::foundation::NSRange`
    |
    = note: expected type `cocoa::foundation::NSRange` (struct `cocoa::foundation::NSRange`)
               found type `cocoa::foundation::NSRange` (struct `cocoa::foundation::NSRange`)
note: Perhaps two different versions of crate `cocoa` are being used?
   --> metal/src/lib.rs:891:55
    |
891 |             fragment_argument_buffer.did_modify_range(range);
    |                                                       ^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
error: Could not compile `pathfinder_metal`.

JavedNissar avatar Dec 02 '19 05:12 JavedNissar

That means there are multiple versions of core-foundation in the dependency tree and the older one needs to be updated.

jdm avatar Dec 02 '19 14:12 jdm

Does this still happen?

pcwalton avatar May 08 '20 20:05 pcwalton

I managed to resolve it with Josh's advice. Is it alright if I close the issue?

JavedNissar avatar May 09 '20 18:05 JavedNissar