From 246edb8628cb4df26e37ef42a50ee076b9e21ff4 Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Mon, 28 Nov 2016 21:22:41 +0800 Subject: [PATCH] Make core::fmt::Void a non-empty type. Because we handle artifically-constructed references to it in live code which is a totally broken thing to do. --- src/libcore/fmt/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 2d75a8ec420b1..9167264ba9d12 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -166,7 +166,9 @@ pub struct Formatter<'a> { // NB. Argument is essentially an optimized partially applied formatting function, // equivalent to `exists T.(&T, fn(&T, &mut Formatter) -> Result`. -enum Void {} +struct Void { + _priv: (), +} /// This struct represents the generic "argument" which is taken by the Xprintf /// family of functions. It contains a function to format the given value. At