Unexpected "cannot infer type"
Open
Nobody has claimed this yet.
A-diagnostics
A-inference
C-bug
T-compiler
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=609d454db4ecdbe3026330593c586d79
// delete this import to compile success
use serde_json;
fn main() {
let a = 0usize;
let b = 0i32;
assert!(a == b as _);
}
I expected to see this happen: can infer type
Instead, this happened: cannot infer type, but delete use serde_json; will compile success
In fact, if the compilation succeeds at this point, it may be broken later when used with other dependencies. https://github.com/Spxg/sqlite-wasm-rs/issues/58
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.