about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-f16.rs
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-03-02 21:45:23 -0500
committerTrevor Gross <tmgross@umich.edu>2024-03-14 13:32:54 -0400
commite782d27ec6456a6080a5bfe8b2f189fa9f1b1d0f (patch)
treea20d4a7c0d24fba9342e761f15f4804931b334d2 /tests/ui/feature-gates/feature-gate-f16.rs
parentdc650952988de0f7321b5db56f26706530bf7212 (diff)
downloadrust-e782d27ec6456a6080a5bfe8b2f189fa9f1b1d0f.tar.gz
rust-e782d27ec6456a6080a5bfe8b2f189fa9f1b1d0f.zip
Add feature gates for `f16` and `f128`
Includes related tests and documentation pages.

Michael Goulet: Don't issue feature error in resolver for f16/f128
unless finalize

Co-authored-by: Michael Goulet <michael@errs.io>
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-f16.rs')
-rw-r--r--tests/ui/feature-gates/feature-gate-f16.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-f16.rs b/tests/ui/feature-gates/feature-gate-f16.rs
new file mode 100644
index 00000000000..31d8f87f3ba
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-f16.rs
@@ -0,0 +1,15 @@
+#![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
+}