question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mismatched types error E0308 when there is no error

See original GitHub issue

With the new plugin 52, Version: 0.1.0.2069 and using the jni-rs crate, this error is reported at many places in a Rust / JNI codebase.

JObject::from(env.new_string("hello")?);

mismatched types E0308 expected JThrowable, found JString

JString::from(elem_obj)

mismatched types E0308 expected *mut _jobject, found JObject

JObject and JString can be converted to each other using ::from. source: https://github.com/prevoty/jni-rs/blob/master/src/wrapper/objects/jstring.rs#L25

In the meantime, would there be an way to disable this check? It persists after disabling all inspections in IDEA Settings. Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
vlad20012commented, Oct 9, 2017

The issue is still actual for the disabled-by-default inspection =)

1reaction
vlad20012commented, Sep 25, 2017

@Techcable, the real wizard is @matklad, who patiently created the infrastructure for 2 years, using which I did it in 1-2 lines of code =) You can become a “wizard” like me, just start contributing here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] Why do I get: error[E0308]: mismatched types: note
This fairly common error could probably benefit from having a helpful note in the error message such as "add -> T to the...
Read more >
error[E0308]: mismatched types — expected `&str`, found ...
The code is not complete, but I am stuck here. I want to print array_display to the console, but when I assign the...
Read more >
Resolving Rust error[E0308] Mismatched Types When Types ...
This blog post explains one possible solution for rust compilation error E0308, mismatched types, when the referenced types actually match.
Read more >
Recoverable Errors with Result - The Rust Programming ... - MIT
Let's try it: we know that the return type of File::open isn't of type u32 ... error[E0308]: mismatched types --> src/main.rs:4:18 | 4...
Read more >
Recoverable Errors with Result - The Rust Programming ...
If there's no file named hello.txt in our current directory and we run this code, ... Listing 9-5: Handling different kinds of errors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found