From 730c5de2815f310ee4e71dd48af101c10e46d747 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 2 Sep 2018 04:57:56 +0300 Subject: resolve: Support resolving identifier macros without their own ID Invocation/expansion ID (aka `Mark`) is not really necessary for resolving a macro path. What is really necessary is its parent module, parent expansion and parent legacy scope. This is required for validation resolutions of built-in attributes, which don't get their own `Mark`s --- src/libsyntax/ext/base.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index 1ea71009766..07c3e578e5b 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -727,10 +727,9 @@ pub trait Resolver { fn find_legacy_attr_invoc(&mut self, attrs: &mut Vec, allow_derive: bool) -> Option; - fn resolve_macro_invocation(&mut self, invoc: &Invocation, scope: Mark, force: bool) + fn resolve_macro_invocation(&mut self, invoc: &Invocation, invoc_id: Mark, force: bool) -> Result>, Determinacy>; - - fn resolve_macro_path(&mut self, path: &ast::Path, kind: MacroKind, scope: Mark, + fn resolve_macro_path(&mut self, path: &ast::Path, kind: MacroKind, invoc_id: Mark, derives_in_scope: &[ast::Path], force: bool) -> Result, Determinacy>; @@ -764,11 +763,11 @@ impl Resolver for DummyResolver { fn resolve_imports(&mut self) {} fn find_legacy_attr_invoc(&mut self, _attrs: &mut Vec, _allow_derive: bool) -> Option { None } - fn resolve_macro_invocation(&mut self, _invoc: &Invocation, _scope: Mark, _force: bool) + fn resolve_macro_invocation(&mut self, _invoc: &Invocation, _invoc_id: Mark, _force: bool) -> Result>, Determinacy> { Err(Determinacy::Determined) } - fn resolve_macro_path(&mut self, _path: &ast::Path, _kind: MacroKind, _scope: Mark, + fn resolve_macro_path(&mut self, _path: &ast::Path, _kind: MacroKind, _invoc_id: Mark, _derives_in_scope: &[ast::Path], _force: bool) -> Result, Determinacy> { Err(Determinacy::Determined) -- cgit 1.4.1-3-g733a5