File tree 1 file changed +4
-7
lines changed
compiler/rustc_mir/src/transform/inline
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
1
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
2
+ use rustc_data_structures:: sso:: SsoHashSet ;
2
3
use rustc_data_structures:: stack:: ensure_sufficient_stack;
3
4
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
4
5
use rustc_middle:: mir:: TerminatorKind ;
@@ -140,7 +141,7 @@ crate fn mir_inliner_callees<'tcx>(
140
141
// Functions from other crates and MIR shims
141
142
_ => tcx. instance_mir ( instance) ,
142
143
} ;
143
- let mut calls = Vec :: new ( ) ;
144
+ let mut calls = SsoHashSet :: new ( ) ;
144
145
for bb_data in body. basic_blocks ( ) {
145
146
let terminator = bb_data. terminator ( ) ;
146
147
if let TerminatorKind :: Call { func, .. } = & terminator. kind {
@@ -149,12 +150,8 @@ crate fn mir_inliner_callees<'tcx>(
149
150
ty:: FnDef ( def_id, substs) => ( * def_id, * substs) ,
150
151
_ => continue ,
151
152
} ;
152
- // We've seen this before
153
- if calls. contains ( & call) {
154
- continue ;
155
- }
156
- calls. push ( call) ;
153
+ calls. insert ( call) ;
157
154
}
158
155
}
159
- tcx. arena . alloc_slice ( & calls)
156
+ tcx. arena . alloc_from_iter ( calls. iter ( ) . copied ( ) )
160
157
}
You can’t perform that action at this time.
0 commit comments