Don't show const in docs when it's not available

Fixes #31098
This commit is contained in:
Brandon W Maister 2016-01-31 15:48:08 -05:00
parent 9041b93058
commit cea8f67199

View file

@ -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(())