about summary refs log tree commit diff
path: root/compiler/rustc_ast/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-07-10 23:34:41 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-07-17 19:35:33 +0200
commit6e78d6c9d697217998322ab626cbeee24cdfe228 (patch)
tree0f6242e82240bc69adb48880344da2fcd555c5ab /compiler/rustc_ast/src
parentc2d43e132975126dda1364346db8498fbc3917b0 (diff)
downloadrust-6e78d6c9d697217998322ab626cbeee24cdfe228.tar.gz
rust-6e78d6c9d697217998322ab626cbeee24cdfe228.zip
Make the CrateNum part of the ExpnId.
Diffstat (limited to 'compiler/rustc_ast/src')
-rw-r--r--compiler/rustc_ast/src/node_id.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ast/src/node_id.rs b/compiler/rustc_ast/src/node_id.rs
index d20bace6088..e1e7d757d7e 100644
--- a/compiler/rustc_ast/src/node_id.rs
+++ b/compiler/rustc_ast/src/node_id.rs
@@ -1,4 +1,4 @@
-use rustc_span::ExpnId;
+use rustc_span::{ExpnId, LocalExpnId};
 use std::fmt;
 
 rustc_index::newtype_index! {
@@ -25,11 +25,11 @@ pub const DUMMY_NODE_ID: NodeId = NodeId::MAX;
 
 impl NodeId {
     pub fn placeholder_from_expn_id(expn_id: ExpnId) -> Self {
-        NodeId::from_u32(expn_id.as_u32())
+        NodeId::from_u32(expn_id.expect_local().as_u32())
     }
 
     pub fn placeholder_to_expn_id(self) -> ExpnId {
-        ExpnId::from_u32(self.as_u32())
+        LocalExpnId::from_u32(self.as_u32()).to_expn_id()
     }
 }