Skip to content

Commit fdd2864

Browse files
committed
add resolver to attr parser
1 parent 6f9cb15 commit fdd2864

File tree

15 files changed

+329
-358
lines changed

15 files changed

+329
-358
lines changed

Cargo.lock

Lines changed: 313 additions & 346 deletions
Large diffs are not rendered by default.

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ impl<'sess> AttributeParser<'sess> {
213213
attrs: &'a [ast::Attribute],
214214
target_span: Span,
215215
omit_doc: OmitDoc,
216-
217216
lower_span: impl Copy + Fn(Span) -> Span,
218217
) -> Vec<Attribute> {
219218
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
@@ -48,7 +48,7 @@ use rustc_serialize::{Decodable, Encodable};
4848
use rustc_session::lint::LintBuffer;
4949
pub use rustc_session::lint::RegisteredTools;
5050
use rustc_span::hygiene::MacroKind;
51-
use rustc_span::{DUMMY_SP, ExpnId, ExpnKind, Ident, Span, Symbol, kw, sym};
51+
use rustc_span::{EiiId, DUMMY_SP, ExpnId, ExpnKind, Ident, Span, Symbol, kw, sym};
5252
pub use rustc_type_ir::relate::VarianceDiagInfo;
5353
pub use rustc_type_ir::*;
5454
use tracing::{debug, instrument};
@@ -215,6 +215,9 @@ pub struct ResolverAstLowering {
215215

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

220223
#[derive(Debug)]

compiler/rustc_passes/src/check_attr.rs

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

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

compiler/rustc_resolve/src/def_collector.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ impl<'a, 'ra, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'ra, 'tcx> {
138138
&i.attrs,
139139
i.span,
140140
OmitDoc::Skip,
141+
None,
141142
std::convert::identity,
142143
);
143144

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
}

library/stdarch

Submodule stdarch updated 37 files

src/doc/book

Submodule book updated 875 files

0 commit comments

Comments
 (0)