@@ -3,7 +3,6 @@ use std::{fmt, iter, mem};
3
3
use rustc_abi:: { FIRST_VARIANT , FieldIdx , VariantIdx } ;
4
4
use rustc_hir:: lang_items:: LangItem ;
5
5
use rustc_index:: Idx ;
6
- use rustc_middle:: mir:: patch:: MirPatch ;
7
6
use rustc_middle:: mir:: * ;
8
7
use rustc_middle:: span_bug;
9
8
use rustc_middle:: ty:: adjustment:: PointerCoercion ;
@@ -13,29 +12,11 @@ use rustc_span::DUMMY_SP;
13
12
use rustc_span:: source_map:: Spanned ;
14
13
use tracing:: { debug, instrument} ;
15
14
16
- /// The value of an inserted drop flag.
17
- #[ derive( Debug , PartialEq , Eq , Copy , Clone ) ]
18
- pub enum DropFlagState {
19
- /// The tracked value is initialized and needs to be dropped when leaving its scope.
20
- Present ,
21
-
22
- /// The tracked value is uninitialized or was moved out of and does not need to be dropped when
23
- /// leaving its scope.
24
- Absent ,
25
- }
26
-
27
- impl DropFlagState {
28
- pub fn value ( self ) -> bool {
29
- match self {
30
- DropFlagState :: Present => true ,
31
- DropFlagState :: Absent => false ,
32
- }
33
- }
34
- }
15
+ use crate :: patch:: MirPatch ;
35
16
36
17
/// Describes how/if a value should be dropped.
37
18
#[ derive( Debug ) ]
38
- pub enum DropStyle {
19
+ pub ( crate ) enum DropStyle {
39
20
/// The value is already dead at the drop location, no drop will be executed.
40
21
Dead ,
41
22
@@ -56,7 +37,7 @@ pub enum DropStyle {
56
37
57
38
/// Which drop flags to affect/check with an operation.
58
39
#[ derive( Debug ) ]
59
- pub enum DropFlagMode {
40
+ pub ( crate ) enum DropFlagMode {
60
41
/// Only affect the top-level drop flag, not that of any contained fields.
61
42
Shallow ,
62
43
/// Affect all nested drop flags in addition to the top-level one.
@@ -65,7 +46,7 @@ pub enum DropFlagMode {
65
46
66
47
/// Describes if unwinding is necessary and where to unwind to if a panic occurs.
67
48
#[ derive( Copy , Clone , Debug ) ]
68
- pub enum Unwind {
49
+ pub ( crate ) enum Unwind {
69
50
/// Unwind to this block.
70
51
To ( BasicBlock ) ,
71
52
/// Already in an unwind path, any panic will cause an abort.
@@ -98,7 +79,7 @@ impl Unwind {
98
79
}
99
80
}
100
81
101
- pub trait DropElaborator < ' a , ' tcx > : fmt:: Debug {
82
+ pub ( crate ) trait DropElaborator < ' a , ' tcx > : fmt:: Debug {
102
83
/// The type representing paths that can be moved out of.
103
84
///
104
85
/// Users can move out of individual fields of a struct, such as `a.b.c`. This type is used to
@@ -177,7 +158,7 @@ where
177
158
/// value.
178
159
///
179
160
/// When this returns, the MIR patch in the `elaborator` contains the necessary changes.
180
- pub fn elaborate_drop < ' b , ' tcx , D > (
161
+ pub ( crate ) fn elaborate_drop < ' b , ' tcx , D > (
181
162
elaborator : & mut D ,
182
163
source_info : SourceInfo ,
183
164
place : Place < ' tcx > ,
0 commit comments