about summary refs log tree commit diff
path: root/compiler/rustc_session/src
diff options
context:
space:
mode:
authorSparrowLii <liyuan179@huawei.com>2022-09-02 16:29:40 +0800
committerSparrowLii <liyuan179@huawei.com>2022-09-14 08:49:10 +0800
commit1a3ecbdb6a4c9eeced6e9a7ece9f5733548d531b (patch)
tree5a1b1e1d8d396190a02f9483db02166737895e8b /compiler/rustc_session/src
parent17cbdfd07178349d0a3cecb8e7dde8f915666ced (diff)
downloadrust-1a3ecbdb6a4c9eeced6e9a7ece9f5733548d531b.tar.gz
rust-1a3ecbdb6a4c9eeced6e9a7ece9f5733548d531b.zip
make `mk_attr_id` part of `ParseSess`
Diffstat (limited to 'compiler/rustc_session/src')
-rw-r--r--compiler/rustc_session/src/parse.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs
index 9bc7fbfbe14..0389b2a06a3 100644
--- a/compiler/rustc_session/src/parse.rs
+++ b/compiler/rustc_session/src/parse.rs
@@ -21,6 +21,7 @@ use rustc_span::hygiene::ExpnId;
 use rustc_span::source_map::{FilePathMapping, SourceMap};
 use rustc_span::{Span, Symbol};
 
+use rustc_ast::attr::AttrIdGenerator;
 use std::str;
 
 /// The set of keys (and, optionally, values) that define the compilation
@@ -219,6 +220,8 @@ pub struct ParseSess {
     /// Spans passed to `proc_macro::quote_span`. Each span has a numerical
     /// identifier represented by its position in the vector.
     pub proc_macro_quoted_spans: Lock<Vec<Span>>,
+    /// Used to generate new `AttrId`s. Every `AttrId` is unique.
+    pub attr_id_generator: AttrIdGenerator,
 }
 
 impl ParseSess {
@@ -257,6 +260,7 @@ impl ParseSess {
             type_ascription_path_suggestions: Default::default(),
             assume_incomplete_release: false,
             proc_macro_quoted_spans: Default::default(),
+            attr_id_generator: AttrIdGenerator::new(),
         }
     }