Skip to content

Commit 4c7ce7c

Browse files
committed
pass vis by shared reference
We are not mutating it now.
1 parent 2bd2fc9 commit 4c7ce7c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/librustc/hir/lowering.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2752,7 +2752,7 @@ impl<'a> LoweringContext<'a> {
27522752
id: NodeId,
27532753
name: &mut Name,
27542754
attrs: &hir::HirVec<Attribute>,
2755-
vis: &mut hir::Visibility,
2755+
vis: &hir::Visibility,
27562756
i: &ItemKind,
27572757
) -> hir::ItemKind {
27582758
match *i {
@@ -2955,7 +2955,7 @@ impl<'a> LoweringContext<'a> {
29552955
tree: &UseTree,
29562956
prefix: &Path,
29572957
id: NodeId,
2958-
vis: &mut hir::Visibility,
2958+
vis: &hir::Visibility,
29592959
name: &mut Name,
29602960
attrs: &hir::HirVec<Attribute>,
29612961
) -> hir::ItemKind {
@@ -3086,7 +3086,7 @@ impl<'a> LoweringContext<'a> {
30863086
hir_id: new_hir_id,
30873087
} = self.lower_node_id(id);
30883088

3089-
let mut vis = vis.clone();
3089+
let vis = vis.clone();
30903090
let mut name = name.clone();
30913091
let mut prefix = prefix.clone();
30923092

@@ -3104,7 +3104,7 @@ impl<'a> LoweringContext<'a> {
31043104
let item = this.lower_use_tree(use_tree,
31053105
&prefix,
31063106
new_id,
3107-
&mut vis,
3107+
&vis,
31083108
&mut name,
31093109
attrs);
31103110

@@ -3384,7 +3384,7 @@ impl<'a> LoweringContext<'a> {
33843384

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

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

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

0 commit comments

Comments
 (0)