rust/tests/ui/feature-gates/feature-gate-f16.rs
Trevor Gross 9a7b176227 Update f16 and f128 tests to run on both 2015 and 2018 editions
Reproduce the bug from <https://github.com/rust-lang/rust/issues/123282>
that indicates this feature gate hits edition-dependent resolution paths.
Resolution changed in edition 2018, so test that as well.
2024-04-03 16:03:22 -04:00

20 lines
405 B
Rust

//@ revisions: e2015 e2018
//
//@[e2018] edition:2018
#![allow(unused)]
const A: f16 = 10.0; //~ ERROR the type `f16` is unstable
pub fn main() {
let a: f16 = 100.0; //~ ERROR the type `f16` is unstable
let b = 0.0f16; //~ ERROR the type `f16` is unstable
foo(1.23);
}
fn foo(a: f16) {} //~ ERROR the type `f16` is unstable
struct Bar {
a: f16, //~ ERROR the type `f16` is unstable
}