]> git.lizzy.rs Git - rust.git/blob - tests/ui/numbers-arithmetic/suggest-float-literal.rs
Rollup merge of #107819 - clubby789:x-py-root, r=jyn514
[rust.git] / tests / ui / numbers-arithmetic / suggest-float-literal.rs
1 // run-rustfix
2
3 #![allow(dead_code)]
4
5 fn add_integer_to_f32(x: f32) -> f32 {
6     x + 100 //~ ERROR cannot add `{integer}` to `f32`
7 }
8
9 fn add_integer_to_f64(x: f64) -> f64 {
10     x + 100 //~ ERROR cannot add `{integer}` to `f64`
11 }
12
13 fn subtract_integer_from_f32(x: f32) -> f32 {
14     x - 100 //~ ERROR cannot subtract `{integer}` from `f32`
15 }
16
17 fn subtract_integer_from_f64(x: f64) -> f64 {
18     x - 100 //~ ERROR cannot subtract `{integer}` from `f64`
19 }
20
21 fn multiply_f32_by_integer(x: f32) -> f32 {
22     x * 100 //~ ERROR cannot multiply `f32` by `{integer}`
23 }
24
25 fn multiply_f64_by_integer(x: f64) -> f64 {
26     x * 100 //~ ERROR cannot multiply `f64` by `{integer}`
27 }
28
29 fn divide_f32_by_integer(x: f32) -> f32 {
30     x / 100 //~ ERROR cannot divide `f32` by `{integer}`
31 }
32
33 fn divide_f64_by_integer(x: f64) -> f64 {
34     x / 100 //~ ERROR cannot divide `f64` by `{integer}`
35 }
36
37 fn main() {}