Use IndexVec::from_raw
to construct a const IndexVec
.
This commit is contained in:
parent
51e1c3958d
commit
d1c55a305e
1 changed files with 2 additions and 3 deletions
|
@ -404,8 +404,7 @@ fn build_thread_local_shim<'tcx>(
|
||||||
let span = tcx.def_span(def_id);
|
let span = tcx.def_span(def_id);
|
||||||
let source_info = SourceInfo::outermost(span);
|
let source_info = SourceInfo::outermost(span);
|
||||||
|
|
||||||
let mut blocks = IndexVec::with_capacity(1);
|
let blocks = IndexVec::from_raw(vec![BasicBlockData {
|
||||||
blocks.push(BasicBlockData {
|
|
||||||
statements: vec![Statement {
|
statements: vec![Statement {
|
||||||
source_info,
|
source_info,
|
||||||
kind: StatementKind::Assign(Box::new((
|
kind: StatementKind::Assign(Box::new((
|
||||||
|
@ -415,7 +414,7 @@ fn build_thread_local_shim<'tcx>(
|
||||||
}],
|
}],
|
||||||
terminator: Some(Terminator { source_info, kind: TerminatorKind::Return }),
|
terminator: Some(Terminator { source_info, kind: TerminatorKind::Return }),
|
||||||
is_cleanup: false,
|
is_cleanup: false,
|
||||||
});
|
}]);
|
||||||
|
|
||||||
new_body(
|
new_body(
|
||||||
MirSource::from_instance(instance),
|
MirSource::from_instance(instance),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue