summaryrefslogtreecommitdiffstats
path: root/library/core/src/fmt/nofloat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src/fmt/nofloat.rs')
-rw-r--r--library/core/src/fmt/nofloat.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/library/core/src/fmt/nofloat.rs b/library/core/src/fmt/nofloat.rs
new file mode 100644
index 000000000..cfb94cd9d
--- /dev/null
+++ b/library/core/src/fmt/nofloat.rs
@@ -0,0 +1,15 @@
+use crate::fmt::{Debug, Formatter, Result};
+
+macro_rules! floating {
+ ($ty:ident) => {
+ #[stable(feature = "rust1", since = "1.0.0")]
+ impl Debug for $ty {
+ fn fmt(&self, _fmt: &mut Formatter<'_>) -> Result {
+ panic!("floating point support is turned off");
+ }
+ }
+ };
+}
+
+floating! { f32 }
+floating! { f64 }