@@ -30,7 +30,7 @@ use crate::token::{self, DelimToken};
30
30
use crate :: tokenstream:: { TokenStream , TokenTree , DelimSpan } ;
31
31
32
32
use syntax_pos:: symbol:: { kw, sym, Symbol } ;
33
- use syntax_pos:: { Span , DUMMY_SP , ExpnId } ;
33
+ use syntax_pos:: { Span , DUMMY_SP } ;
34
34
35
35
use rustc_data_structures:: fx:: FxHashSet ;
36
36
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
@@ -268,46 +268,7 @@ impl ParenthesizedArgs {
268
268
}
269
269
}
270
270
271
- // hack to ensure that we don't try to access the private parts of `NodeId` in this module
272
- mod node_id_inner {
273
- use rustc_index:: vec:: Idx ;
274
- rustc_index:: newtype_index! {
275
- pub struct NodeId {
276
- ENCODABLE = custom
277
- DEBUG_FORMAT = "NodeId({})"
278
- }
279
- }
280
- }
281
-
282
- pub use node_id_inner:: NodeId ;
283
-
284
- impl NodeId {
285
- pub fn placeholder_from_expn_id ( expn_id : ExpnId ) -> Self {
286
- NodeId :: from_u32 ( expn_id. as_u32 ( ) )
287
- }
288
-
289
- pub fn placeholder_to_expn_id ( self ) -> ExpnId {
290
- ExpnId :: from_u32 ( self . as_u32 ( ) )
291
- }
292
- }
293
-
294
- impl fmt:: Display for NodeId {
295
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
296
- fmt:: Display :: fmt ( & self . as_u32 ( ) , f)
297
- }
298
- }
299
-
300
- impl rustc_serialize:: UseSpecializedEncodable for NodeId {
301
- fn default_encode < S : Encoder > ( & self , s : & mut S ) -> Result < ( ) , S :: Error > {
302
- s. emit_u32 ( self . as_u32 ( ) )
303
- }
304
- }
305
-
306
- impl rustc_serialize:: UseSpecializedDecodable for NodeId {
307
- fn default_decode < D : Decoder > ( d : & mut D ) -> Result < NodeId , D :: Error > {
308
- d. read_u32 ( ) . map ( NodeId :: from_u32)
309
- }
310
- }
271
+ pub use rustc_session:: node_id:: NodeId ;
311
272
312
273
/// `NodeId` used to represent the root of the crate.
313
274
pub const CRATE_NODE_ID : NodeId = NodeId :: from_u32_const ( 0 ) ;
0 commit comments