]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_save_analysis/sig.rs
syntax::print -> new crate rustc_ast_pretty
[rust.git] / src / librustc_save_analysis / sig.rs
index 779d3f55018d56f88980ead8dac6f8cbe25fa11f..dbf29b6531d2abd87da36e9e9f4e56b21867711c 100644 (file)
@@ -29,9 +29,9 @@
 
 use rls_data::{SigElement, Signature};
 
+use rustc_ast_pretty::pprust;
 use rustc_hir::def::{DefKind, Res};
 use syntax::ast::{self, Extern, NodeId};
-use syntax::print::pprust;
 
 pub fn item_signature(item: &ast::Item, scx: &SaveContext<'_, '_>) -> Option<Signature> {
     if !scx.config.signatures {
@@ -486,6 +486,7 @@ fn make(&self, offset: usize, _parent_id: Option<NodeId>, scx: &SaveContext<'_,
                 unsafety,
                 polarity,
                 defaultness,
+                constness,
                 ref generics,
                 ref of_trait,
                 ref self_ty,
@@ -499,6 +500,9 @@ fn make(&self, offset: usize, _parent_id: Option<NodeId>, scx: &SaveContext<'_,
                     text.push_str("unsafe ");
                 }
                 text.push_str("impl");
+                if constness == ast::Constness::Const {
+                    text.push_str(" const");
+                }
 
                 let generics_sig = generics.make(offset + text.len(), id, scx)?;
                 text.push_str(&generics_sig.text);