Skip to content

Commit 49b276b

Browse files
committed
add map for eii ids in resolver
1 parent 6874126 commit 49b276b

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
@@ -27,6 +27,7 @@ use std::cell::{Cell, RefCell};
2727
use std::collections::BTreeSet;
2828
use std::fmt;
2929
use std::sync::Arc;
30+
use rustc_span::EiiId,
3031

3132
use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion};
3233
use effective_visibilities::EffectiveVisibilitiesVisitor;
@@ -1235,6 +1236,9 @@ pub struct Resolver<'ra, 'tcx> {
12351236
current_crate_outer_attr_insert_span: Span,
12361237

12371238
mods_with_parse_errors: FxHashSet<DefId>,
1239+
1240+
/// Map of defids for all items marked with #[eii(<eii id>)].
1241+
eii: FxHashMap<EiiId, DefId>,
12381242
}
12391243

12401244
/// 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
@@ -1205,6 +1205,12 @@ rustc_index::newtype_index! {
12051205
pub struct AttrId {}
12061206
}
12071207

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

0 commit comments

Comments
 (0)