intellij-rust
intellij-rust copied to clipboard
False-positive "x doesn't implement `Display` (required by {})"
Environment
- IntelliJ Rust plugin version: 0.4.194.5382-231
- Rust toolchain version: rustc 1.69.0 (84c898d65 2023-04-16)
- IDE name and version: Goland 2023.1.2
- Operating system: Windows 11
Problem description
I've implemented fmt::Display for Point2D and it works, but IDE still shows me error.
Steps to reproduce
use std::fmt;
struct Point2D {
x: f64,
y: f64,
}
impl fmt::Display for Point2D {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "x: {}, y: {}", self.x, self.y)
}
}
fn main() {
let point = Point2D { x: 3.3, y: 7.2 };
println!("Display: {}", point);
}
I have observed this consistently happening when I add a local crate as a dependency. Everything compiles fine, however the IDE only recognizes the type and not the implementation of Display, or any implemented method for that matter.
- Rustc / cargo: 1.72.0
- Rust Plugin: 0.4.200.5421-232
- CLion 2023.2.1
- Manjaro Linux