@@ -5,8 +5,6 @@ use std::num::ParseIntError;
55use std:: path:: { Path , PathBuf } ;
66use std:: process:: ExitStatus ;
77
8- use rustc_ast as ast;
9- use rustc_ast_pretty:: pprust;
108use rustc_span:: edition:: Edition ;
119
1210use crate :: { DiagArgValue , IntoDiagArg } ;
@@ -69,7 +67,6 @@ macro_rules! into_diag_arg_for_number {
6967}
7068
7169into_diag_arg_using_display ! (
72- ast:: ParamKindOrd ,
7370 std:: io:: Error ,
7471 Box <dyn std:: error:: Error >,
7572 std:: num:: NonZero <u32 >,
@@ -142,30 +139,6 @@ impl IntoDiagArg for PathBuf {
142139 }
143140}
144141
145- impl IntoDiagArg for ast:: Expr {
146- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
147- DiagArgValue :: Str ( Cow :: Owned ( pprust:: expr_to_string ( & self ) ) )
148- }
149- }
150-
151- impl IntoDiagArg for ast:: Path {
152- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
153- DiagArgValue :: Str ( Cow :: Owned ( pprust:: path_to_string ( & self ) ) )
154- }
155- }
156-
157- impl IntoDiagArg for ast:: token:: Token {
158- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
159- DiagArgValue :: Str ( pprust:: token_to_string ( & self ) )
160- }
161- }
162-
163- impl IntoDiagArg for ast:: token:: TokenKind {
164- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
165- DiagArgValue :: Str ( pprust:: token_kind_to_string ( & self ) )
166- }
167- }
168-
169142impl IntoDiagArg for std:: ffi:: CString {
170143 fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
171144 DiagArgValue :: Str ( Cow :: Owned ( self . to_string_lossy ( ) . into_owned ( ) ) )
@@ -178,28 +151,8 @@ impl IntoDiagArg for rustc_data_structures::small_c_str::SmallCStr {
178151 }
179152}
180153
181- impl IntoDiagArg for ast:: Visibility {
182- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
183- let s = pprust:: vis_to_string ( & self ) ;
184- let s = s. trim_end ( ) . to_string ( ) ;
185- DiagArgValue :: Str ( Cow :: Owned ( s) )
186- }
187- }
188-
189154impl IntoDiagArg for Backtrace {
190155 fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
191156 DiagArgValue :: Str ( Cow :: from ( self . to_string ( ) ) )
192157 }
193158}
194-
195- impl IntoDiagArg for ast:: util:: parser:: ExprPrecedence {
196- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
197- DiagArgValue :: Number ( self as i32 )
198- }
199- }
200-
201- impl IntoDiagArg for ast:: FloatTy {
202- fn into_diag_arg ( self , _: & mut Option < std:: path:: PathBuf > ) -> DiagArgValue {
203- DiagArgValue :: Str ( Cow :: Borrowed ( self . name_str ( ) ) )
204- }
205- }
0 commit comments