about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/move_paths/mod.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-09-30 20:23:34 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-10-21 10:30:58 +0000
commit4bedd7de6e96a008121c54f34baece868b70b083 (patch)
tree7347c7e8947d50bbc9f3bd0dc9aa9858421194be /compiler/rustc_mir_dataflow/src/move_paths/mod.rs
parent90e6d2995581b9f03be52ed7fa92fa6a5b981294 (diff)
downloadrust-4bedd7de6e96a008121c54f34baece868b70b083.tar.gz
rust-4bedd7de6e96a008121c54f34baece868b70b083.zip
Stop computing error info in move path builder.
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/move_paths/mod.rs')
-rw-r--r--compiler/rustc_mir_dataflow/src/move_paths/mod.rs41
1 files changed, 1 insertions, 40 deletions
diff --git a/compiler/rustc_mir_dataflow/src/move_paths/mod.rs b/compiler/rustc_mir_dataflow/src/move_paths/mod.rs
index fff7d12ec48..1ab850a5eb8 100644
--- a/compiler/rustc_mir_dataflow/src/move_paths/mod.rs
+++ b/compiler/rustc_mir_dataflow/src/move_paths/mod.rs
@@ -2,7 +2,7 @@ use crate::un_derefer::UnDerefer;
 use rustc_data_structures::fx::FxHashMap;
 use rustc_index::{IndexSlice, IndexVec};
 use rustc_middle::mir::*;
-use rustc_middle::ty::{ParamEnv, Ty, TyCtxt};
+use rustc_middle::ty::{ParamEnv, TyCtxt};
 use rustc_span::Span;
 use smallvec::SmallVec;
 
@@ -346,45 +346,6 @@ impl<'tcx> MovePathLookup<'tcx> {
     }
 }
 
-#[derive(Debug)]
-pub struct IllegalMoveOrigin<'tcx> {
-    pub location: Location,
-    pub kind: IllegalMoveOriginKind<'tcx>,
-}
-
-#[derive(Debug)]
-pub enum IllegalMoveOriginKind<'tcx> {
-    /// Illegal move due to attempt to move from behind a reference.
-    BorrowedContent {
-        /// The place the reference refers to: if erroneous code was trying to
-        /// move from `(*x).f` this will be `*x`.
-        target_place: Place<'tcx>,
-    },
-
-    /// Illegal move due to attempt to move from field of an ADT that
-    /// implements `Drop`. Rust maintains invariant that all `Drop`
-    /// ADT's remain fully-initialized so that user-defined destructor
-    /// can safely read from all of the ADT's fields.
-    InteriorOfTypeWithDestructor { container_ty: Ty<'tcx> },
-
-    /// Illegal move due to attempt to move out of a slice or array.
-    InteriorOfSliceOrArray { ty: Ty<'tcx>, is_index: bool },
-}
-
-#[derive(Debug)]
-pub enum MoveError<'tcx> {
-    IllegalMove { cannot_move_out_of: IllegalMoveOrigin<'tcx> },
-    UnionMove { path: MovePathIndex },
-    UntrackedLocal,
-}
-
-impl<'tcx> MoveError<'tcx> {
-    pub fn cannot_move_out_of(location: Location, kind: IllegalMoveOriginKind<'tcx>) -> Self {
-        let origin = IllegalMoveOrigin { location, kind };
-        MoveError::IllegalMove { cannot_move_out_of: origin }
-    }
-}
-
 impl<'tcx> MoveData<'tcx> {
     pub fn gather_moves(
         body: &Body<'tcx>,