rust-analyzer version: 0.3.2188-standalone (ba56d9b 2024-11-17)
rustc version: rustc 1.82.0 (f6e511eec 2024-10-15)
editor or extension: VSCode; version of the RA extension is v0.3.2188
(I also tested with nightly / pre-release versions; the behavior was the same.)
code snippet to reproduce:
fn main() {
let x = f32::INF
}
Put the cursor at the end of the line and press ^Space for completions. The first two suggestions will both complete to f32::INFINITY, but the first one on the list is one which will insert use core::f32; too.

Since those constants are sort-of-deprecated, I don’t think RA should be preferring them, and in the general case, I would think that given any two identical local paths, it makes sense to rank completing the associated item over importing something new.
rust-analyzer version: 0.3.2188-standalone (ba56d9b 2024-11-17)
rustc version: rustc 1.82.0 (f6e511eec 2024-10-15)
editor or extension: VSCode; version of the RA extension is v0.3.2188
(I also tested with nightly / pre-release versions; the behavior was the same.)
code snippet to reproduce:
Put the cursor at the end of the line and press ^Space for completions. The first two suggestions will both complete to
f32::INFINITY, but the first one on the list is one which will insertuse core::f32;too.Since those constants are sort-of-deprecated, I don’t think RA should be preferring them, and in the general case, I would think that given any two identical local paths, it makes sense to rank completing the associated item over importing something new.