Skip to content

Commit 6cb33a0

Browse files
committed
Cleanup formatting.
1 parent d8722f3 commit 6cb33a0

File tree

2 files changed

+28
-23
lines changed

2 files changed

+28
-23
lines changed

src/librustc_resolve/build_reduced_graph.rs

+18-17
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,11 @@ impl<'b> Resolver<'b> {
362362

363363
// Constructs the reduced graph for one variant. Variants exist in the
364364
// type and value namespaces.
365-
fn build_reduced_graph_for_variant(
366-
&mut self, variant: &Variant, parent: Module<'b>, vis: ty::Visibility, expansion: Mark,
367-
) {
365+
fn build_reduced_graph_for_variant(&mut self,
366+
variant: &Variant,
367+
parent: Module<'b>,
368+
vis: ty::Visibility,
369+
expansion: Mark) {
368370
let name = variant.node.name.name;
369371
let def_id = self.definitions.local_def_id(variant.node.data.id());
370372

@@ -381,22 +383,20 @@ impl<'b> Resolver<'b> {
381383
}
382384

383385
/// Constructs the reduced graph for one foreign item.
384-
fn build_reduced_graph_for_foreign_item(
385-
&mut self, foreign_item: &ForeignItem, expansion: Mark,
386-
) {
386+
fn build_reduced_graph_for_foreign_item(&mut self, item: &ForeignItem, expansion: Mark) {
387387
let parent = self.current_module;
388-
let name = foreign_item.ident.name;
388+
let name = item.ident.name;
389389

390-
let def = match foreign_item.node {
390+
let def = match item.node {
391391
ForeignItemKind::Fn(..) => {
392-
Def::Fn(self.definitions.local_def_id(foreign_item.id))
392+
Def::Fn(self.definitions.local_def_id(item.id))
393393
}
394394
ForeignItemKind::Static(_, m) => {
395-
Def::Static(self.definitions.local_def_id(foreign_item.id), m)
395+
Def::Static(self.definitions.local_def_id(item.id), m)
396396
}
397397
};
398-
let vis = self.resolve_visibility(&foreign_item.vis);
399-
self.define(parent, name, ValueNS, (def, vis, foreign_item.span, expansion));
398+
let vis = self.resolve_visibility(&item.vis);
399+
self.define(parent, name, ValueNS, (def, vis, item.span, expansion));
400400
}
401401

402402
fn build_reduced_graph_for_block(&mut self, block: &Block) {
@@ -415,8 +415,7 @@ impl<'b> Resolver<'b> {
415415
}
416416

417417
/// Builds the reduced graph for a single item in an external crate.
418-
fn build_reduced_graph_for_external_crate_def(&mut self, parent: Module<'b>,
419-
child: Export) {
418+
fn build_reduced_graph_for_external_crate_def(&mut self, parent: Module<'b>, child: Export) {
420419
let name = child.name;
421420
let def = child.def;
422421
let def_id = def.def_id();
@@ -545,9 +544,11 @@ impl<'b> Resolver<'b> {
545544
module.populated.set(true)
546545
}
547546

548-
fn legacy_import_macro(
549-
&mut self, name: Name, binding: &'b NameBinding<'b>, span: Span, allow_shadowing: bool,
550-
) {
547+
fn legacy_import_macro(&mut self,
548+
name: Name,
549+
binding: &'b NameBinding<'b>,
550+
span: Span,
551+
allow_shadowing: bool) {
551552
self.used_crates.insert(binding.def().def_id().krate);
552553
self.macro_names.insert(name);
553554
if self.builtin_macros.insert(name, binding).is_some() && !allow_shadowing {

src/librustc_resolve/macros.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,11 @@ impl<'a> base::Resolver for Resolver<'a> {
262262

263263
impl<'a> Resolver<'a> {
264264
// Resolve the name in the module's lexical scope, excluding non-items.
265-
fn resolve_in_item_lexical_scope(
266-
&mut self, name: Name, ns: Namespace, record_used: Option<Span>,
267-
) -> Option<&'a NameBinding<'a>> {
265+
fn resolve_in_item_lexical_scope(&mut self,
266+
name: Name,
267+
ns: Namespace,
268+
record_used: Option<Span>)
269+
-> Option<&'a NameBinding<'a>> {
268270
let mut module = self.current_module;
269271
let mut potential_expanded_shadower = None;
270272
loop {
@@ -298,9 +300,11 @@ impl<'a> Resolver<'a> {
298300
}
299301
}
300302

301-
pub fn resolve_legacy_scope(
302-
&mut self, mut scope: LegacyScope<'a>, name: ast::Name, record_used: bool,
303-
) -> Option<MacroBinding<'a>> {
303+
pub fn resolve_legacy_scope(&mut self,
304+
mut scope: LegacyScope<'a>,
305+
name: Name,
306+
record_used: bool)
307+
-> Option<MacroBinding<'a>> {
304308
let mut possible_time_travel = None;
305309
let mut relative_depth: u32 = 0;
306310
let mut binding = None;

0 commit comments

Comments
 (0)