We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
IndexVec::from_raw
IndexVec
1 parent 51e1c39 commit d1c55a3Copy full SHA for d1c55a3
compiler/rustc_mir_transform/src/shim.rs
@@ -404,8 +404,7 @@ fn build_thread_local_shim<'tcx>(
404
let span = tcx.def_span(def_id);
405
let source_info = SourceInfo::outermost(span);
406
407
- let mut blocks = IndexVec::with_capacity(1);
408
- blocks.push(BasicBlockData {
+ let blocks = IndexVec::from_raw(vec![BasicBlockData {
409
statements: vec![Statement {
410
source_info,
411
kind: StatementKind::Assign(Box::new((
@@ -415,7 +414,7 @@ fn build_thread_local_shim<'tcx>(
415
414
}],
416
terminator: Some(Terminator { source_info, kind: TerminatorKind::Return }),
417
is_cleanup: false,
418
- });
+ }]);
419
420
new_body(
421
MirSource::from_instance(instance),
0 commit comments