Skip to content

Commit d1e1aff

Browse files
authored
Update known problems for default_numeric_fallback (#13794)
The existing known problem is not actually true, and the many false positives and false negatives should be mentioned. Allowing the lint on a single statement: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=328de43690af13ed126f7c00c15cd695 changelog: [`default_numeric_fallback`]: update known problems docs
2 parents 7f866c7 + 0a99eec commit d1e1aff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_lints/src/default_numeric_fallback.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ declare_clippy_lint! {
2626
/// To ensure that every numeric type is chosen explicitly rather than implicitly.
2727
///
2828
/// ### Known problems
29-
/// This lint can only be allowed at the function level or above.
29+
/// This lint is implemented using a custom algorithm independent of rustc's inference,
30+
/// which results in many false positives and false negatives.
3031
///
3132
/// ### Example
3233
/// ```no_run
@@ -36,8 +37,8 @@ declare_clippy_lint! {
3637
///
3738
/// Use instead:
3839
/// ```no_run
39-
/// let i = 10i32;
40-
/// let f = 1.23f64;
40+
/// let i = 10_i32;
41+
/// let f = 1.23_f64;
4142
/// ```
4243
#[clippy::version = "1.52.0"]
4344
pub DEFAULT_NUMERIC_FALLBACK,

0 commit comments

Comments
 (0)