diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-06-25 20:43:04 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-07-17 19:41:02 +0200 |
| commit | 078dd37f882a59d4277d80b829d729bfd2b5a5c2 (patch) | |
| tree | c37f60b600f91081c276d467c1e5839a7be39eee /compiler/rustc_ast/src | |
| parent | 6e78d6c9d697217998322ab626cbeee24cdfe228 (diff) | |
| download | rust-078dd37f882a59d4277d80b829d729bfd2b5a5c2.tar.gz rust-078dd37f882a59d4277d80b829d729bfd2b5a5c2.zip | |
Use LocalExpnId where possible.
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/node_id.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_ast/src/node_id.rs b/compiler/rustc_ast/src/node_id.rs index e1e7d757d7e..7f928cb5761 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, LocalExpnId}; +use rustc_span::LocalExpnId; use std::fmt; rustc_index::newtype_index! { @@ -24,12 +24,12 @@ pub const CRATE_NODE_ID: NodeId = NodeId::from_u32(0); 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.expect_local().as_u32()) + pub fn placeholder_from_expn_id(expn_id: LocalExpnId) -> Self { + NodeId::from_u32(expn_id.as_u32()) } - pub fn placeholder_to_expn_id(self) -> ExpnId { - LocalExpnId::from_u32(self.as_u32()).to_expn_id() + pub fn placeholder_to_expn_id(self) -> LocalExpnId { + LocalExpnId::from_u32(self.as_u32()) } } |
