Fix crash with -Zdump-mir-dataflow
As of #133155 `Formatter:new` uses `as_results_cursor` to create a non-mutable results reference, and then later that is accessed via `deref_mut` which results in a runtime abort. Changing to `as_results_cursor_mut` fixes it. Fixes #133641.
This commit is contained in:
parent
5e1440ae51
commit
d37ed10634
3 changed files with 5 additions and 5 deletions
|
@ -47,11 +47,11 @@ where
|
|||
{
|
||||
pub(crate) fn new(
|
||||
body: &'mir Body<'tcx>,
|
||||
results: &'mir Results<'tcx, A>,
|
||||
results: &'mir mut Results<'tcx, A>,
|
||||
style: OutputStyle,
|
||||
) -> Self {
|
||||
let reachable = mir::traversal::reachable_as_bitset(body);
|
||||
Formatter { cursor: results.as_results_cursor(body).into(), style, reachable }
|
||||
Formatter { cursor: results.as_results_cursor_mut(body).into(), style, reachable }
|
||||
}
|
||||
|
||||
fn body(&self) -> &'mir Body<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue