Skip to content

Commit 5adacdf

Browse files
authored
Rollup merge of rust-lang#115488 - Jarcho:mut_result_visitor, r=oli-obk
Take `&mut Results` in `ResultsVisitor` This fixes a small oversight from rust-lang#108293.
2 parents 257e5ec + f686bd8 commit 5adacdf

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

compiler/rustc_borrowck/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ impl<'cx, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx, R> for MirBorro
603603

604604
fn visit_statement_before_primary_effect(
605605
&mut self,
606-
_results: &R,
606+
_results: &mut R,
607607
flow_state: &Flows<'cx, 'tcx>,
608608
stmt: &'cx Statement<'tcx>,
609609
location: Location,
@@ -673,7 +673,7 @@ impl<'cx, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx, R> for MirBorro
673673

674674
fn visit_terminator_before_primary_effect(
675675
&mut self,
676-
_results: &R,
676+
_results: &mut R,
677677
flow_state: &Flows<'cx, 'tcx>,
678678
term: &'cx Terminator<'tcx>,
679679
loc: Location,
@@ -784,7 +784,7 @@ impl<'cx, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'cx, 'tcx, R> for MirBorro
784784

785785
fn visit_terminator_after_primary_effect(
786786
&mut self,
787-
_results: &R,
787+
_results: &mut R,
788788
flow_state: &Flows<'cx, 'tcx>,
789789
term: &'cx Terminator<'tcx>,
790790
loc: Location,

compiler/rustc_mir_dataflow/src/framework/graphviz.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ where
538538

539539
fn visit_block_start(
540540
&mut self,
541-
_results: &Results<'tcx, A>,
541+
_results: &mut Results<'tcx, A>,
542542
state: &Self::FlowState,
543543
_block_data: &mir::BasicBlockData<'tcx>,
544544
_block: BasicBlock,
@@ -550,7 +550,7 @@ where
550550

551551
fn visit_block_end(
552552
&mut self,
553-
_results: &Results<'tcx, A>,
553+
_results: &mut Results<'tcx, A>,
554554
state: &Self::FlowState,
555555
_block_data: &mir::BasicBlockData<'tcx>,
556556
_block: BasicBlock,
@@ -562,7 +562,7 @@ where
562562

563563
fn visit_statement_before_primary_effect(
564564
&mut self,
565-
results: &Results<'tcx, A>,
565+
results: &mut Results<'tcx, A>,
566566
state: &Self::FlowState,
567567
_statement: &mir::Statement<'tcx>,
568568
_location: Location,
@@ -575,7 +575,7 @@ where
575575

576576
fn visit_statement_after_primary_effect(
577577
&mut self,
578-
results: &Results<'tcx, A>,
578+
results: &mut Results<'tcx, A>,
579579
state: &Self::FlowState,
580580
_statement: &mir::Statement<'tcx>,
581581
_location: Location,
@@ -586,7 +586,7 @@ where
586586

587587
fn visit_terminator_before_primary_effect(
588588
&mut self,
589-
results: &Results<'tcx, A>,
589+
results: &mut Results<'tcx, A>,
590590
state: &Self::FlowState,
591591
_terminator: &mir::Terminator<'tcx>,
592592
_location: Location,
@@ -599,7 +599,7 @@ where
599599

600600
fn visit_terminator_after_primary_effect(
601601
&mut self,
602-
results: &Results<'tcx, A>,
602+
results: &mut Results<'tcx, A>,
603603
state: &Self::FlowState,
604604
_terminator: &mir::Terminator<'tcx>,
605605
_location: Location,

compiler/rustc_mir_dataflow/src/framework/visitor.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
3535

3636
fn visit_block_start(
3737
&mut self,
38-
_results: &R,
38+
_results: &mut R,
3939
_state: &Self::FlowState,
4040
_block_data: &'mir mir::BasicBlockData<'tcx>,
4141
_block: BasicBlock,
@@ -46,7 +46,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
4646
/// its `statement_effect`.
4747
fn visit_statement_before_primary_effect(
4848
&mut self,
49-
_results: &R,
49+
_results: &mut R,
5050
_state: &Self::FlowState,
5151
_statement: &'mir mir::Statement<'tcx>,
5252
_location: Location,
@@ -57,7 +57,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
5757
/// statement applied to `state`.
5858
fn visit_statement_after_primary_effect(
5959
&mut self,
60-
_results: &R,
60+
_results: &mut R,
6161
_state: &Self::FlowState,
6262
_statement: &'mir mir::Statement<'tcx>,
6363
_location: Location,
@@ -68,7 +68,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
6868
/// its `terminator_effect`.
6969
fn visit_terminator_before_primary_effect(
7070
&mut self,
71-
_results: &R,
71+
_results: &mut R,
7272
_state: &Self::FlowState,
7373
_terminator: &'mir mir::Terminator<'tcx>,
7474
_location: Location,
@@ -81,7 +81,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
8181
/// The `call_return_effect` (if one exists) will *not* be applied to `state`.
8282
fn visit_terminator_after_primary_effect(
8383
&mut self,
84-
_results: &R,
84+
_results: &mut R,
8585
_state: &Self::FlowState,
8686
_terminator: &'mir mir::Terminator<'tcx>,
8787
_location: Location,
@@ -90,7 +90,7 @@ pub trait ResultsVisitor<'mir, 'tcx, R> {
9090

9191
fn visit_block_end(
9292
&mut self,
93-
_results: &R,
93+
_results: &mut R,
9494
_state: &Self::FlowState,
9595
_block_data: &'mir mir::BasicBlockData<'tcx>,
9696
_block: BasicBlock,

compiler/rustc_mir_transform/src/dataflow_const_prop.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ impl<'mir, 'tcx>
401401

402402
fn visit_statement_before_primary_effect(
403403
&mut self,
404-
results: &Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
404+
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
405405
state: &Self::FlowState,
406406
statement: &'mir Statement<'tcx>,
407407
location: Location,
@@ -417,7 +417,7 @@ impl<'mir, 'tcx>
417417

418418
fn visit_statement_after_primary_effect(
419419
&mut self,
420-
results: &Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
420+
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
421421
state: &Self::FlowState,
422422
statement: &'mir Statement<'tcx>,
423423
location: Location,
@@ -443,7 +443,7 @@ impl<'mir, 'tcx>
443443

444444
fn visit_terminator_before_primary_effect(
445445
&mut self,
446-
results: &Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
446+
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
447447
state: &Self::FlowState,
448448
terminator: &'mir Terminator<'tcx>,
449449
location: Location,

compiler/rustc_mir_transform/src/generator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ impl<'mir, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'mir, 'tcx, R>
814814

815815
fn visit_statement_before_primary_effect(
816816
&mut self,
817-
_results: &R,
817+
_results: &mut R,
818818
state: &Self::FlowState,
819819
_statement: &'mir Statement<'tcx>,
820820
loc: Location,
@@ -824,7 +824,7 @@ impl<'mir, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'mir, 'tcx, R>
824824

825825
fn visit_terminator_before_primary_effect(
826826
&mut self,
827-
_results: &R,
827+
_results: &mut R,
828828
state: &Self::FlowState,
829829
_terminator: &'mir Terminator<'tcx>,
830830
loc: Location,

0 commit comments

Comments
 (0)