@@ -97,19 +97,6 @@ pub enum MirPhase {
9797 Runtime ( RuntimePhase ) ,
9898}
9999
100- impl MirPhase {
101- pub fn name ( & self ) -> & ' static str {
102- match * self {
103- MirPhase :: Built => "built" ,
104- MirPhase :: Analysis ( AnalysisPhase :: Initial ) => "analysis" ,
105- MirPhase :: Analysis ( AnalysisPhase :: PostCleanup ) => "analysis-post-cleanup" ,
106- MirPhase :: Runtime ( RuntimePhase :: Initial ) => "runtime" ,
107- MirPhase :: Runtime ( RuntimePhase :: PostCleanup ) => "runtime-post-cleanup" ,
108- MirPhase :: Runtime ( RuntimePhase :: Optimized ) => "runtime-optimized" ,
109- }
110- }
111- }
112-
113100/// See [`MirPhase::Analysis`].
114101#[ derive( Copy , Clone , TyEncodable , TyDecodable , Debug , PartialEq , Eq , PartialOrd , Ord ) ]
115102#[ derive( HashStable ) ]
@@ -206,43 +193,6 @@ pub enum RawPtrKind {
206193 FakeForPtrMetadata ,
207194}
208195
209- impl From < Mutability > for RawPtrKind {
210- fn from ( other : Mutability ) -> Self {
211- match other {
212- Mutability :: Mut => RawPtrKind :: Mut ,
213- Mutability :: Not => RawPtrKind :: Const ,
214- }
215- }
216- }
217-
218- impl RawPtrKind {
219- pub fn is_fake ( self ) -> bool {
220- match self {
221- RawPtrKind :: Mut | RawPtrKind :: Const => false ,
222- RawPtrKind :: FakeForPtrMetadata => true ,
223- }
224- }
225-
226- pub fn to_mutbl_lossy ( self ) -> Mutability {
227- match self {
228- RawPtrKind :: Mut => Mutability :: Mut ,
229- RawPtrKind :: Const => Mutability :: Not ,
230-
231- // We have no type corresponding to a fake borrow, so use
232- // `*const` as an approximation.
233- RawPtrKind :: FakeForPtrMetadata => Mutability :: Not ,
234- }
235- }
236-
237- pub fn ptr_str ( self ) -> & ' static str {
238- match self {
239- RawPtrKind :: Mut => "mut" ,
240- RawPtrKind :: Const => "const" ,
241- RawPtrKind :: FakeForPtrMetadata => "const (fake)" ,
242- }
243- }
244- }
245-
246196#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , TyEncodable , TyDecodable ) ]
247197#[ derive( Hash , HashStable ) ]
248198pub enum MutBorrowKind {
@@ -515,29 +465,6 @@ pub enum StatementKind<'tcx> {
515465 } ,
516466}
517467
518- impl StatementKind < ' _ > {
519- /// Returns a simple string representation of a `StatementKind` variant, independent of any
520- /// values it might hold (e.g. `StatementKind::Assign` always returns `"Assign"`).
521- pub const fn name ( & self ) -> & ' static str {
522- match self {
523- StatementKind :: Assign ( ..) => "Assign" ,
524- StatementKind :: FakeRead ( ..) => "FakeRead" ,
525- StatementKind :: SetDiscriminant { .. } => "SetDiscriminant" ,
526- StatementKind :: Deinit ( ..) => "Deinit" ,
527- StatementKind :: StorageLive ( ..) => "StorageLive" ,
528- StatementKind :: StorageDead ( ..) => "StorageDead" ,
529- StatementKind :: Retag ( ..) => "Retag" ,
530- StatementKind :: PlaceMention ( ..) => "PlaceMention" ,
531- StatementKind :: AscribeUserType ( ..) => "AscribeUserType" ,
532- StatementKind :: Coverage ( ..) => "Coverage" ,
533- StatementKind :: Intrinsic ( ..) => "Intrinsic" ,
534- StatementKind :: ConstEvalCounter => "ConstEvalCounter" ,
535- StatementKind :: Nop => "Nop" ,
536- StatementKind :: BackwardIncompatibleDropHint { .. } => "BackwardIncompatibleDropHint" ,
537- }
538- }
539- }
540-
541468#[ derive(
542469 Clone ,
543470 TyEncodable ,
@@ -673,12 +600,6 @@ pub enum CallSource {
673600 Normal ,
674601}
675602
676- impl CallSource {
677- pub fn from_hir_call ( self ) -> bool {
678- matches ! ( self , CallSource :: Normal )
679- }
680- }
681-
682603#[ derive( Clone , Copy , Debug , TyEncodable , TyDecodable , Hash , HashStable , PartialEq ) ]
683604#[ derive( TypeFoldable , TypeVisitable ) ]
684605/// The macro that an inline assembly block was created by
@@ -689,15 +610,6 @@ pub enum InlineAsmMacro {
689610 NakedAsm ,
690611}
691612
692- impl InlineAsmMacro {
693- pub const fn diverges ( self , options : InlineAsmOptions ) -> bool {
694- match self {
695- InlineAsmMacro :: Asm => options. contains ( InlineAsmOptions :: NORETURN ) ,
696- InlineAsmMacro :: NakedAsm => true ,
697- }
698- }
699- }
700-
701613///////////////////////////////////////////////////////////////////////////
702614// Terminators
703615
@@ -999,30 +911,6 @@ pub enum BackwardIncompatibleDropReason {
999911 Edition2024 ,
1000912}
1001913
1002- impl TerminatorKind < ' _ > {
1003- /// Returns a simple string representation of a `TerminatorKind` variant, independent of any
1004- /// values it might hold (e.g. `TerminatorKind::Call` always returns `"Call"`).
1005- pub const fn name ( & self ) -> & ' static str {
1006- match self {
1007- TerminatorKind :: Goto { .. } => "Goto" ,
1008- TerminatorKind :: SwitchInt { .. } => "SwitchInt" ,
1009- TerminatorKind :: UnwindResume => "UnwindResume" ,
1010- TerminatorKind :: UnwindTerminate ( _) => "UnwindTerminate" ,
1011- TerminatorKind :: Return => "Return" ,
1012- TerminatorKind :: Unreachable => "Unreachable" ,
1013- TerminatorKind :: Drop { .. } => "Drop" ,
1014- TerminatorKind :: Call { .. } => "Call" ,
1015- TerminatorKind :: TailCall { .. } => "TailCall" ,
1016- TerminatorKind :: Assert { .. } => "Assert" ,
1017- TerminatorKind :: Yield { .. } => "Yield" ,
1018- TerminatorKind :: CoroutineDrop => "CoroutineDrop" ,
1019- TerminatorKind :: FalseEdge { .. } => "FalseEdge" ,
1020- TerminatorKind :: FalseUnwind { .. } => "FalseUnwind" ,
1021- TerminatorKind :: InlineAsm { .. } => "InlineAsm" ,
1022- }
1023- }
1024- }
1025-
1026914#[ derive( Debug , Clone , TyEncodable , TyDecodable , Hash , HashStable , PartialEq ) ]
1027915pub struct SwitchTargets {
1028916 /// Possible values. For each value, the location to branch to is found in
0 commit comments