-
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 lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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
This code compiles:
use std::cell::Cell;
use std::default::Default;
fn main() {
let cell = Cell::new(0u64);
cell.get() == Default::default();
}
This code does not:
extern crate serde_json;
use std::cell::Cell;
use std::default::Default;
fn main() {
let cell = Cell::new(0u64);
cell.get() == Default::default();
}
error[E0283]: type annotations required: cannot resolve `u64: std::cmp::PartialEq<_>`
--> src/lib.rs:7:16
|
7 | cell.get() == Default::default();
| ^^
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.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.