From cea8f671994026cefdaadd7388aef9e05b479e66 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Sun, 31 Jan 2016 15:48:08 -0500 Subject: [PATCH] Don't show `const` in docs when it's not available Fixes #31098 --- src/librustdoc/html/format.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 9d5189cfd0b1..68909b958ba7 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -657,6 +657,9 @@ impl fmt::Display for UnsafetySpace { impl fmt::Display for ConstnessSpace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() { + return Ok(()); + } match self.get() { hir::Constness::Const => write!(f, "const "), hir::Constness::NotConst => Ok(())