Skip to content

Commit b58294e

Browse files
committed
save-analysis: strip /// or whatever from doc comments
1 parent 493544a commit b58294e

File tree

1 file changed

+2
-1
lines changed
  • src/librustc_save_analysis

1 file changed

+2
-1
lines changed

src/librustc_save_analysis/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ use std::fs::{self, File};
5252
use std::path::{Path, PathBuf};
5353

5454
use syntax::ast::{self, NodeId, PatKind, Attribute};
55+
use syntax::parse::lexer::comments::strip_doc_comment_decoration;
5556
use syntax::parse::token::{self, keywords, InternedString};
5657
use syntax::visit::{self, Visitor};
5758
use syntax::print::pprust::{ty_to_string, arg_to_string};
@@ -756,7 +757,7 @@ fn docs_for_attrs(attrs: &[Attribute]) -> String {
756757
for attr in attrs {
757758
if attr.name() == doc {
758759
if let Some(ref val) = attr.value_str() {
759-
result.push_str(val);
760+
result.push_str(&strip_doc_comment_decoration(val));
760761
result.push('\n');
761762
}
762763
}

0 commit comments

Comments
 (0)