]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_save_analysis/lib.rs
Rollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakis
[rust.git] / src / librustc_save_analysis / lib.rs
index 240b33c3c9478ca50ae950f9d1d11c361e0bd51f..50aa48e8c5249801eee25eeb1613ea76e058db45 100644 (file)
@@ -12,6 +12,7 @@
        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(custom_attribute)]
+#![cfg_attr(not(stage0), feature(nll))]
 #![allow(unused_attributes)]
 
 #![recursion_limit="256"]
@@ -44,7 +45,7 @@
 use rustc::hir::map::{Node, NodeTraitItem, NodeImplItem};
 use rustc::hir::def_id::{DefId, LOCAL_CRATE};
 use rustc::middle::cstore::ExternCrate;
-use rustc::session::config::CrateType::CrateTypeExecutable;
+use rustc::session::config::CrateType;
 use rustc::ty::{self, TyCtxt};
 use rustc_typeck::hir_ty_to_ty;
 
@@ -125,7 +126,7 @@ pub fn get_external_crates(&self) -> Vec<ExternalCrateData> {
             result.push(ExternalCrateData {
                 // FIXME: change file_name field to PathBuf in rls-data
                 // https://github.com/nrc/rls-data/issues/7
-                file_name: SpanUtils::make_path_string(&lo_loc.file.name),
+                file_name: self.span_utils.make_path_string(&lo_loc.file.name),
                 num: n.as_u32(),
                 id: GlobalCrateId {
                     name: self.tcx.crate_name(n).to_string(),
@@ -810,9 +811,8 @@ fn fn_type(path: &ast::Path) -> bool {
             HirDef::SelfTy(..) |
             HirDef::Label(..) |
             HirDef::Macro(..) |
-            HirDef::GlobalAsm(..) |
             HirDef::ToolMod |
-            HirDef::NonMacroAttr |
+            HirDef::NonMacroAttr(..) |
             HirDef::Err => None,
         }
     }
@@ -1048,7 +1048,7 @@ fn output_file(&self, ctx: &SaveContext) -> File {
                 let executable = sess.crate_types
                     .borrow()
                     .iter()
-                    .any(|ct| *ct == CrateTypeExecutable);
+                    .any(|ct| *ct == CrateType::Executable);
                 let mut out_name = if executable {
                     "".to_owned()
                 } else {