it more looks like a typo from people who came from other languages like python and do not know about method way which is more idiomatic in rust imo, so, I guess, such suggestion woudln't harm
on top i can say it produce such suggestion between incomparable types, which may be missleading? im not sure if there an easy way to check if both types are implementing Ord to not generate this
fn main() { struct A; let a = A; max(a, 2); }
error[E0425]: cannot find function `max` in this scope
--> /home/gh-Kivooeo/test_/src/main.rs:4:5
|
4 | max(a, 2);
| ^^^ not found in this scope
|
= note: -Ztrack-diagnostics: created at compiler/rustc_resolve/src/late/diagnostics.rs:445:36
help: you may have meant to use the method syntax
|
4 - max(a, 2);
4 + a.max(2);
|
help: consider importing this function
|
1 + use std::cmp::max;
|