]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const_fn_floating_point_arithmetic.rs
Do not suggest `let_else` if no bindings would be introduced
[rust.git] / src / test / ui / consts / const_fn_floating_point_arithmetic.rs
1 // gate-test-const_fn_floating_point_arithmetic
2
3 // revisions: stock gated
4
5 #![feature(rustc_attrs)]
6 #![cfg_attr(gated, feature(const_fn_floating_point_arithmetic))]
7
8 const fn add(f: f32) -> f32 { f + 2.0 }
9 //[stock]~^ floating point arithmetic
10 const fn sub(f: f32) -> f32 { 2.0 - f }
11 //[stock]~^ floating point arithmetic
12 const fn mul(f: f32, g: f32) -> f32 { f * g }
13 //[stock]~^ floating point arithmetic
14 const fn div(f: f32, g: f32) -> f32 { f / g }
15 //[stock]~^ floating point arithmetic
16 const fn neg(f: f32) -> f32 { -f }
17 //[stock]~^ floating point arithmetic
18
19 #[rustc_error]
20 fn main() {} //[gated]~ fatal error triggered by #[rustc_error]