-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-inferenceArea: Type inferenceArea: Type inferenceC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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. Spxg/sqlite-wasm-rs#58
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-inferenceArea: Type inferenceArea: Type inferenceC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.