Skip to content

Commit 010c3e2

Browse files
committed
Auto merge of #39340 - GuillaumeGomez:empty_comment, r=frewsxcv
Don't generate doc if doc comments only filled with 'white' characters Fixes #39339. r? @steveklabnik cc @rust-lang/docs
2 parents 0f49616 + 460a3b2 commit 010c3e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustdoc/html/markdown.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ pub fn render(w: &mut fmt::Formatter,
237237
let my_opaque: &MyOpaque = &*((*opaque).opaque as *const MyOpaque);
238238
let text = (*orig_text).as_bytes();
239239
let origtext = str::from_utf8(text).unwrap();
240+
let origtext = origtext.trim_left();
240241
debug!("docblock: ==============\n{:?}\n=======", text);
241-
let rendered = if lang.is_null() {
242+
let rendered = if lang.is_null() || origtext.is_empty() {
242243
false
243244
} else {
244245
let rlang = (*lang).as_bytes();

0 commit comments

Comments
 (0)