@@ -11,7 +11,7 @@ use crate::ty::Ty;
1111#[ derive( Diagnostic ) ]
1212#[ diag( middle_drop_check_overflow, code = E0320 ) ]
1313#[ note]
14- pub struct DropCheckOverflow < ' tcx > {
14+ pub ( crate ) struct DropCheckOverflow < ' tcx > {
1515 #[ primary_span]
1616 pub span : Span ,
1717 pub ty : Ty < ' tcx > ,
@@ -20,14 +20,14 @@ pub struct DropCheckOverflow<'tcx> {
2020
2121#[ derive( Diagnostic ) ]
2222#[ diag( middle_failed_writing_file) ]
23- pub struct FailedWritingFile < ' a > {
23+ pub ( crate ) struct FailedWritingFile < ' a > {
2424 pub path : & ' a Path ,
2525 pub error : io:: Error ,
2626}
2727
2828#[ derive( Diagnostic ) ]
2929#[ diag( middle_opaque_hidden_type_mismatch) ]
30- pub struct OpaqueHiddenTypeMismatch < ' tcx > {
30+ pub ( crate ) struct OpaqueHiddenTypeMismatch < ' tcx > {
3131 pub self_ty : Ty < ' tcx > ,
3232 pub other_ty : Ty < ' tcx > ,
3333 #[ primary_span]
@@ -37,20 +37,6 @@ pub struct OpaqueHiddenTypeMismatch<'tcx> {
3737 pub sub : TypeMismatchReason ,
3838}
3939
40- #[ derive( Diagnostic ) ]
41- #[ diag( middle_unsupported_union) ]
42- pub struct UnsupportedUnion {
43- pub ty_name : String ,
44- }
45-
46- #[ derive( Diagnostic ) ]
47- #[ diag( middle_autodiff_unsafe_inner_const_ref) ]
48- pub struct AutodiffUnsafeInnerConstRef {
49- #[ primary_span]
50- pub span : Span ,
51- pub ty : String ,
52- }
53-
5440#[ derive( Subdiagnostic ) ]
5541pub enum TypeMismatchReason {
5642 #[ label( middle_conflict_types) ]
@@ -67,7 +53,7 @@ pub enum TypeMismatchReason {
6753
6854#[ derive( Diagnostic ) ]
6955#[ diag( middle_limit_invalid) ]
70- pub struct LimitInvalid < ' a > {
56+ pub ( crate ) struct LimitInvalid < ' a > {
7157 #[ primary_span]
7258 pub span : Span ,
7359 #[ label]
@@ -78,14 +64,14 @@ pub struct LimitInvalid<'a> {
7864#[ derive( Diagnostic ) ]
7965#[ diag( middle_recursion_limit_reached) ]
8066#[ help]
81- pub struct RecursionLimitReached < ' tcx > {
67+ pub ( crate ) struct RecursionLimitReached < ' tcx > {
8268 pub ty : Ty < ' tcx > ,
8369 pub suggested_limit : rustc_session:: Limit ,
8470}
8571
8672#[ derive( Diagnostic ) ]
8773#[ diag( middle_const_eval_non_int) ]
88- pub struct ConstEvalNonIntError {
74+ pub ( crate ) struct ConstEvalNonIntError {
8975 #[ primary_span]
9076 pub span : Span ,
9177}
@@ -159,27 +145,17 @@ pub enum LayoutError<'tcx> {
159145 ReferencesError ,
160146}
161147
162- #[ derive( Diagnostic ) ]
163- #[ diag( middle_adjust_for_foreign_abi_error) ]
164- pub struct UnsupportedFnAbi {
165- pub arch : Symbol ,
166- pub abi : & ' static str ,
167- }
168-
169148#[ derive( Diagnostic ) ]
170149#[ diag( middle_erroneous_constant) ]
171- pub struct ErroneousConstant {
150+ pub ( crate ) struct ErroneousConstant {
172151 #[ primary_span]
173152 pub span : Span ,
174153}
175154
176- /// Used by `rustc_const_eval`
177- pub use crate :: fluent_generated:: middle_adjust_for_foreign_abi_error;
178-
179155#[ derive( Diagnostic ) ]
180156#[ diag( middle_type_length_limit) ]
181157#[ help( middle_consider_type_length_limit) ]
182- pub struct TypeLengthLimit {
158+ pub ( crate ) struct TypeLengthLimit {
183159 #[ primary_span]
184160 pub span : Span ,
185161 pub shrunk : String ,
0 commit comments