]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_save_analysis/lib.rs
Auto merge of #67729 - mati865:deps, r=nikomatsakis
[rust.git] / src / librustc_save_analysis / lib.rs
index 27d4eef34cb7c8099e808177b0910ef982f9d1e9..bebe5309b4465de897d93d128bf1c6512eb05760 100644 (file)
 use std::io::BufWriter;
 use std::path::{Path, PathBuf};
 
+use rustc_span::*;
 use syntax::ast::{self, Attribute, NodeId, PatKind, DUMMY_NODE_ID};
 use syntax::print::pprust;
 use syntax::print::pprust::{param_to_string, ty_to_string};
 use syntax::source_map::Spanned;
 use syntax::util::comments::strip_doc_comment_decoration;
 use syntax::visit::{self, Visitor};
-use syntax_pos::*;
 
 use dump_visitor::DumpVisitor;
 use span_utils::SpanUtils;
@@ -815,15 +815,15 @@ fn docs_for_attrs(&self, attrs: &[Attribute]) -> String {
         let mut result = String::new();
 
         for attr in attrs {
-            if attr.check_name(sym::doc) {
-                if let Some(val) = attr.value_str() {
-                    if attr.is_doc_comment() {
-                        result.push_str(&strip_doc_comment_decoration(&val.as_str()));
-                    } else {
-                        result.push_str(&val.as_str());
-                    }
-                    result.push('\n');
-                } else if let Some(meta_list) = attr.meta_item_list() {
+            if let Some(val) = attr.doc_str() {
+                if attr.is_doc_comment() {
+                    result.push_str(&strip_doc_comment_decoration(&val.as_str()));
+                } else {
+                    result.push_str(&val.as_str());
+                }
+                result.push('\n');
+            } else if attr.check_name(sym::doc) {
+                if let Some(meta_list) = attr.meta_item_list() {
                     meta_list
                         .into_iter()
                         .filter(|it| it.check_name(sym::include))