From 6e78d6c9d697217998322ab626cbeee24cdfe228 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 10 Jul 2021 23:34:41 +0200 Subject: Make the CrateNum part of the ExpnId. --- compiler/rustc_ast/src/node_id.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_ast/src') 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() } } -- cgit 1.4.1-3-g733a5