about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/move_paths/builder.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-09-30 15:14:07 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-10-21 10:29:40 +0000
commit8d535070a2e641889c9e51c0d093c01124bef5b0 (patch)
tree1c10f6ada20aa29656d0896833392d0ff5ee4519 /compiler/rustc_mir_dataflow/src/move_paths/builder.rs
parenta8e56d0b0bab2b6ad1151d97ebb6e246a173829f (diff)
downloadrust-8d535070a2e641889c9e51c0d093c01124bef5b0.tar.gz
rust-8d535070a2e641889c9e51c0d093c01124bef5b0.zip
Do not report errors from move path builder.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/move_paths/builder.rs')
-rw-r--r--compiler/rustc_mir_dataflow/src/move_paths/builder.rs18
1 files changed, 5 insertions, 13 deletions
diff --git a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs
index 91a96593173..c171a7ebdbe 100644
--- a/compiler/rustc_mir_dataflow/src/move_paths/builder.rs
+++ b/compiler/rustc_mir_dataflow/src/move_paths/builder.rs
@@ -18,7 +18,6 @@ struct MoveDataBuilder<'a, 'tcx> {
     tcx: TyCtxt<'tcx>,
     param_env: ty::ParamEnv<'tcx>,
     data: MoveData<'tcx>,
-    errors: Vec<(Place<'tcx>, MoveError<'tcx>)>,
 }
 
 impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
@@ -31,7 +30,6 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
             body,
             tcx,
             param_env,
-            errors: Vec::new(),
             data: MoveData {
                 moves: IndexVec::new(),
                 loc_map: LocationMap::new(body),
@@ -287,11 +285,8 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
     }
 }
 
-pub type MoveDat<'tcx> =
-    Result<MoveData<'tcx>, (MoveData<'tcx>, Vec<(Place<'tcx>, MoveError<'tcx>)>)>;
-
 impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
-    fn finalize(self) -> MoveDat<'tcx> {
+    fn finalize(self) -> MoveData<'tcx> {
         debug!("{}", {
             debug!("moves for {:?}:", self.body.span);
             for (j, mo) in self.data.moves.iter_enumerated() {
@@ -304,7 +299,7 @@ impl<'a, 'tcx> MoveDataBuilder<'a, 'tcx> {
             "done dumping moves"
         });
 
-        if self.errors.is_empty() { Ok(self.data) } else { Err((self.data, self.errors)) }
+        self.data
     }
 }
 
@@ -312,7 +307,7 @@ pub(super) fn gather_moves<'tcx>(
     body: &Body<'tcx>,
     tcx: TyCtxt<'tcx>,
     param_env: ty::ParamEnv<'tcx>,
-) -> MoveDat<'tcx> {
+) -> MoveData<'tcx> {
     let mut builder = MoveDataBuilder::new(body, tcx, param_env);
 
     builder.gather_args();
@@ -551,8 +546,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
                     self.record_move(place, path);
                     return;
                 }
-                Err(error @ MoveError::IllegalMove { .. }) => {
-                    self.builder.errors.push((base_place, error));
+                Err(MoveError::IllegalMove { .. }) => {
                     return;
                 }
             };
@@ -573,9 +567,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
         } else {
             match self.move_path_for(place) {
                 Ok(path) | Err(MoveError::UnionMove { path }) => self.record_move(place, path),
-                Err(error @ MoveError::IllegalMove { .. }) => {
-                    self.builder.errors.push((place, error));
-                }
+                Err(MoveError::IllegalMove { .. }) => {}
             };
         }
     }