File tree Expand file tree Collapse file tree 2 files changed +1
-34
lines changed
compiler/rustc_middle/src Expand file tree Collapse file tree 2 files changed +1
-34
lines changed Original file line number Diff line number Diff line change 1+ use std:: io;
12use std:: path:: Path ;
2- use std:: { fmt, io} ;
33
44use rustc_errors:: codes:: * ;
5- use rustc_errors:: { DiagArgName , DiagArgValue , DiagMessage } ;
65use rustc_macros:: { Diagnostic , Subdiagnostic } ;
76use rustc_span:: { Span , Symbol } ;
87
@@ -114,29 +113,6 @@ pub(super) struct ConstNotUsedTraitAlias {
114113 pub span : Span ,
115114}
116115
117- pub struct CustomSubdiagnostic < ' a > {
118- pub msg : fn ( ) -> DiagMessage ,
119- pub add_args : Box < dyn FnOnce ( & mut dyn FnMut ( DiagArgName , DiagArgValue ) ) + ' a > ,
120- }
121-
122- impl < ' a > CustomSubdiagnostic < ' a > {
123- pub fn label ( x : fn ( ) -> DiagMessage ) -> Self {
124- Self :: label_and_then ( x, |_| { } )
125- }
126- pub fn label_and_then < F : FnOnce ( & mut dyn FnMut ( DiagArgName , DiagArgValue ) ) + ' a > (
127- msg : fn ( ) -> DiagMessage ,
128- f : F ,
129- ) -> Self {
130- Self { msg, add_args : Box :: new ( move |x| f ( x) ) }
131- }
132- }
133-
134- impl fmt:: Debug for CustomSubdiagnostic < ' _ > {
135- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
136- f. debug_struct ( "CustomSubdiagnostic" ) . finish_non_exhaustive ( )
137- }
138- }
139-
140116#[ derive( Diagnostic ) ]
141117pub enum LayoutError < ' tcx > {
142118 #[ diag( "the type `{$ty}` has an unknown layout" ) ]
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use std::num::NonZero;
44use rustc_abi:: Size ;
55use rustc_apfloat:: Float ;
66use rustc_apfloat:: ieee:: { Double , Half , Quad , Single } ;
7- use rustc_errors:: { DiagArgValue , IntoDiagArg } ;
87use rustc_serialize:: { Decodable , Decoder , Encodable , Encoder } ;
98
109use crate :: ty:: TyCtxt ;
@@ -137,14 +136,6 @@ impl std::fmt::Debug for ConstInt {
137136 }
138137}
139138
140- impl IntoDiagArg for ConstInt {
141- // FIXME this simply uses the Debug impl, but we could probably do better by converting both
142- // to an inherent method that returns `Cow`.
143- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
144- DiagArgValue :: Str ( format ! ( "{self:?}" ) . into ( ) )
145- }
146- }
147-
148139/// The raw bytes of a simple value.
149140///
150141/// This is a packed struct in order to allow this type to be optimally embedded in enums
You can’t perform that action at this time.
0 commit comments