From 73364a3a169eb67c87592dc2f0b7c5b532cc4f8b Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 6 Mar 2018 07:25:48 -0800 Subject: [PATCH 1/2] rustc: Update LLVM This pulls in the rest of LLVM's `release_60` branch (the actual 6.0.0 release) and also pulls in a cherry-pick to... Closes #48226 --- src/llvm | 2 +- src/rustllvm/llvm-rebuild-trigger | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llvm b/src/llvm index 9f81beaf32608..6ceaaa4b0176a 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 9f81beaf32608fbe1fe0f2a82f974e800e9d8c62 +Subproject commit 6ceaaa4b0176a200e4bbd347d6a991ab6c776ede diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index 3cd044708cee2..63af7a0d538e9 100644 --- a/src/rustllvm/llvm-rebuild-trigger +++ b/src/rustllvm/llvm-rebuild-trigger @@ -1,4 +1,4 @@ # If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. -2018-02-09 +2018-03-06 From a1d7c15de185823722e2b847e7d944552ebd16bd Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Thu, 22 Mar 2018 14:38:37 +0100 Subject: [PATCH 2/2] Fix DefKey lookup for proc-macro crates. --- src/librustc_metadata/decoder.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 06728b2e6257c..d28c5079c02d0 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -13,7 +13,8 @@ use cstore::{self, CrateMetadata, MetadataBlob, NativeLibrary}; use schema::*; -use rustc::hir::map::{DefKey, DefPath, DefPathData, DefPathHash}; +use rustc::hir::map::{DefKey, DefPath, DefPathData, DefPathHash, + DisambiguatedDefPathData}; use rustc::hir; use rustc::middle::cstore::{LinkagePreference, ExternConstBody, ExternBodyNestedBodies}; @@ -1061,7 +1062,23 @@ impl<'a, 'tcx> CrateMetadata { #[inline] pub fn def_key(&self, index: DefIndex) -> DefKey { - self.def_path_table.def_key(index) + if !self.is_proc_macro(index) { + self.def_path_table.def_key(index) + } else { + // FIXME(#49271) - It would be better if the DefIds were consistent + // with the DefPathTable, but for proc-macro crates + // they aren't. + let name = self.proc_macros + .as_ref() + .unwrap()[index.to_proc_macro_index()].0; + DefKey { + parent: Some(CRATE_DEF_INDEX), + disambiguated_data: DisambiguatedDefPathData { + data: DefPathData::MacroDef(name.as_str()), + disambiguator: 0, + } + } + } } // Returns the path leading to the thing with this `id`.