- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied
Description
let x = f64::from(32) + 2.0 * 4.0;clippy suggests
warning: consider using mul_add() for better numerical precision
 --> src/main.rs:3:10
  |
3 |     let x = f64::from(32) + 2.0 * 4.0;
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `2.0.mul_add(4.0, f64::from(32))`
  |
but
	 let x = 2.0.mul_add(4.0, f64::from(32));does not compile:
error[E0599]: no method named `mul_add` found for type `{float}` in the current scope
 --> src/main.rs:4:15
  |
4 |      let x = 2.0.mul_add(4.0, f64::from(32));
  |                  ^^^^^^^ method not found in `{float}`
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied