mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 09:13:07 +03:00
Simplify Resolver::resolve_macro_path.
There are only two call sites, and three of the arguments are identical at both call sites. This commit removes those arguments and renames the method accordingly.
This commit is contained in:
@@ -458,14 +458,11 @@ struct Flags: u8 {
|
||||
let mut result = Err(Determinacy::Determined);
|
||||
for derive in parent_scope.derives {
|
||||
let parent_scope = &ParentScope { derives: &[], ..*parent_scope };
|
||||
match this.reborrow().resolve_macro_path(
|
||||
match this.reborrow().resolve_derive_macro_path(
|
||||
derive,
|
||||
MacroKind::Derive,
|
||||
parent_scope,
|
||||
true,
|
||||
force,
|
||||
ignore_import,
|
||||
None,
|
||||
) {
|
||||
Ok((Some(ext), _)) => {
|
||||
if ext.helper_attrs.contains(&ident.name) {
|
||||
|
||||
@@ -395,14 +395,11 @@ fn resolve_derives(
|
||||
for (i, resolution) in entry.resolutions.iter_mut().enumerate() {
|
||||
if resolution.exts.is_none() {
|
||||
resolution.exts = Some(
|
||||
match self.cm().resolve_macro_path(
|
||||
match self.cm().resolve_derive_macro_path(
|
||||
&resolution.path,
|
||||
MacroKind::Derive,
|
||||
&parent_scope,
|
||||
true,
|
||||
force,
|
||||
None,
|
||||
None,
|
||||
) {
|
||||
Ok((Some(ext), _)) => {
|
||||
if !ext.helper_attrs.is_empty() {
|
||||
@@ -706,26 +703,23 @@ fn smart_resolve_macro_path(
|
||||
Ok((ext, res))
|
||||
}
|
||||
|
||||
pub(crate) fn resolve_macro_path<'r>(
|
||||
pub(crate) fn resolve_derive_macro_path<'r>(
|
||||
self: CmResolver<'r, 'ra, 'tcx>,
|
||||
path: &ast::Path,
|
||||
kind: MacroKind,
|
||||
parent_scope: &ParentScope<'ra>,
|
||||
trace: bool,
|
||||
force: bool,
|
||||
ignore_import: Option<Import<'ra>>,
|
||||
suggestion_span: Option<Span>,
|
||||
) -> Result<(Option<Arc<SyntaxExtension>>, Res), Determinacy> {
|
||||
self.resolve_macro_or_delegation_path(
|
||||
path,
|
||||
kind,
|
||||
MacroKind::Derive,
|
||||
parent_scope,
|
||||
trace,
|
||||
true,
|
||||
force,
|
||||
None,
|
||||
None,
|
||||
ignore_import,
|
||||
suggestion_span,
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user