Navigation Menu

Skip to content

Commit

Permalink
pass vis by shared reference
Browse files Browse the repository at this point in the history
We are not mutating it now.
  • Loading branch information
nikomatsakis committed Nov 21, 2018
1 parent 2bd2fc9 commit 4c7ce7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/librustc/hir/lowering.rs
Expand Up @@ -2752,7 +2752,7 @@ impl<'a> LoweringContext<'a> {
id: NodeId,
name: &mut Name,
attrs: &hir::HirVec<Attribute>,
vis: &mut hir::Visibility,
vis: &hir::Visibility,
i: &ItemKind,
) -> hir::ItemKind {
match *i {
Expand Down Expand Up @@ -2955,7 +2955,7 @@ impl<'a> LoweringContext<'a> {
tree: &UseTree,
prefix: &Path,
id: NodeId,
vis: &mut hir::Visibility,
vis: &hir::Visibility,
name: &mut Name,
attrs: &hir::HirVec<Attribute>,
) -> hir::ItemKind {
Expand Down Expand Up @@ -3086,7 +3086,7 @@ impl<'a> LoweringContext<'a> {
hir_id: new_hir_id,
} = self.lower_node_id(id);

let mut vis = vis.clone();
let vis = vis.clone();
let mut name = name.clone();
let mut prefix = prefix.clone();

Expand All @@ -3104,7 +3104,7 @@ impl<'a> LoweringContext<'a> {
let item = this.lower_use_tree(use_tree,
&prefix,
new_id,
&mut vis,
&vis,
&mut name,
attrs);

Expand Down Expand Up @@ -3384,7 +3384,7 @@ impl<'a> LoweringContext<'a> {

pub fn lower_item(&mut self, i: &Item) -> Option<hir::Item> {
let mut name = i.ident.name;
let mut vis = self.lower_visibility(&i.vis, None);
let vis = self.lower_visibility(&i.vis, None);
let attrs = self.lower_attrs(&i.attrs);
if let ItemKind::MacroDef(ref def) = i.node {
if !def.legacy || attr::contains_name(&i.attrs, "macro_export") ||
Expand All @@ -3403,7 +3403,7 @@ impl<'a> LoweringContext<'a> {
return None;
}

let node = self.lower_item_kind(i.id, &mut name, &attrs, &mut vis, &i.node);
let node = self.lower_item_kind(i.id, &mut name, &attrs, &vis, &i.node);

let LoweredNodeId { node_id, hir_id } = self.lower_node_id(i.id);

Expand Down

0 comments on commit 4c7ce7c

Please sign in to comment.