diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 05:48:48 +0000 |
commit | ef24de24a82fe681581cc130f342363c47c0969a (patch) | |
tree | 0d494f7e1a38b95c92426f58fe6eaa877303a86c /compiler/rustc_resolve/src/ident.rs | |
parent | Releasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip |
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_resolve/src/ident.rs')
-rw-r--r-- | compiler/rustc_resolve/src/ident.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 54388f80f..1a50bd5ec 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -896,7 +896,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { if !restricted_shadowing && binding.expansion != LocalExpnId::ROOT { if let NameBindingKind::Import { import, .. } = binding.kind - && matches!(import.kind, ImportKind::MacroExport) { + && matches!(import.kind, ImportKind::MacroExport) + { self.macro_expanded_macro_export_errors.insert((path_span, binding.span)); } } @@ -928,9 +929,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { if !self.is_accessible_from(import_vis, parent_scope.module) { continue; } - if let Some(ignored) = ignore_binding && - let NameBindingKind::Import { import, .. } = ignored.kind && - import == *single_import { + if let Some(ignored) = ignore_binding + && let NameBindingKind::Import { import, .. } = ignored.kind + && import == *single_import + { // Ignore not just the binding itself, but if it has a shadowed_glob, // ignore that, too, because this loop is supposed to only process // named imports. @@ -1081,7 +1083,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { for rib in ribs { match rib.kind { RibKind::Normal - | RibKind::ClosureOrAsync + | RibKind::FnOrCoroutine | RibKind::Module(..) | RibKind::MacroDefinition(..) | RibKind::ForwardGenericParamBan => { @@ -1154,7 +1156,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { for rib in ribs { let has_generic_params: HasGenericParams = match rib.kind { RibKind::Normal - | RibKind::ClosureOrAsync + | RibKind::FnOrCoroutine | RibKind::Module(..) | RibKind::MacroDefinition(..) | RibKind::InlineAsmSym @@ -1238,7 +1240,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { for rib in ribs { let has_generic_params = match rib.kind { RibKind::Normal - | RibKind::ClosureOrAsync + | RibKind::FnOrCoroutine | RibKind::Module(..) | RibKind::MacroDefinition(..) | RibKind::InlineAsmSym @@ -1440,7 +1442,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { finalize, ignore_binding, ) - } else if let Some(ribs) = ribs && let Some(TypeNS | ValueNS) = opt_ns { + } else if let Some(ribs) = ribs + && let Some(TypeNS | ValueNS) = opt_ns + { match self.resolve_ident_in_lexical_scope( ident, ns, |