Skip to content

Commit 258a446

Browse files
committed
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.
1 parent 055d0d6 commit 258a446

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

compiler/rustc_resolve/src/ident.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,14 +458,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
458458
let mut result = Err(Determinacy::Determined);
459459
for derive in parent_scope.derives {
460460
let parent_scope = &ParentScope { derives: &[], ..*parent_scope };
461-
match this.reborrow().resolve_macro_path(
461+
match this.reborrow().resolve_derive_macro_path(
462462
derive,
463-
MacroKind::Derive,
464463
parent_scope,
465-
true,
466464
force,
467465
ignore_import,
468-
None,
469466
) {
470467
Ok((Some(ext), _)) => {
471468
if ext.helper_attrs.contains(&ident.name) {

compiler/rustc_resolve/src/macros.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,11 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
395395
for (i, resolution) in entry.resolutions.iter_mut().enumerate() {
396396
if resolution.exts.is_none() {
397397
resolution.exts = Some(
398-
match self.cm().resolve_macro_path(
398+
match self.cm().resolve_derive_macro_path(
399399
&resolution.path,
400-
MacroKind::Derive,
401400
&parent_scope,
402-
true,
403401
force,
404402
None,
405-
None,
406403
) {
407404
Ok((Some(ext), _)) => {
408405
if !ext.helper_attrs.is_empty() {
@@ -706,26 +703,23 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
706703
Ok((ext, res))
707704
}
708705

709-
pub(crate) fn resolve_macro_path<'r>(
706+
pub(crate) fn resolve_derive_macro_path<'r>(
710707
self: CmResolver<'r, 'ra, 'tcx>,
711708
path: &ast::Path,
712-
kind: MacroKind,
713709
parent_scope: &ParentScope<'ra>,
714-
trace: bool,
715710
force: bool,
716711
ignore_import: Option<Import<'ra>>,
717-
suggestion_span: Option<Span>,
718712
) -> Result<(Option<Arc<SyntaxExtension>>, Res), Determinacy> {
719713
self.resolve_macro_or_delegation_path(
720714
path,
721-
kind,
715+
MacroKind::Derive,
722716
parent_scope,
723-
trace,
717+
true,
724718
force,
725719
None,
726720
None,
727721
ignore_import,
728-
suggestion_span,
722+
None,
729723
)
730724
}
731725

0 commit comments

Comments
 (0)