33use  libc:: c_uint; 
44use  rustc_span:: InnerSpan ; 
55
6- pub  use  self :: Diagnostic :: * ; 
7- pub  use  self :: OptimizationDiagnosticKind :: * ; 
6+ pub ( crate )  use  self :: Diagnostic :: * ; 
7+ pub ( crate )  use  self :: OptimizationDiagnosticKind :: * ; 
88use  super :: { DiagnosticInfo ,  SMDiagnostic } ; 
99use  crate :: value:: Value ; 
1010
1111#[ derive( Copy ,  Clone ,  Debug ) ]  
12- pub  enum  OptimizationDiagnosticKind  { 
12+ pub ( crate )  enum  OptimizationDiagnosticKind  { 
1313    OptimizationRemark , 
1414    OptimizationMissed , 
1515    OptimizationAnalysis , 
@@ -19,9 +19,10 @@ pub enum OptimizationDiagnosticKind {
1919    OptimizationRemarkOther , 
2020} 
2121
22- pub  struct  OptimizationDiagnostic < ' ll >  { 
22+ pub ( crate )  struct  OptimizationDiagnostic < ' ll >  { 
2323    pub  kind :  OptimizationDiagnosticKind , 
2424    pub  pass_name :  String , 
25+     #[ expect( dead_code) ]  
2526    pub  function :  & ' ll  Value , 
2627    pub  line :  c_uint , 
2728    pub  column :  c_uint , 
@@ -73,14 +74,14 @@ impl<'ll> OptimizationDiagnostic<'ll> {
7374    } 
7475} 
7576
76- pub  struct  SrcMgrDiagnostic  { 
77+ pub ( crate )  struct  SrcMgrDiagnostic  { 
7778    pub  level :  super :: DiagnosticLevel , 
7879    pub  message :  String , 
7980    pub  source :  Option < ( String ,  Vec < InnerSpan > ) > , 
8081} 
8182
8283impl  SrcMgrDiagnostic  { 
83-     pub  unsafe  fn  unpack ( diag :  & SMDiagnostic )  -> SrcMgrDiagnostic  { 
84+     pub ( crate )  unsafe  fn  unpack ( diag :  & SMDiagnostic )  -> SrcMgrDiagnostic  { 
8485        // Recover the post-substitution assembly code from LLVM for better 
8586        // diagnostics. 
8687        let  mut  have_source = false ; 
@@ -120,7 +121,7 @@ impl SrcMgrDiagnostic {
120121} 
121122
122123#[ derive( Clone ) ]  
123- pub  struct  InlineAsmDiagnostic  { 
124+ pub ( crate )  struct  InlineAsmDiagnostic  { 
124125    pub  level :  super :: DiagnosticLevel , 
125126    pub  cookie :  u64 , 
126127    pub  message :  String , 
@@ -158,19 +159,20 @@ impl InlineAsmDiagnostic {
158159    } 
159160} 
160161
161- pub  enum  Diagnostic < ' ll >  { 
162+ pub ( crate )  enum  Diagnostic < ' ll >  { 
162163    Optimization ( OptimizationDiagnostic < ' ll > ) , 
163164    InlineAsm ( InlineAsmDiagnostic ) , 
164165    PGO ( & ' ll  DiagnosticInfo ) , 
165166    Linker ( & ' ll  DiagnosticInfo ) , 
166167    Unsupported ( & ' ll  DiagnosticInfo ) , 
167168
168169    /// LLVM has other types that we do not wrap here. 
170+ #[ expect( dead_code) ]  
169171    UnknownDiagnostic ( & ' ll  DiagnosticInfo ) , 
170172} 
171173
172174impl < ' ll >  Diagnostic < ' ll >  { 
173-     pub  unsafe  fn  unpack ( di :  & ' ll  DiagnosticInfo )  -> Self  { 
175+     pub ( crate )  unsafe  fn  unpack ( di :  & ' ll  DiagnosticInfo )  -> Self  { 
174176        use  super :: DiagnosticKind  as  Dk ; 
175177
176178        unsafe  { 
0 commit comments