(&'a str);
-
-impl<'a> fmt::Display for Initializer<'a> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- let Initializer(s) = *self;
- if s.is_empty() { return Ok(()); }
- write!(f, " =
")?;
- write!(f, "{}
", Escape(s))
- }
-}
-
fn item_constant(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
c: &clean::Constant) -> fmt::Result {
write!(w, "")?;
render_attributes(w, it)?;
write!(w, "{vis}const \
- {name}: {typ}{init}
",
+ {name}: {typ}",
vis = VisSpace(&it.visibility),
name = it.name.as_ref().unwrap(),
- typ = c.type_,
- init = Initializer(&c.expr))?;
+ typ = c.type_)?;
document(w, cx, it)
}
@@ -2608,12 +2596,11 @@ fn item_static(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
write!(w, "")?;
render_attributes(w, it)?;
write!(w, "{vis}static {mutability}\
- {name}: {typ}{init}
",
+ {name}: {typ}",
vis = VisSpace(&it.visibility),
mutability = MutableSpace(s.mutability),
name = it.name.as_ref().unwrap(),
- typ = s.type_,
- init = Initializer(&s.expr))?;
+ typ = s.type_)?;
document(w, cx, it)
}
diff --git a/src/test/rustdoc/escape-rust-expr.rs b/src/test/rustdoc/escape-rust-expr.rs
index 7f9a2bf175a5f..4594eb95ea18e 100644
--- a/src/test/rustdoc/escape-rust-expr.rs
+++ b/src/test/rustdoc/escape-rust-expr.rs
@@ -11,5 +11,5 @@
// Test that we HTML-escape Rust expressions, where HTML special chars
// can occur, and we know it's definitely not markup.
-// @has escape_rust_expr/constant.CONST_S.html '//pre[@class="rust const"]' '"