Skip to content

Commit 0942961

Browse files
committed
add resolver to attr parser
1 parent bb67210 commit 0942961

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ impl<'sess> AttributeParser<'sess> {
211211
attrs: &'a [ast::Attribute],
212212
target_span: Span,
213213
omit_doc: OmitDoc,
214-
215214
lower_span: impl Copy + Fn(Span) -> Span,
216215
) -> Vec<Attribute> {
217216
let mut attributes = Vec::new();

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use rustc_serialize::{Decodable, Encodable};
4747
use rustc_session::lint::LintBuffer;
4848
pub use rustc_session::lint::RegisteredTools;
4949
use rustc_span::hygiene::MacroKind;
50-
use rustc_span::{ExpnId, ExpnKind, Ident, Span, Symbol, kw, sym};
50+
use rustc_span::{EiiId, ExpnId, ExpnKind, Ident, Span, Symbol, kw, sym};
5151
pub use rustc_type_ir::relate::VarianceDiagInfo;
5252
pub use rustc_type_ir::*;
5353
use tracing::{debug, instrument};
@@ -216,6 +216,9 @@ pub struct ResolverAstLowering {
216216

217217
/// Information about functions signatures for delegation items expansion
218218
pub delegation_fn_sigs: LocalDefIdMap<DelegationFnSig>,
219+
220+
/// Map of defids for all items marked with #[eii(<eii id>)].
221+
pub eii: FxHashMap<EiiId, LocalDefId>,
219222
}
220223

221224
#[derive(Debug)]

compiler/rustc_passes/src/check_attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
455455
}
456456

457457
/// Checks if an `#[inline]` is applied to a function or a closure.
458-
fn check_eii(&self, _hir_id: HirId, attr_span: Span, _defn_span: Span, target: Target) {
458+
fn check_eii(&self, _hir_id: HirId, _attr_span: Span, _defn_span: Span, target: Target) {
459459
match target {
460460
Target::ForeignFn => {}
461461
target => {

compiler/rustc_resolve/src/def_collector.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> {
147147
&i.attrs,
148148
i.span,
149149
OmitDoc::Skip,
150+
None,
150151
std::convert::identity,
151152
);
152153

compiler/rustc_resolve/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,6 +1698,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
16981698
lifetime_elision_allowed: self.lifetime_elision_allowed,
16991699
lint_buffer: Steal::new(self.lint_buffer),
17001700
delegation_fn_sigs: self.delegation_fn_sigs,
1701+
eii: self.eii,
17011702
};
17021703
ResolverOutputs { global_ctxt, ast_lowering }
17031704
}

0 commit comments

Comments
 (0)