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:
@@ -281,10 +281,10 @@ pub trait Analysis<'tcx> {
|
||||
);
|
||||
}
|
||||
|
||||
let results = Results { analysis: self, entry_sets };
|
||||
let mut results = Results { analysis: self, entry_sets };
|
||||
|
||||
if tcx.sess.opts.unstable_opts.dump_mir_dataflow {
|
||||
let res = write_graphviz_results(tcx, body, &results, pass_name);
|
||||
let res = write_graphviz_results(tcx, body, &mut results, pass_name);
|
||||
if let Err(e) = res {
|
||||
error!("Failed to write graphviz dataflow results: {}", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user