Skip to content

Commit

Permalink
Fix tidy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 10, 2017
1 parent e2f781c commit 9d51d6b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/librustc_resolve/build_reduced_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,10 @@ impl<'a> Resolver<'a> {
fn build_reduced_graph_for_block(&mut self, block: &Block) {
let parent = self.current_module;
if self.block_needs_anonymous_module(block) {
let module =
self.new_module(parent, ModuleKind::Block(block.id), parent.normal_ancestor_id, block.span);
let module = self.new_module(parent,
ModuleKind::Block(block.id),
parent.normal_ancestor_id,
block.span);
self.block_map.insert(block.id, module);
self.current_module = module; // Descend into the block.
}
Expand Down
14 changes: 11 additions & 3 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,10 @@ pub struct ModuleData<'a> {
pub type Module<'a> = &'a ModuleData<'a>;

impl<'a> ModuleData<'a> {
fn new(parent: Option<Module<'a>>, kind: ModuleKind, normal_ancestor_id: DefId, span: Span) -> Self {
fn new(parent: Option<Module<'a>>,
kind: ModuleKind,
normal_ancestor_id: DefId,
span: Span) -> Self {
ModuleData {
parent: parent,
kind: kind,
Expand Down Expand Up @@ -1434,8 +1437,13 @@ impl<'a> Resolver<'a> {
self.crate_loader.postprocess(krate);
}

fn new_module(&self, parent: Module<'a>, kind: ModuleKind, normal_ancestor_id: DefId, span: Span)
-> Module<'a> {
fn new_module(
&self,
parent: Module<'a>,
kind: ModuleKind,
normal_ancestor_id: DefId,
span: Span,
) -> Module<'a> {
self.arenas.alloc_module(ModuleData::new(Some(parent), kind, normal_ancestor_id, span))
}

Expand Down

0 comments on commit 9d51d6b

Please sign in to comment.