@@ -41,7 +41,6 @@ pub trait TypeErrCtxtExt<'tcx> {
4141static ALLOWED_FORMAT_SYMBOLS : & [ Symbol ] = & [
4242 kw:: SelfUpper ,
4343 sym:: ItemContext ,
44- sym:: from_method,
4544 sym:: from_desugaring,
4645 sym:: direct,
4746 sym:: cause,
@@ -172,23 +171,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
172171 }
173172 }
174173
175- if let ObligationCauseCode :: ItemObligation ( item)
176- | ObligationCauseCode :: BindingObligation ( item, _)
177- | ObligationCauseCode :: ExprItemObligation ( item, ..)
178- | ObligationCauseCode :: ExprBindingObligation ( item, ..) = * obligation. cause . code ( )
179- {
180- // FIXME: maybe also have some way of handling methods
181- // from other traits? That would require name resolution,
182- // which we might want to be some sort of hygienic.
183- //
184- // Currently I'm leaving it for what I need for `try`.
185- if self . tcx . trait_of_item ( item) == Some ( trait_ref. def_id ) {
186- let method = self . tcx . item_name ( item) ;
187- flags. push ( ( sym:: from_method, None ) ) ;
188- flags. push ( ( sym:: from_method, Some ( method. to_string ( ) ) ) ) ;
189- }
190- }
191-
192174 if let Some ( k) = obligation. cause . span . desugaring_kind ( ) {
193175 flags. push ( ( sym:: from_desugaring, None ) ) ;
194176 flags. push ( ( sym:: from_desugaring, Some ( format ! ( "{:?}" , k) ) ) ) ;
@@ -672,7 +654,7 @@ impl<'tcx> OnUnimplementedFormatString {
672654 None => {
673655 if let Some ( val) = options. get ( & s) {
674656 val
675- } else if s == sym:: from_desugaring || s == sym :: from_method {
657+ } else if s == sym:: from_desugaring {
676658 // don't break messages using these two arguments incorrectly
677659 & empty_string
678660 } else if s == sym:: ItemContext {
0 commit comments