Cleanup formatting.
This commit is contained in:
parent
d8722f3fe1
commit
6cb33a089f
2 changed files with 28 additions and 23 deletions
|
@ -362,9 +362,11 @@ impl<'b> Resolver<'b> {
|
||||||
|
|
||||||
// Constructs the reduced graph for one variant. Variants exist in the
|
// Constructs the reduced graph for one variant. Variants exist in the
|
||||||
// type and value namespaces.
|
// type and value namespaces.
|
||||||
fn build_reduced_graph_for_variant(
|
fn build_reduced_graph_for_variant(&mut self,
|
||||||
&mut self, variant: &Variant, parent: Module<'b>, vis: ty::Visibility, expansion: Mark,
|
variant: &Variant,
|
||||||
) {
|
parent: Module<'b>,
|
||||||
|
vis: ty::Visibility,
|
||||||
|
expansion: Mark) {
|
||||||
let name = variant.node.name.name;
|
let name = variant.node.name.name;
|
||||||
let def_id = self.definitions.local_def_id(variant.node.data.id());
|
let def_id = self.definitions.local_def_id(variant.node.data.id());
|
||||||
|
|
||||||
|
@ -381,22 +383,20 @@ impl<'b> Resolver<'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Constructs the reduced graph for one foreign item.
|
/// Constructs the reduced graph for one foreign item.
|
||||||
fn build_reduced_graph_for_foreign_item(
|
fn build_reduced_graph_for_foreign_item(&mut self, item: &ForeignItem, expansion: Mark) {
|
||||||
&mut self, foreign_item: &ForeignItem, expansion: Mark,
|
|
||||||
) {
|
|
||||||
let parent = self.current_module;
|
let parent = self.current_module;
|
||||||
let name = foreign_item.ident.name;
|
let name = item.ident.name;
|
||||||
|
|
||||||
let def = match foreign_item.node {
|
let def = match item.node {
|
||||||
ForeignItemKind::Fn(..) => {
|
ForeignItemKind::Fn(..) => {
|
||||||
Def::Fn(self.definitions.local_def_id(foreign_item.id))
|
Def::Fn(self.definitions.local_def_id(item.id))
|
||||||
}
|
}
|
||||||
ForeignItemKind::Static(_, m) => {
|
ForeignItemKind::Static(_, m) => {
|
||||||
Def::Static(self.definitions.local_def_id(foreign_item.id), m)
|
Def::Static(self.definitions.local_def_id(item.id), m)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let vis = self.resolve_visibility(&foreign_item.vis);
|
let vis = self.resolve_visibility(&item.vis);
|
||||||
self.define(parent, name, ValueNS, (def, vis, foreign_item.span, expansion));
|
self.define(parent, name, ValueNS, (def, vis, item.span, expansion));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_reduced_graph_for_block(&mut self, block: &Block) {
|
fn build_reduced_graph_for_block(&mut self, block: &Block) {
|
||||||
|
@ -415,8 +415,7 @@ impl<'b> Resolver<'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Builds the reduced graph for a single item in an external crate.
|
/// Builds the reduced graph for a single item in an external crate.
|
||||||
fn build_reduced_graph_for_external_crate_def(&mut self, parent: Module<'b>,
|
fn build_reduced_graph_for_external_crate_def(&mut self, parent: Module<'b>, child: Export) {
|
||||||
child: Export) {
|
|
||||||
let name = child.name;
|
let name = child.name;
|
||||||
let def = child.def;
|
let def = child.def;
|
||||||
let def_id = def.def_id();
|
let def_id = def.def_id();
|
||||||
|
@ -545,9 +544,11 @@ impl<'b> Resolver<'b> {
|
||||||
module.populated.set(true)
|
module.populated.set(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn legacy_import_macro(
|
fn legacy_import_macro(&mut self,
|
||||||
&mut self, name: Name, binding: &'b NameBinding<'b>, span: Span, allow_shadowing: bool,
|
name: Name,
|
||||||
) {
|
binding: &'b NameBinding<'b>,
|
||||||
|
span: Span,
|
||||||
|
allow_shadowing: bool) {
|
||||||
self.used_crates.insert(binding.def().def_id().krate);
|
self.used_crates.insert(binding.def().def_id().krate);
|
||||||
self.macro_names.insert(name);
|
self.macro_names.insert(name);
|
||||||
if self.builtin_macros.insert(name, binding).is_some() && !allow_shadowing {
|
if self.builtin_macros.insert(name, binding).is_some() && !allow_shadowing {
|
||||||
|
|
|
@ -262,9 +262,11 @@ impl<'a> base::Resolver for Resolver<'a> {
|
||||||
|
|
||||||
impl<'a> Resolver<'a> {
|
impl<'a> Resolver<'a> {
|
||||||
// Resolve the name in the module's lexical scope, excluding non-items.
|
// Resolve the name in the module's lexical scope, excluding non-items.
|
||||||
fn resolve_in_item_lexical_scope(
|
fn resolve_in_item_lexical_scope(&mut self,
|
||||||
&mut self, name: Name, ns: Namespace, record_used: Option<Span>,
|
name: Name,
|
||||||
) -> Option<&'a NameBinding<'a>> {
|
ns: Namespace,
|
||||||
|
record_used: Option<Span>)
|
||||||
|
-> Option<&'a NameBinding<'a>> {
|
||||||
let mut module = self.current_module;
|
let mut module = self.current_module;
|
||||||
let mut potential_expanded_shadower = None;
|
let mut potential_expanded_shadower = None;
|
||||||
loop {
|
loop {
|
||||||
|
@ -298,9 +300,11 @@ impl<'a> Resolver<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve_legacy_scope(
|
pub fn resolve_legacy_scope(&mut self,
|
||||||
&mut self, mut scope: LegacyScope<'a>, name: ast::Name, record_used: bool,
|
mut scope: LegacyScope<'a>,
|
||||||
) -> Option<MacroBinding<'a>> {
|
name: Name,
|
||||||
|
record_used: bool)
|
||||||
|
-> Option<MacroBinding<'a>> {
|
||||||
let mut possible_time_travel = None;
|
let mut possible_time_travel = None;
|
||||||
let mut relative_depth: u32 = 0;
|
let mut relative_depth: u32 = 0;
|
||||||
let mut binding = None;
|
let mut binding = None;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue