Incorrect "mismatched types [E0308]" error
See original GitHub issueEnvironment
- IntelliJ Rust plugin version: 0.2.110.5731-193-dev
- Rust toolchain version: 1.39 stable
- IDE name and version: IntelliJ IDEA 2019.3 beta
- Operating system: Windows 10 x64
Problem description
Plugin gives incorrect E0308. New experimental macro engine is enabled.
Steps to reproduce
fn main() {
eat_slice(&[]); // error highlights empty slice ref
}
fn eat_slice(slice: &[&str]) {}
Error is:
mismatched types [E0308]
expected `&[&str]`, found `&[<unknown>]`
Code compiles without error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
error[E0308]: mismatched types — expected `&str`, found ...
The current issue in your code is that string_for_array.to_string() creates a new String , but the array_display array contains &str ...
Read more >[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 >Reproducable: C/C++ IntelliSense gives the incorrect E0308 ...
Reproducable: C/C++ IntelliSense gives the incorrect E0308 error "more ... sensitive and concludes they are different paths or something?
Read more >Rust Compiler Error Index | Rust Wiki
This error indicates that an empty match expression is invalid because the type it is ... consider manually listing out the methods of...
Read more >Rust Compiler Error Index
This error indicates that an empty match expression is invalid because the type it is ... consider manually listing out the methods of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@AlyoshaVasilieva Thanks for the report! I fixed it in #4621.
@alexschrod please, link the project you are working on or reduce it to a minimal example. And your issue is different
@vlad20012 I dunno, whatever you did to fix this issue also appears to have fixed mine. 🤷♂ Or at the very least, the issue I had is gone again with the latest release.