Skip to content

Commit cea8f67

Browse files
author
Brandon W Maister
committed
Don't show const in docs when it's not available
Fixes #31098
1 parent 9041b93 commit cea8f67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustdoc/html/format.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,9 @@ impl fmt::Display for UnsafetySpace {
657657

658658
impl fmt::Display for ConstnessSpace {
659659
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
660+
if option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some() {
661+
return Ok(());
662+
}
660663
match self.get() {
661664
hir::Constness::Const => write!(f, "const "),
662665
hir::Constness::NotConst => Ok(())

0 commit comments

Comments
 (0)