Skip to content

Commit a8aeac0

Browse files
committed
add map for eii ids in resolver
1 parent ab5b1be commit a8aeac0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

compiler/rustc_resolve/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use std::cell::{Cell, RefCell};
2525
use std::collections::BTreeSet;
2626
use std::fmt;
2727
use std::sync::Arc;
28+
use rustc_span::EiiId,
2829

2930
use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion};
3031
use effective_visibilities::EffectiveVisibilitiesVisitor;
@@ -1227,6 +1228,9 @@ pub struct Resolver<'ra, 'tcx> {
12271228
current_crate_outer_attr_insert_span: Span,
12281229

12291230
mods_with_parse_errors: FxHashSet<DefId>,
1231+
1232+
/// Map of defids for all items marked with #[eii(<eii id>)].
1233+
eii: FxHashMap<EiiId, DefId>,
12301234
}
12311235

12321236
/// This provides memory for the rest of the crate. The `'ra` lifetime that is

compiler/rustc_span/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,12 @@ rustc_index::newtype_index! {
12041204
pub struct AttrId {}
12051205
}
12061206

1207+
rustc_index::newtype_index! {
1208+
#[orderable]
1209+
#[debug_format = "EiiId({})"]
1210+
pub struct EiiId {}
1211+
}
1212+
12071213
/// This trait is used to allow encoder specific encodings of certain types.
12081214
/// It is similar to rustc_type_ir's TyEncoder.
12091215
pub trait SpanEncoder: Encoder {

0 commit comments

Comments
 (0)