Skip to content

Commit ead0f0b

Browse files
committed
Fix nightly build
1 parent 1f9e51c commit ead0f0b

2 files changed

Lines changed: 27 additions & 32 deletions

File tree

src/attribute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl<'tcx> AttrParser<'tcx> {
191191
cursor.peek(),
192192
TokenTree::Token(
193193
token::Token {
194-
kind: token::TokenKind::BinOp(token::BinOpToken::Minus),
194+
kind: token::TokenKind::Minus,
195195
..
196196
},
197197
_

src/monomorphize_collector.rs

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// * `Spanned<MonoItem>` is returned in `AccessMap` instead of just `MonoItem`.
1111

1212
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
13-
use rustc_data_structures::sync::{par_for_each_in, MTLock, MTLockRef};
13+
use rustc_data_structures::sync::{par_for_each_in, MTLock};
1414
use rustc_hir as hir;
1515
use rustc_hir::def::DefKind;
1616
use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId};
@@ -119,38 +119,33 @@ pub fn collect_crate_mono_items(
119119

120120
debug!("building mono item graph, beginning at roots");
121121

122-
let mut visited = MTLock::new(FxHashSet::default());
123-
let mut usage_map = MTLock::new(UsageMap::new());
122+
let visited = MTLock::new(FxHashSet::default());
123+
let usage_map = MTLock::new(UsageMap::new());
124124
let recursion_limit = tcx.recursion_limit();
125125

126-
{
127-
let visited: MTLockRef<'_, _> = &mut visited;
128-
let usage_map: MTLockRef<'_, _> = &mut usage_map;
129-
130-
tcx.sess.time("monomorphization_collector_graph_walk", || {
131-
par_for_each_in(roots, |root| {
132-
let mut recursion_depths = DefIdMap::default();
133-
let should_gen = match root {
134-
MonoItem::Static(def_id) => {
135-
let instance = Instance::mono(tcx, def_id);
136-
should_codegen_locally(tcx, &instance)
137-
}
138-
MonoItem::Fn(instance) => should_codegen_locally(tcx, &instance),
139-
MonoItem::GlobalAsm(_) => true,
140-
};
141-
if should_gen {
142-
collect_items_rec(
143-
tcx,
144-
dummy_spanned(root),
145-
visited,
146-
&mut recursion_depths,
147-
recursion_limit,
148-
usage_map,
149-
);
126+
tcx.sess.time("monomorphization_collector_graph_walk", || {
127+
par_for_each_in(roots, |root| {
128+
let mut recursion_depths = DefIdMap::default();
129+
let should_gen = match root {
130+
MonoItem::Static(def_id) => {
131+
let instance = Instance::mono(tcx, def_id);
132+
should_codegen_locally(tcx, &instance)
150133
}
151-
});
134+
MonoItem::Fn(instance) => should_codegen_locally(tcx, &instance),
135+
MonoItem::GlobalAsm(_) => true,
136+
};
137+
if should_gen {
138+
collect_items_rec(
139+
tcx,
140+
dummy_spanned(root),
141+
&visited,
142+
&mut recursion_depths,
143+
recursion_limit,
144+
&usage_map,
145+
);
146+
}
152147
});
153-
}
148+
});
154149

155150
(visited.into_inner(), usage_map.into_inner())
156151
}
@@ -204,10 +199,10 @@ fn collect_roots(tcx: TyCtxt<'_>, mode: MonoItemCollectionMode) -> Vec<MonoItem<
204199
fn collect_items_rec<'tcx>(
205200
tcx: TyCtxt<'tcx>,
206201
starting_item: Spanned<MonoItem<'tcx>>,
207-
visited: MTLockRef<'_, FxHashSet<MonoItem<'tcx>>>,
202+
visited: &MTLock<FxHashSet<MonoItem<'tcx>>>,
208203
recursion_depths: &mut DefIdMap<usize>,
209204
recursion_limit: Limit,
210-
usage_map: MTLockRef<'_, UsageMap<'tcx>>,
205+
usage_map: &MTLock<UsageMap<'tcx>>,
211206
) {
212207
if !visited.lock_mut().insert(starting_item.node) {
213208
// We've been here already, no need to search again.

0 commit comments

Comments
 (0)